summaryrefslogtreecommitdiffstats
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
commitc960b3e80c86ba702d832e8b59a9e0ff4a506916 (patch)
treef7142a62ab673b16e7bb58ae27c1318e875b9dbf
parent5230191e37d3273875492c921c762aed42cbaf4d (diff)
downloadbcm5719-llvm-c960b3e80c86ba702d832e8b59a9e0ff4a506916.tar.gz
bcm5719-llvm-c960b3e80c86ba702d832e8b59a9e0ff4a506916.zip
clean up this code, add the fixme back.
llvm-svn: 76180
-rw-r--r--clang/lib/Analysis/CFG.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 02fe22c00fe..7ad688fd68d 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/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;
};
OpenPOWER on IntegriCloud