| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of tree_ir.optimization; | 5 part of tree_ir.optimization; |
| 6 | 6 |
| 7 /// Rewrites logical expressions to be more compact in the Tree IR. | 7 /// Rewrites logical expressions to be more compact in the Tree IR. |
| 8 /// | 8 /// |
| 9 /// In this class an expression is said to occur in "boolean context" if | 9 /// In this class an expression is said to occur in "boolean context" if |
| 10 /// its result is immediately applied to boolean conversion. | 10 /// its result is immediately applied to boolean conversion. |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 | 338 |
| 339 Expression makeOr(Expression e1, Expression e2, {bool liftNots: true}) { | 339 Expression makeOr(Expression e1, Expression e2, {bool liftNots: true}) { |
| 340 if (e1 is Not && e2 is Not && liftNots) { | 340 if (e1 is Not && e2 is Not && liftNots) { |
| 341 return new Not(new LogicalOperator.and(e1.operand, e2.operand)); | 341 return new Not(new LogicalOperator.and(e1.operand, e2.operand)); |
| 342 } else { | 342 } else { |
| 343 return new LogicalOperator.or(e1, e2); | 343 return new LogicalOperator.or(e1, e2); |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 | |
| 347 } | 346 } |
| 348 | 347 |
| OLD | NEW |