Remove GRStateManager& field from SimpleConstraintManager.

llvm-svn: 73735
This commit is contained in:
Ted Kremenek 2009-06-18 23:20:05 +00:00
parent a0ca298f8a
commit 4c6a367182
4 changed files with 12 additions and 26 deletions

View File

@ -51,7 +51,7 @@ class VISIBILITY_HIDDEN BasicConstraintManager
GRState::IntSetTy::Factory ISetFactory;
public:
BasicConstraintManager(GRStateManager& statemgr)
: SimpleConstraintManager(statemgr), ISetFactory(statemgr.getAllocator()) {}
: ISetFactory(statemgr.getAllocator()) {}
const GRState* AssumeSymNE(const GRState* state, SymbolRef sym,
const llvm::APSInt& V);

View File

@ -235,8 +235,7 @@ namespace {
class VISIBILITY_HIDDEN RangeConstraintManager : public SimpleConstraintManager{
RangeSet GetRange(const GRState *state, SymbolRef sym);
public:
RangeConstraintManager(GRStateManager& statemgr)
: SimpleConstraintManager(statemgr) {}
RangeConstraintManager() {}
const GRState* AssumeSymNE(const GRState* St, SymbolRef sym,
const llvm::APSInt& V);
@ -275,9 +274,8 @@ private:
} // end anonymous namespace
ConstraintManager* clang::CreateRangeConstraintManager(GRStateManager& StateMgr)
{
return new RangeConstraintManager(StateMgr);
ConstraintManager* clang::CreateRangeConstraintManager(GRStateManager&) {
return new RangeConstraintManager();
}
const llvm::APSInt* RangeConstraintManager::getSymVal(const GRState* St,

View File

@ -234,7 +234,7 @@ const GRState *SimpleConstraintManager::AssumeInBound(const GRState *state,
if (!(isa<nonloc::ConcreteInt>(Idx) && isa<nonloc::ConcreteInt>(UpperBound)))
return state;
const llvm::APSInt& Zero = getBasicVals().getZeroWithPtrWidth(false);
const llvm::APSInt& Zero = state->getBasicVals().getZeroWithPtrWidth(false);
llvm::APSInt IdxV = cast<nonloc::ConcreteInt>(Idx).getValue();
// IdxV might be too narrow.
if (IdxV.getBitWidth() < Zero.getBitWidth())

View File

@ -20,22 +20,18 @@
namespace clang {
class SimpleConstraintManager : public ConstraintManager {
protected:
GRStateManager& StateMgr;
public:
SimpleConstraintManager(GRStateManager& statemgr)
: StateMgr(statemgr) {}
virtual ~SimpleConstraintManager();
SimpleConstraintManager() {}
virtual ~SimpleConstraintManager();
bool canReasonAbout(SVal X) const;
virtual const GRState *Assume(const GRState *state, SVal Cond,
bool Assumption);
//===------------------------------------------------------------------===//
// Common implementation for the interface provided by ConstraintManager.
//===------------------------------------------------------------------===//
bool canReasonAbout(SVal X) const;
const GRState *Assume(const GRState *state, SVal Cond, bool Assumption);
const GRState *Assume(const GRState *state, Loc Cond, bool Assumption);
const GRState *Assume(const GRState *state, NonLoc Cond, bool Assumption);
@ -77,14 +73,6 @@ protected:
const GRState *AssumeAux(const GRState *state, Loc Cond,bool Assumption);
const GRState *AssumeAux(const GRState *state, NonLoc Cond, bool Assumption);
//===------------------------------------------------------------------===//
// FIXME: These can probably be removed now.
//===------------------------------------------------------------------===//
private:
BasicValueFactory& getBasicVals() { return StateMgr.getBasicVals(); }
SymbolManager& getSymbolManager() const { return StateMgr.getSymbolManager(); }
};
} // end clang namespace