From 1a3ec57520df7fbd51c62ad931fbdb85025fb49c Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Thu, 20 Aug 2009 03:21:49 +0000 Subject: 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 --- clang/lib/Analysis/CFG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Analysis/CFG.cpp') 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; -- cgit v1.2.3