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

Unified Diff: pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart

Issue 958603002: Added VariableUse expression to tree IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
Index: pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
index c4611570fd63e18dd7b68df0f8b813549b3ac33b..a25d47f9d27d0ffa0212e0a320059cf28ffb122c 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
@@ -43,7 +43,8 @@ class LoopRewriter extends RecursiveVisitor with PassMixin {
Statement visitAssign(Assign node) {
// Clean up redundant assignments left behind in the previous phase.
- if (node.variable == node.definition) {
+ Expression def = node.definition;
+ if (def is VariableUse && node.variable == def.variable) {
--node.variable.readCount;
--node.variable.writeCount;
return visitStatement(node.next);

Powered by Google App Engine
This is Rietveld 408576698