aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-17 15:50:19 +0000
committerChris Lattner <sabre@nondot.org>2009-07-17 15:50:19 +0000
commit01bc160ffccc03e4c0583acf82bd7ab80494219a (patch)
tree4987c299861841d13ba56b6343f07f11ec918c00
parent6346f963145ed18b6edf50a78753b47db505e912 (diff)
clean up this code, add the fixme back.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76180 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/CFG.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp
index 02fe22c00f..7ad688fd68 100644
--- a/lib/Analysis/CFG.cpp
+++ b/lib/Analysis/CFG.cpp
@@ -473,19 +473,13 @@ CFGBlock* CFGBuilder::WalkAST(Stmt* Terminator, bool AlwaysAddStmt = false) {
return WalkAST(cast<ParenExpr>(Terminator)->getSubExpr(), AlwaysAddStmt);
case Stmt::CallExprClass: {
- bool NoReturn = false;
- CallExpr *C = cast<CallExpr>(Terminator);
- if (FunctionDecl *FD = C->getDirectCallee())
- if (FD->hasAttr<NoReturnAttr>())
- NoReturn = true;
-
- if (!NoReturn)
+ // If this is a call to a no-return function, this stops the block here.
+ FunctionDecl *FD = cast<CallExpr>(Terminator)->getDirectCallee();
+ if (FD == 0 || !FD->hasAttr<NoReturnAttr>())
break;
- if (Block) {
- if (!FinishBlock(Block))
- return 0;
- }
+ if (Block && !FinishBlock(Block))
+ return 0;
// Create new block with no successor for the remaining pieces.
Block = createBlock(false);
@@ -498,6 +492,7 @@ CFGBlock* CFGBuilder::WalkAST(Stmt* Terminator, bool AlwaysAddStmt = false) {
}
default:
+ // TODO: We can follow objective-c methods (message sends).
break;
};