Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: pkg/compiler/lib/src/tree_ir/optimization/optimization.dart

Issue 1068243002: Overhaul tree IR visitor and rename IR classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add dummy use for RootVisitor and InitializerVisitor without arguments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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';
5 import '../../constants/values.dart' as values; 4 import '../../constants/values.dart' as values;
6 import 'variable_merger.dart'; 5 import 'variable_merger.dart';
7 6
8 export 'variable_merger.dart' show VariableMerger; 7 export 'variable_merger.dart' show VariableMerger;
9 8
10 part 'logical_rewriter.dart'; 9 part 'logical_rewriter.dart';
11 part 'loop_rewriter.dart'; 10 part 'loop_rewriter.dart';
12 part 'statement_rewriter.dart'; 11 part 'statement_rewriter.dart';
13 12
14 /// An optimization pass over the Tree IR. 13 /// An optimization pass over the Tree IR.
15 abstract class Pass { 14 abstract class Pass {
16 /// Applies optimizations to root, rewriting it in the process. 15 /// Applies optimizations to root, rewriting it in the process.
17 void rewrite(ExecutableDefinition root) => root.applyPass(this); 16 void rewrite(RootNode root);
18 void rewriteFieldDefinition(FieldDefinition root);
19 void rewriteFunctionDefinition(FunctionDefinition root);
20 void rewriteConstructorDefinition(ConstructorDefinition root);
21 17
22 String get passName; 18 String get passName;
23 } 19 }
24
25
26 abstract class PassMixin implements Pass {
27 void rewrite(ExecutableDefinition root) => root.applyPass(this);
28 void rewriteExecutableDefinition(ExecutableDefinition root);
29 void rewriteFieldDefinition(FieldDefinition root) {
30 if (!root.hasInitializer) return;
31 rewriteExecutableDefinition(root);
32 }
33 void rewriteFunctionDefinition(FunctionDefinition root) {
34 if (root.isAbstract) return;
35 rewriteExecutableDefinition(root);
36 }
37 void rewriteConstructorDefinition(ConstructorDefinition root) {
38 if (root.isAbstract) return;
39 rewriteExecutableDefinition(root);
40 }
41 }
42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698