summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFG.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-08-20 03:21:49 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-08-20 03:21:49 +0000
commit1a3ec57520df7fbd51c62ad931fbdb85025fb49c (patch)
tree2fe7e71482c5f44075ab72f606af18c6d9aeed31 /clang/lib/Analysis/CFG.cpp
parentf6bb2a79f21ffc48fecd3fde538949f19f629811 (diff)
downloadbcm5719-llvm-1a3ec57520df7fbd51c62ad931fbdb85025fb49c.tar.gz
bcm5719-llvm-1a3ec57520df7fbd51c62ad931fbdb85025fb49c.zip
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. llvm-svn: 79509
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r--clang/lib/Analysis/CFG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 336faabdfb5..1cfe858c8db 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -1146,7 +1146,7 @@ CFGBlock* CFGBuilder::VisitWhileStmt(WhileStmt* W) {
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;
OpenPOWER on IntegriCloud