summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-23 00:29:34 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-23 00:29:34 +0000
commit00be69ab5c21ad965959376a4b1cdeaaf13be443 (patch)
treee37dabd45c984fa9ab4e9ce859301092f133deda /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parent16c8cf0e11dd7f53d3a50609d5821f56e6b52c1a (diff)
downloadbcm5719-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/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 32935155446..933df489884 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -971,11 +971,12 @@ CallEventManager::getCaller(const StackFrameContext *CalleeCtx,
SVal ThisVal = State->getSVal(ThisPtr);
const Stmt *Trigger;
- if (CFGAutomaticObjDtor AutoDtor = E.getAs<CFGAutomaticObjDtor>())
- Trigger = AutoDtor.getTriggerStmt();
+ if (Optional<CFGAutomaticObjDtor> AutoDtor = E.getAs<CFGAutomaticObjDtor>())
+ Trigger = AutoDtor->getTriggerStmt();
else
Trigger = Dtor->getBody();
return getCXXDestructorCall(Dtor, Trigger, ThisVal.getAsRegion(),
- E.getAs<CFGBaseDtor>(), State, CallerCtx);
+ E.getAs<CFGBaseDtor>().hasValue(), State,
+ CallerCtx);
}
OpenPOWER on IntegriCloud