aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-21 20:58:29 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-21 20:58:29 +0000
commitfdf6a279c9a75c778eba382d9a156697092982a1 (patch)
treee67bc01445260b8cd78ddfd21f1a9f4fe059ac79 /lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
parent05f8ff134d5f270bd7bfe4aaef491bd3febddea1 (diff)
Replace CFGElement llvm::cast support to be well-defined.
See r175462 for another example/more details. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175796 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 e2d14e19fe..c939d05df4 100644
--- a/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
@@ -131,8 +131,8 @@ void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph &G,
bool foundUnreachable = false;
for (CFGBlock::const_iterator ci = CB->begin(), ce = CB->end();
ci != ce; ++ci) {
- if (const CFGStmt *S = (*ci).getAs<CFGStmt>())
- if (const CallExpr *CE = dyn_cast<CallExpr>(S->getStmt())) {
+ if (CFGStmt S = (*ci).getAs<CFGStmt>())
+ if (const CallExpr *CE = dyn_cast<CallExpr>(S.getStmt())) {
if (CE->isBuiltinCall() == Builtin::BI__builtin_unreachable) {
foundUnreachable = true;
break;
@@ -189,8 +189,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 (const CFGStmt *S = I->getAs<CFGStmt>())
- return S->getStmt();
+ if (CFGStmt S = I->getAs<CFGStmt>())
+ return S.getStmt();
}
if (const Stmt *S = CB->getTerminator())
return S;