diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-07-17 07:29:51 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-07-17 07:29:51 +0000 |
commit | a00425414e8c209cabc25d1826b200aeb94259af (patch) | |
tree | 9f57b8d4eea42fdb6ddcfd0d9fa0f3e7d8538614 /lib/Analysis/CFG.cpp | |
parent | 6fc45052986633e0ba0cc375c9a9eba909888412 (diff) |
Refactor code into a new CallExpr::getDirectCallee() method. Simplify some
code with the new method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFG.cpp')
-rw-r--r-- | lib/Analysis/CFG.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 884bc177fd..02fe22c00f 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -475,14 +475,9 @@ CFGBlock* CFGBuilder::WalkAST(Stmt* Terminator, bool AlwaysAddStmt = false) { case Stmt::CallExprClass: { bool NoReturn = false; CallExpr *C = cast<CallExpr>(Terminator); - Expr *CEE = C->getCallee()->IgnoreParenCasts(); - if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(CEE)) { - // FIXME: We can follow objective-c methods and C++ member functions... - if (FunctionDecl *FD = dyn_cast<FunctionDecl>(DRE->getDecl())) { - if (FD->hasAttr<NoReturnAttr>()) - NoReturn = true; - } - } + if (FunctionDecl *FD = C->getDirectCallee()) + if (FD->hasAttr<NoReturnAttr>()) + NoReturn = true; if (!NoReturn) break; |