aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-03-01 03:15:10 +0000
committerTed Kremenek <kremenek@apple.com>2011-03-01 03:15:10 +0000
commit3c0349e87cdbd7316d06d2411d86ee1086e717a5 (patch)
tree28a22c451341fce2bab08cf01d8bbfe75bbfe64e /lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
parent239cbb023c8da689e7722f7146914eed9755e368 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp b/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
index 3d8327fed1..905a99e161 100644
--- a/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
+++ b/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;