Author: zhongxingxu
Date: Wed Aug 19 22:21:49 2009
New Revision: 79509

URL: http://llvm.org/viewvc/llvm-project?rev=79509&view=rev
Log:
If the 'while' has an empty body, set the body to the continue target block.
Although this does not make the CFG more correct, it makes the CFG more 
beautiful without multiple roots.

Modified:
    cfe/trunk/lib/Analysis/CFG.cpp

Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=79509&r1=79508&r2=79509&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Wed Aug 19 22:21:49 2009
@@ -1146,7 +1146,7 @@
     CFGBlock* BodyBlock = addStmt(W->getBody());
 
     if (!BodyBlock)
-      BodyBlock = EntryConditionBlock; // can happen for "while(...) ;"
+      BodyBlock = ContinueTargetBlock; // can happen for "while(...) ;"
     else if (Block) {
       if (!FinishBlock(BodyBlock))
         return 0;


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to