diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-23 00:29:34 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-23 00:29:34 +0000 |
commit | 00be69ab5c21ad965959376a4b1cdeaaf13be443 (patch) | |
tree | e37dabd45c984fa9ab4e9ce859301092f133deda /clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | |
parent | 16c8cf0e11dd7f53d3a50609d5821f56e6b52c1a (diff) | |
download | bcm5719-llvm-00be69ab5c21ad965959376a4b1cdeaaf13be443.tar.gz bcm5719-llvm-00be69ab5c21ad965959376a4b1cdeaaf13be443.zip |
Remove the CFGElement "Invalid" state.
Use Optional<CFG*> where invalid states were needed previously. In the one case
where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy
CFGAutomaticObjDtor.
Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek
and Doug Gregor.
Post commit code review feedback on r175796 by Ted Kremenek.
llvm-svn: 175938
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp index b392c43dd33..9bc890847c2 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -657,8 +657,8 @@ void ExprEngine::VisitGuardedExpr(const Expr *Ex, for (CFGBlock::const_reverse_iterator I = SrcBlock->rbegin(), E = SrcBlock->rend(); I != E; ++I) { CFGElement CE = *I; - if (CFGStmt CS = CE.getAs<CFGStmt>()) { - const Expr *ValEx = cast<Expr>(CS.getStmt()); + if (Optional<CFGStmt> CS = CE.getAs<CFGStmt>()) { + const Expr *ValEx = cast<Expr>(CS->getStmt()); hasValue = true; V = state->getSVal(ValEx, LCtx); break; |