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

Unified Diff: pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart

Issue 1155463005: dart2js cps: Remove dart2dart from cps pipeline and clean up. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Skip tests specific to the dart backend Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
index 20225c932f89b0efb76ce4f5d9d1d4bceaae83ab..5afd2da9d73baaec13081fe6f81a3f870cbfc49c 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
@@ -16,7 +16,7 @@ import 'tree_ir_nodes.dart';
/// - Variables must not have more than one declaration.
///
class CheckTreeIntegrity extends RecursiveVisitor {
- RootNode topLevelNode;
+ FunctionDefinition topLevelNode;
Map<Variable, int> varReads = <Variable, int>{};
Map<Variable, int> varWrites = <Variable, int>{};
@@ -65,13 +65,6 @@ class CheckTreeIntegrity extends RecursiveVisitor {
read(node.variable);
}
- visitVariableDeclaration(VariableDeclaration node) {
- visitExpression(node.value);
- declare(node.variable);
- visitStatement(node.next);
- undeclare(node.variable);
- }
-
visitAssign(Assign node) {
visitExpression(node.value);
write(node.variable);
@@ -84,16 +77,6 @@ class CheckTreeIntegrity extends RecursiveVisitor {
node.catchParameters.forEach(undeclare);
}
- visitFunctionDeclaration(FunctionDeclaration node) {
- declare(node.variable);
- checkBody(node.definition);
- visitStatement(node.next);
- undeclare(node.variable);
- if (varWrites[node.variable] > 1) {
- error('Assignment to function declaration ${node.variable}');
- }
- }
-
visitJumpTargetBody(JumpTarget target) {
Label label = target.label;
if (label2declaration.containsKey(label)) {
@@ -149,9 +132,9 @@ class CheckTreeIntegrity extends RecursiveVisitor {
checkBody(node);
}
- void checkBody(RootNode node) {
+ void checkBody(FunctionDefinition node) {
node.parameters.forEach(declare);
- node.forEachBody(visitStatement);
+ visitStatement(node.body);
node.parameters.forEach(undeclare);
}
@@ -159,7 +142,7 @@ class CheckTreeIntegrity extends RecursiveVisitor {
throw 'Tree IR integrity violation in ${topLevelNode.element}:\n$message';
}
- void check(RootNode node) {
+ void check(FunctionDefinition node) {
topLevelNode = node;
checkBody(node);
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698