[cfe-commits] r59226 - /cfe/trunk/lib/AST/CFG.cpp
Ted Kremenek
kremenek at apple.com
Wed Nov 12 22:36:45 PST 2008
Author: kremenek
Date: Thu Nov 13 00:36:45 2008
New Revision: 59226
URL: http://llvm.org/viewvc/llvm-project?rev=59226&view=rev
Log:
Correctly connect 'continue' and 'break' statements in Objective-C fast enumeration for blocks to the appropriate basic blocks.
Modified:
cfe/trunk/lib/AST/CFG.cpp
Modified: cfe/trunk/lib/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CFG.cpp?rev=59226&r1=59225&r2=59226&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CFG.cpp (original)
+++ cfe/trunk/lib/AST/CFG.cpp Thu Nov 13 00:36:45 2008
@@ -839,7 +839,14 @@
ConditionBlock->setTerminator(S); // No need to call FinishBlock; 1 stmt
// Now create the true branch.
+ // Save the current values for the continue and break targets
+ SaveAndRestore<CFGBlock*> save_continue(ContinueTargetBlock),
+ save_break(BreakTargetBlock);
+
+ BreakTargetBlock = LoopSuccessor;
+ ContinueTargetBlock = ConditionBlock;
Succ = ConditionBlock;
+
CFGBlock* BodyBlock = Visit(S->getBody());
FinishBlock(BodyBlock);
More information about the cfe-commits
mailing list