diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-03-01 03:15:10 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-03-01 03:15:10 +0000 |
commit | 96a7a59119e59da556dcb4f44186255c2336e330 (patch) | |
tree | 5ec8ff4866533803814719555d945347c0056d33 /clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp | |
parent | 9720642c68ff713266ff67987bbd801903b627b0 (diff) | |
download | llvm-96a7a59119e59da556dcb4f44186255c2336e330.zip llvm-96a7a59119e59da556dcb4f44186255c2336e330.tar.gz llvm-96a7a59119e59da556dcb4f44186255c2336e330.tar.bz2 |
In preparation for fixing PR 6884, rework CFGElement to have getAs<> return pointers instead of fresh CFGElements.
- Also, consoldiate getDtorKind() and getKind() into one "kind".
- Add empty getDestructorDecl() method to CFGImplicitDtor.
llvm-svn: 126738
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp index 3d8327f..905a99e 100644 --- a/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp @@ -112,8 +112,8 @@ void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph &G, // such as llvm_unreachable. if (!CB->empty()) { CFGElement First = CB->front(); - if (CFGStmt S = First.getAs<CFGStmt>()) { - if (const CallExpr *CE = dyn_cast<CallExpr>(S.getStmt())) { + if (const CFGStmt *S = First.getAs<CFGStmt>()) { + if (const CallExpr *CE = dyn_cast<CallExpr>(S->getStmt())) { if (CE->isBuiltinCall(Ctx) == Builtin::BI__builtin_unreachable) continue; } @@ -164,8 +164,8 @@ void UnreachableCodeChecker::FindUnreachableEntryPoints(const CFGBlock *CB, // Find the Stmt* in a CFGBlock for reporting a warning const Stmt *UnreachableCodeChecker::getUnreachableStmt(const CFGBlock *CB) { for (CFGBlock::const_iterator I = CB->begin(), E = CB->end(); I != E; ++I) { - if (CFGStmt S = I->getAs<CFGStmt>()) - return S; + if (const CFGStmt *S = I->getAs<CFGStmt>()) + return S->getStmt(); } if (const Stmt *S = CB->getTerminator()) return S; |