| 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 import '../../elements/elements.dart'; | 10 import '../../elements/elements.dart'; |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 node.value = visitExpression(node.value); | 604 node.value = visitExpression(node.value); |
| 605 } | 605 } |
| 606 return node; | 606 return node; |
| 607 } | 607 } |
| 608 | 608 |
| 609 Statement visitThrow(Throw node) { | 609 Statement visitThrow(Throw node) { |
| 610 node.value = visitExpression(node.value); | 610 node.value = visitExpression(node.value); |
| 611 return node; | 611 return node; |
| 612 } | 612 } |
| 613 | 613 |
| 614 Statement visitRethrow(Rethrow node) { | |
| 615 return node; | |
| 616 } | |
| 617 | |
| 618 Statement visitUnreachable(Unreachable node) { | 614 Statement visitUnreachable(Unreachable node) { |
| 619 return node; | 615 return node; |
| 620 } | 616 } |
| 621 | 617 |
| 622 Statement visitBreak(Break node) { | 618 Statement visitBreak(Break node) { |
| 623 // Redirect through chain of breaks. | 619 // Redirect through chain of breaks. |
| 624 // Note that useCount was accounted for at visitLabeledStatement. | 620 // Note that useCount was accounted for at visitLabeledStatement. |
| 625 // Note redirect may return either a Break or Continue statement. | 621 // Note redirect may return either a Break or Continue statement. |
| 626 Jump jump = redirect(node); | 622 Jump jump = redirect(node); |
| 627 if (jump is Break && | 623 if (jump is Break && |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 VariableUseCallback callback; | 1351 VariableUseCallback callback; |
| 1356 | 1352 |
| 1357 VariableUseVisitor(this.callback); | 1353 VariableUseVisitor(this.callback); |
| 1358 | 1354 |
| 1359 visitVariableUse(VariableUse use) => callback(use); | 1355 visitVariableUse(VariableUse use) => callback(use); |
| 1360 | 1356 |
| 1361 static void visit(Expression node, VariableUseCallback callback) { | 1357 static void visit(Expression node, VariableUseCallback callback) { |
| 1362 new VariableUseVisitor(callback).visitExpression(node); | 1358 new VariableUseVisitor(callback).visitExpression(node); |
| 1363 } | 1359 } |
| 1364 } | 1360 } |
| OLD | NEW |