| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 return new LogicalOperator.or(e1, e2); | 497 return new LogicalOperator.or(e1, e2); |
| 498 } | 498 } |
| 499 } | 499 } |
| 500 | 500 |
| 501 /// Destructively updates each entry of [l] with the result of visiting it. | 501 /// Destructively updates each entry of [l] with the result of visiting it. |
| 502 void _rewriteList(List<Expression> l) { | 502 void _rewriteList(List<Expression> l) { |
| 503 for (int i = 0; i < l.length; i++) { | 503 for (int i = 0; i < l.length; i++) { |
| 504 l[i] = visitExpression(l[i]); | 504 l[i] = visitExpression(l[i]); |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 |
| 508 @override |
| 509 Expression visitTypeExpression(TypeExpression node) { |
| 510 _rewriteList(node.arguments); |
| 511 return node; |
| 512 } |
| 507 } | 513 } |
| 508 | 514 |
| OLD | NEW |