diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-20 05:52:05 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-20 05:52:05 +0000 |
commit | 5251abea41b446c26e3239c8dd6c7edea6fc335d (patch) | |
tree | 09e0e6ebf4f25817514dc7367d988f679bddb771 /lib/StaticAnalyzer/Core/MemRegion.cpp | |
parent | a905c4fd256396b589013304d9793cc199b8a0c6 (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/MemRegion.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/MemRegion.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/MemRegion.cpp b/lib/StaticAnalyzer/Core/MemRegion.cpp index a0abe42253..c48343a824 100644 --- a/lib/StaticAnalyzer/Core/MemRegion.cpp +++ b/lib/StaticAnalyzer/Core/MemRegion.cpp @@ -1044,7 +1044,8 @@ RegionRawOffset ElementRegion::getAsArrayOffset() const { // FIXME: generalize to symbolic offsets. SVal index = ER->getIndex(); - if (nonloc::ConcreteInt *CI = dyn_cast<nonloc::ConcreteInt>(&index)) { + if (llvm::Optional<nonloc::ConcreteInt> CI = + index.getAs<nonloc::ConcreteInt>()) { // Update the offset. int64_t i = CI->getValue().getSExtValue(); @@ -1171,7 +1172,8 @@ RegionOffset MemRegion::getAsOffset() const { } SVal Index = ER->getIndex(); - if (const nonloc::ConcreteInt *CI=dyn_cast<nonloc::ConcreteInt>(&Index)) { + if (llvm::Optional<nonloc::ConcreteInt> CI = + Index.getAs<nonloc::ConcreteInt>()) { // Don't bother calculating precise offsets if we already have a // symbolic offset somewhere in the chain. if (SymbolicOffsetBase) |