| OLD | NEW |
| 1 library tree_ir.optimization; | 1 library tree_ir.optimization; |
| 2 | 2 |
| 3 import '../tree_ir_nodes.dart'; | 3 import '../tree_ir_nodes.dart'; |
| 4 import '../../elements/elements.dart'; | 4 import '../../elements/elements.dart'; |
| 5 import '../../constants/values.dart' as values; | 5 import '../../constants/values.dart' as values; |
| 6 import 'variable_merger.dart'; |
| 6 | 7 |
| 7 part 'copy_propagator.dart'; | 8 export 'variable_merger.dart' show VariableMerger; |
| 9 |
| 8 part 'logical_rewriter.dart'; | 10 part 'logical_rewriter.dart'; |
| 9 part 'loop_rewriter.dart'; | 11 part 'loop_rewriter.dart'; |
| 10 part 'statement_rewriter.dart'; | 12 part 'statement_rewriter.dart'; |
| 11 | 13 |
| 12 /// An optimization pass over the Tree IR. | 14 /// An optimization pass over the Tree IR. |
| 13 abstract class Pass { | 15 abstract class Pass { |
| 14 /// Applies optimizations to root, rewriting it in the process. | 16 /// Applies optimizations to root, rewriting it in the process. |
| 15 void rewrite(ExecutableDefinition root) => root.applyPass(this); | 17 void rewrite(ExecutableDefinition root) => root.applyPass(this); |
| 16 void rewriteFieldDefinition(FieldDefinition root); | 18 void rewriteFieldDefinition(FieldDefinition root); |
| 17 void rewriteFunctionDefinition(FunctionDefinition root); | 19 void rewriteFunctionDefinition(FunctionDefinition root); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 rewriteExecutableDefinition(root); | 31 rewriteExecutableDefinition(root); |
| 30 } | 32 } |
| 31 void rewriteFunctionDefinition(FunctionDefinition root) { | 33 void rewriteFunctionDefinition(FunctionDefinition root) { |
| 32 if (root.isAbstract) return; | 34 if (root.isAbstract) return; |
| 33 rewriteExecutableDefinition(root); | 35 rewriteExecutableDefinition(root); |
| 34 } | 36 } |
| 35 void rewriteConstructorDefinition(ConstructorDefinition root) { | 37 void rewriteConstructorDefinition(ConstructorDefinition root) { |
| 36 if (root.isAbstract) return; | 38 if (root.isAbstract) return; |
| 37 rewriteExecutableDefinition(root); | 39 rewriteExecutableDefinition(root); |
| 38 } | 40 } |
| 39 } | 41 } |
| 42 |
| OLD | NEW |