Index: pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart |
index e7a7d14284d2dbcf6d1829ace3bfaafa4c9c2085..0d7c066ce0b6a7dec44d17c2310d8ab34d15cff4 100644 |
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart |
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart |
@@ -26,7 +26,7 @@ const bool ENABLE_DUMP = tracer.TRACE_FILTER_PATTERN != null; |
/// |
class CheckCpsIntegrity extends RecursiveVisitor { |
- RootNode topLevelNode; |
+ FunctionDefinition topLevelNode; |
Set<Definition> seenDefinitions = new Set<Definition>(); |
Map<Definition, Set<Reference>> seenReferences = |
@@ -78,15 +78,6 @@ class CheckCpsIntegrity extends RecursiveVisitor { |
} |
@override |
- visitBody(Body node) { |
- markAsSeen(node.returnContinuation); |
- if (!node.returnContinuation.isReturnContinuation) { |
- error('Return continuation with a body', node); |
- } |
- doInScope([node.returnContinuation], node, () => visit(node.body)); |
- } |
- |
- @override |
visitLetPrim(LetPrim node) { |
markAsSeen(node.primitive); |
visit(node.primitive); |
@@ -106,24 +97,14 @@ class CheckCpsIntegrity extends RecursiveVisitor { |
markAsSeen(node.thisParameter); |
} |
node.parameters.forEach(markAsSeen); |
- if (node.body != null) { |
- doInOptionalScope(node.thisParameter, node, |
- () => doInScope(node.parameters, node, () => visit(node.body))); |
- } |
- } |
- |
- @override |
- visitConstructorDefinition(ConstructorDefinition node) { |
- if (node.thisParameter != null) { |
- markAsSeen(node.thisParameter); |
+ markAsSeen(node.returnContinuation); |
+ if (!node.returnContinuation.isReturnContinuation) { |
+ error('Return continuation with a body', node); |
} |
- node.parameters.forEach(markAsSeen); |
- doInScope(node.parameters, node, () { |
- if (node.initializers != null) node.initializers.forEach(visit); |
- if (node.body != null) { |
- doInOptionalScope(node.thisParameter, node, () => visit(node.body)); |
- } |
- }); |
+ doInOptionalScope(node.thisParameter, node, |
+ () => doInScope(node.parameters, node, |
+ () => doInScope([node.returnContinuation], node, |
+ () => visit(node.body)))); |
} |
doInOptionalScope(Parameter parameter, Node node, action) { |
@@ -133,15 +114,6 @@ class CheckCpsIntegrity extends RecursiveVisitor { |
} |
@override |
- visitDeclareFunction(DeclareFunction node) { |
- markAsSeen(node.variable); |
- doInScope([node.variable], node, () { |
- visit(node.definition); |
- visit(node.body); |
- }); |
- } |
- |
- @override |
processReference(Reference reference) { |
if (!bindings.containsKey(reference.definition)) { |
error('Referenced out of scope: ${reference.definition}', reference); |
@@ -209,7 +181,7 @@ class CheckCpsIntegrity extends RecursiveVisitor { |
'$sexpr\n'; |
} |
- void check(RootNode node) { |
+ void check(FunctionDefinition node) { |
topLevelNode = node; |
visit(node); |