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);
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);
} // 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,
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())
namespace clang {
class SimpleConstraintManager : public ConstraintManager {
-protected:
- GRStateManager& StateMgr;
public:
- SimpleConstraintManager(GRStateManager& statemgr)
- : StateMgr(statemgr) {}
- virtual ~SimpleConstraintManager();
-
- bool canReasonAbout(SVal X) const;
+ SimpleConstraintManager() {}
+ virtual ~SimpleConstraintManager();
- 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);
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