| 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 library tree_ir.optimization.statement_rewriter; | 5 library tree_ir.optimization.statement_rewriter; |
| 6 | 6 |
| 7 import 'optimization.dart' show Pass; | 7 import 'optimization.dart' show Pass; |
| 8 import '../tree_ir_nodes.dart'; | 8 import '../tree_ir_nodes.dart'; |
| 9 import '../../io/source_information.dart'; | 9 import '../../io/source_information.dart'; |
| 10 | 10 |
| (...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 @override | 1130 @override |
| 1131 Statement visitForeignStatement(ForeignStatement node) { | 1131 Statement visitForeignStatement(ForeignStatement node) { |
| 1132 _rewriteList(node.arguments); | 1132 _rewriteList(node.arguments); |
| 1133 return node; | 1133 return node; |
| 1134 } | 1134 } |
| 1135 | 1135 |
| 1136 @override | 1136 @override |
| 1137 Expression visitAwait(Await node) { | 1137 Expression visitAwait(Await node) { |
| 1138 node.input = visitExpression(node.input); |
| 1139 return node; |
| 1140 } |
| 1141 |
| 1142 @override |
| 1143 Statement visitYield(Yield node) { |
| 1144 node.input = visitExpression(node.input); |
| 1138 return node; | 1145 return node; |
| 1139 } | 1146 } |
| 1140 } | 1147 } |
| 1141 | 1148 |
| 1142 /// Result of combining two expressions, with the potential for reverting the | 1149 /// Result of combining two expressions, with the potential for reverting the |
| 1143 /// combination. | 1150 /// combination. |
| 1144 /// | 1151 /// |
| 1145 /// Reverting a combination is done by calling [uncombine]. In this case, | 1152 /// Reverting a combination is done by calling [uncombine]. In this case, |
| 1146 /// both the original expressions should remain in the tree, and the [combined] | 1153 /// both the original expressions should remain in the tree, and the [combined] |
| 1147 /// expression should be orphaned. | 1154 /// expression should be orphaned. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 VariableUseVisitor(this.callback); | 1234 VariableUseVisitor(this.callback); |
| 1228 | 1235 |
| 1229 visitVariableUse(VariableUse use) => callback(use); | 1236 visitVariableUse(VariableUse use) => callback(use); |
| 1230 | 1237 |
| 1231 visitInnerFunction(FunctionDefinition node) {} | 1238 visitInnerFunction(FunctionDefinition node) {} |
| 1232 | 1239 |
| 1233 static void visit(Expression node, VariableUseCallback callback) { | 1240 static void visit(Expression node, VariableUseCallback callback) { |
| 1234 new VariableUseVisitor(callback).visitExpression(node); | 1241 new VariableUseVisitor(callback).visitExpression(node); |
| 1235 } | 1242 } |
| 1236 } | 1243 } |
| OLD | NEW |