[cfe-commits] r76180 - /cfe/trunk/lib/Analysis/CFG.cpp
Chris Lattner
sabre at nondot.org
Fri Jul 17 08:50:37 PDT 2009
Author: lattner
Date: Fri Jul 17 10:50:19 2009
New Revision: 76180
URL: http://llvm.org/viewvc/llvm-project?rev=76180&view=rev
Log:
clean up this code, add the fixme back.
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=76180&r1=76179&r2=76180&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Fri Jul 17 10:50:19 2009
@@ -473,19 +473,13 @@
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 @@
}
default:
+ // TODO: We can follow objective-c methods (message sends).
break;
};
More information about the cfe-commits
mailing list