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

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: Updated docs regarding catch parameters 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 b78122b72428cd6fec6b1441b6419d7a7c86840a..0913a117172b7e3ea4c3bf6f168d5cf115606418 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