[cfe-commits] r47666 - /cfe/trunk/AST/CFG.cpp

Ted Kremenek kremenek at apple.com
Tue Feb 26 23:20:00 PST 2008


Author: kremenek
Date: Wed Feb 27 01:20:00 2008
New Revision: 47666

URL: http://llvm.org/viewvc/llvm-project?rev=47666&view=rev
Log:
Bug fix in CFG construction: Properly register the loop head as the implicit
successor of blocks created above it.

Modified:
    cfe/trunk/AST/CFG.cpp

Modified: cfe/trunk/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/CFG.cpp?rev=47666&r1=47665&r2=47666&view=diff

==============================================================================
--- cfe/trunk/AST/CFG.cpp (original)
+++ cfe/trunk/AST/CFG.cpp Wed Feb 27 01:20:00 2008
@@ -679,6 +679,7 @@
     // There is no loop initialization.   We are thus basically a while 
     // loop.  NULL out Block to force lazy block construction.
     Block = NULL;
+    Succ = EntryConditionBlock;
     return EntryConditionBlock;
   }
 }
@@ -758,6 +759,7 @@
   Block = NULL;
   
   // Return the condition block, which is the dominating block for the loop.
+  Succ = EntryConditionBlock;
   return EntryConditionBlock;
 }
 
@@ -790,11 +792,9 @@
     if (Block) FinishBlock(EntryConditionBlock);
   }
   
-  // The condition block is the implicit successor for the loop body as
-  // well as any code above the loop.
+  // The condition block is the implicit successor for the loop body.
   Succ = EntryConditionBlock;
 
-
   // Process the loop body.
   CFGBlock* BodyBlock = NULL;
   {
@@ -836,6 +836,7 @@
   Block = NULL;
   
   // Return the loop body, which is the dominating block for the loop.
+  Succ = BodyBlock;
   return BodyBlock;
 }
 





More information about the cfe-commits mailing list