From 00be69ab5c21ad965959376a4b1cdeaaf13be443 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sat, 23 Feb 2013 00:29:34 +0000 Subject: Remove the CFGElement "Invalid" state. Use Optional 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 --- clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp') 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()) { - const Expr *ValEx = cast(CS.getStmt()); + if (Optional CS = CE.getAs()) { + const Expr *ValEx = cast(CS->getStmt()); hasValue = true; V = state->getSVal(ValEx, LCtx); break; -- cgit v1.2.3