[cfe-commits] r79509 - /cfe/trunk/lib/Analysis/CFG.cpp

Zhongxing Xu xuzhongxing at gmail.com
Wed Aug 19 20:21:50 PDT 2009


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;





More information about the cfe-commits mailing list