aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-20 05:52:05 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-20 05:52:05 +0000
commit5251abea41b446c26e3239c8dd6c7edea6fc335d (patch)
tree09e0e6ebf4f25817514dc7367d988f679bddb771 /lib/StaticAnalyzer/Core/CallEvent.cpp
parenta905c4fd256396b589013304d9793cc199b8a0c6 (diff)
Replace SVal 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@175594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/CallEvent.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/CallEvent.cpp b/lib/StaticAnalyzer/Core/CallEvent.cpp
index a75efc60b9..a09d483150 100644
--- a/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -156,9 +156,10 @@ ProgramStateRef CallEvent::invalidateRegions(unsigned BlockCount,
// If we are passing a location wrapped as an integer, unwrap it and
// invalidate the values referred by the location.
- if (nonloc::LocAsInteger *Wrapped = dyn_cast<nonloc::LocAsInteger>(&V))
+ if (llvm::Optional<nonloc::LocAsInteger> Wrapped =
+ V.getAs<nonloc::LocAsInteger>())
V = Wrapped->getLoc();
- else if (!isa<Loc>(V))
+ else if (!V.getAs<Loc>())
continue;
if (const MemRegion *R = V.getAsRegion()) {
@@ -419,7 +420,7 @@ SVal CXXInstanceCall::getCXXThisVal() const {
return UnknownVal();
SVal ThisVal = getSVal(Base);
- assert(ThisVal.isUnknownOrUndef() || isa<Loc>(ThisVal));
+ assert(ThisVal.isUnknownOrUndef() || ThisVal.getAs<Loc>());
return ThisVal;
}