aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RangeConstraintManager.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-06-17 22:28:13 +0000
committerTed Kremenek <kremenek@apple.com>2009-06-17 22:28:13 +0000
commitc87813824896a7124d2dd1c08e4661bbe119abf5 (patch)
tree16541e36b86de1e0b462f6faeaa68184073ee389 /lib/Analysis/RangeConstraintManager.cpp
parentfdf6a56339b3df94d46a49c4977e0a21e8922cf3 (diff)
Remove more uses of GRStateRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RangeConstraintManager.cpp')
-rw-r--r--lib/Analysis/RangeConstraintManager.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/Analysis/RangeConstraintManager.cpp b/lib/Analysis/RangeConstraintManager.cpp
index f6ac2b9748..89f3a716d2 100644
--- a/lib/Analysis/RangeConstraintManager.cpp
+++ b/lib/Analysis/RangeConstraintManager.cpp
@@ -233,7 +233,7 @@ struct GRStateTrait<ConstraintRange>
namespace {
class VISIBILITY_HIDDEN RangeConstraintManager : public SimpleConstraintManager{
- RangeSet GetRange(GRStateRef state, SymbolRef sym);
+ RangeSet GetRange(const GRState *state, SymbolRef sym);
public:
RangeConstraintManager(GRStateManager& statemgr)
: SimpleConstraintManager(statemgr) {}
@@ -289,12 +289,11 @@ const llvm::APSInt* RangeConstraintManager::getSymVal(const GRState* St,
/// Scan all symbols referenced by the constraints. If the symbol is not alive
/// as marked in LSymbols, mark it as dead in DSymbols.
const GRState*
-RangeConstraintManager::RemoveDeadBindings(const GRState* St,
+RangeConstraintManager::RemoveDeadBindings(const GRState* state,
SymbolReaper& SymReaper) {
- GRStateRef state(St, StateMgr);
- ConstraintRangeTy CR = state.get<ConstraintRange>();
- ConstraintRangeTy::Factory& CRFactory = state.get_context<ConstraintRange>();
+ ConstraintRangeTy CR = state->get<ConstraintRange>();
+ ConstraintRangeTy::Factory& CRFactory = state->get_context<ConstraintRange>();
for (ConstraintRangeTy::iterator I = CR.begin(), E = CR.end(); I != E; ++I) {
SymbolRef sym = I.getKey();
@@ -302,7 +301,7 @@ RangeConstraintManager::RemoveDeadBindings(const GRState* St,
CR = CRFactory.Remove(CR, sym);
}
- return state.set<ConstraintRange>(CR);
+ return state->set<ConstraintRange>(CR);
}
//===------------------------------------------------------------------------===
@@ -310,14 +309,14 @@ RangeConstraintManager::RemoveDeadBindings(const GRState* St,
//===------------------------------------------------------------------------===/
RangeSet
-RangeConstraintManager::GetRange(GRStateRef state, SymbolRef sym) {
- if (ConstraintRangeTy::data_type* V = state.get<ConstraintRange>(sym))
+RangeConstraintManager::GetRange(const GRState *state, SymbolRef sym) {
+ if (ConstraintRangeTy::data_type* V = state->get<ConstraintRange>(sym))
return *V;
// Lazily generate a new RangeSet representing all possible values for the
// given symbol type.
- QualType T = state.getSymbolManager().getType(sym);
- BasicValueFactory& BV = state.getBasicVals();
+ QualType T = state->getSymbolManager().getType(sym);
+ BasicValueFactory& BV = state->getBasicVals();
return RangeSet(F, BV.getMinValue(T), BV.getMaxValue(T));
}
@@ -327,12 +326,11 @@ RangeConstraintManager::GetRange(GRStateRef state, SymbolRef sym) {
#define AssumeX(OP)\
const GRState*\
-RangeConstraintManager::AssumeSym ## OP(const GRState* St, SymbolRef sym,\
+RangeConstraintManager::AssumeSym ## OP(const GRState* state, SymbolRef sym,\
const llvm::APSInt& V, bool& isFeasible){\
- GRStateRef state(St, StateMgr);\
- const RangeSet& R = GetRange(state, sym).Add##OP(state.getBasicVals(), F, V);\
+ const RangeSet& R = GetRange(state, sym).Add##OP(state->getBasicVals(), F, V);\
isFeasible = !R.isEmpty();\
- return isFeasible ? state.set<ConstraintRange>(sym, R).getState() : 0;\
+ return isFeasible ? state->set<ConstraintRange>(sym, R) : 0;\
}
AssumeX(EQ)