aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/GRState.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-12-02 07:49:45 +0000
committerTed Kremenek <kremenek@apple.com>2010-12-02 07:49:45 +0000
commitc8413fd03f73084a5c93028f8b4db619fc388087 (patch)
tree0815a7cb0b9c477e280a91e4c89713488e43f7f2 /lib/Checker/GRState.cpp
parent0608f53744ccf88c4d21d6b500f6d23927533ac9 (diff)
Merge ValueManager into SValBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/GRState.cpp')
-rw-r--r--lib/Checker/GRState.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/Checker/GRState.cpp b/lib/Checker/GRState.cpp
index 0a2b9a388f..e5653f8fd8 100644
--- a/lib/Checker/GRState.cpp
+++ b/lib/Checker/GRState.cpp
@@ -240,31 +240,32 @@ const GRState *GRState::assumeInBound(DefinedOrUnknownSVal Idx,
// This is the same as Idx + MIN < UpperBound + MIN, if overflow is allowed.
// FIXME: This should probably be part of SValBuilder.
GRStateManager &SM = getStateManager();
- ValueManager &VM = SM.getValueManager();
- SValBuilder &SV = VM.getSValBuilder();
- ASTContext &Ctx = VM.getContext();
+ SValBuilder &svalBuilder = SM.getSValBuilder();
+ ASTContext &Ctx = svalBuilder.getContext();
// Get the offset: the minimum value of the array index type.
- BasicValueFactory &BVF = VM.getBasicValueFactory();
- // FIXME: This should be using ValueManager::ArrayIndexTy...somehow.
- QualType IndexTy = Ctx.IntTy;
- nonloc::ConcreteInt Min = BVF.getMinValue(IndexTy);
+ BasicValueFactory &BVF = svalBuilder.getBasicValueFactory();
+ // FIXME: This should be using ValueManager::ArrayindexTy...somehow.
+ QualType indexTy = Ctx.IntTy;
+ nonloc::ConcreteInt Min = BVF.getMinValue(indexTy);
// Adjust the index.
- SVal newIdx = SV.evalBinOpNN(this, BO_Add,
- cast<NonLoc>(Idx), Min, IndexTy);
+ SVal newIdx = svalBuilder.evalBinOpNN(this, BO_Add,
+ cast<NonLoc>(Idx), Min, indexTy);
if (newIdx.isUnknownOrUndef())
return this;
// Adjust the upper bound.
- SVal NewBound = SV.evalBinOpNN(this, BO_Add,
- cast<NonLoc>(UpperBound), Min, IndexTy);
- if (NewBound.isUnknownOrUndef())
+ SVal newBound =
+ svalBuilder.evalBinOpNN(this, BO_Add, cast<NonLoc>(UpperBound),
+ Min, indexTy);
+
+ if (newBound.isUnknownOrUndef())
return this;
// Build the actual comparison.
- SVal inBound = SV.evalBinOpNN(this, BO_LT,
- cast<NonLoc>(newIdx), cast<NonLoc>(NewBound),
+ SVal inBound = svalBuilder.evalBinOpNN(this, BO_LT,
+ cast<NonLoc>(newIdx), cast<NonLoc>(newBound),
Ctx.IntTy);
if (inBound.isUnknownOrUndef())
return this;