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

Unified Diff: pkg/compiler/lib/src/cps_ir/remove_refinements.dart

Issue 1375513002: dart2js cps: Add helpers for common IR manipulation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix type annotation Created 5 years, 3 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/cps_ir/redundant_phi.dart ('k') | pkg/compiler/lib/src/cps_ir/scalar_replacement.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/remove_refinements.dart
diff --git a/pkg/compiler/lib/src/cps_ir/remove_refinements.dart b/pkg/compiler/lib/src/cps_ir/remove_refinements.dart
index f5088ae214008351cbb595d737c6578bd1ba4478..4d7aae3d847ccd9a76dd70788a1867e713e706dd 100644
--- a/pkg/compiler/lib/src/cps_ir/remove_refinements.dart
+++ b/pkg/compiler/lib/src/cps_ir/remove_refinements.dart
@@ -22,14 +22,13 @@ class RemoveRefinements extends RecursiveVisitor implements Pass {
@override
Expression traverseLetPrim(LetPrim node) {
+ Expression next = node.body;
if (node.primitive is Refinement) {
Refinement refinement = node.primitive;
refinement.value.definition.substituteFor(refinement);
- refinement.value.unlink();
- InteriorNode parent = node.parent;
- parent.body = node.body;
- node.body.parent = parent;
+ refinement.destroy();
+ node.remove();
}
- return node.body;
+ return next;
}
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/redundant_phi.dart ('k') | pkg/compiler/lib/src/cps_ir/scalar_replacement.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698