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: src/data-flow.cc

Issue 1074009: Mark all loop conditions. (Closed)
Patch Set: Negate test to match previous (and correct) behavior. Created 10 years, 9 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: src/data-flow.cc
diff --git a/src/data-flow.cc b/src/data-flow.cc
index efd14fcb184facc8e04937e3f5923a5b0f719568..7330215af04e3daf44be33a5c1e973b54f103367 100644
--- a/src/data-flow.cc
+++ b/src/data-flow.cc
@@ -214,12 +214,13 @@ static Statement* PeelForLoop(ForStatement* stmt) {
block->AddStatement(init);
}
- // Copy the condition.
+ // Copy the condition but mark the copy as no longer a loop condition.
CopyAstVisitor copy_visitor;
Expression* cond_copy = stmt->cond() != NULL
? copy_visitor.DeepCopyExpr(stmt->cond())
: new Literal(Factory::true_value());
if (copy_visitor.HasStackOverflow()) return NULL;
+ cond_copy->set_is_loop_condition(false);
Søren Thygesen Gjesse 2010/03/23 13:21:02 Strictly speaking this is a lie, and it will cause
Kevin Millikin (Chromium) 2010/03/23 13:36:26 I guess not. I've removed it for now.
// Construct a block with the peeled body and the rest of the for-loop.
Statement* body_copy = copy_visitor.DeepCopyStmt(stmt->body());
« no previous file with comments | « src/ast.cc ('k') | src/ia32/codegen-ia32.cc » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698