SVal UpperBound, bool Assumption,
bool& isFeasible) = 0;
- virtual const GRState* AddNE(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V) = 0;
virtual const llvm::APSInt* getSymVal(const GRState* St, SymbolRef sym) = 0;
virtual bool isEqual(const GRState* St, SymbolRef sym,
isFeasible);
}
- const GRState* AddNE(const GRState* St, SymbolRef sym, const llvm::APSInt& V) {
- return ConstraintMgr->AddNE(St, sym, V);
- }
-
const llvm::APSInt* getSymVal(const GRState* St, SymbolRef sym) {
return ConstraintMgr->getSymVal(St, sym);
}
return GRStateRef(Mgr->Unbind(St, LV), *Mgr);
}
- GRStateRef AddNE(SymbolRef sym, const llvm::APSInt& V) {
- return GRStateRef(Mgr->AddNE(St, sym, V), *Mgr);
- }
-
// Trait based GDM dispatch.
template<typename T>
typename GRStateTrait<T>::data_type get() const {
SVal GetLValue(const VarDecl* VD) {
return Mgr->GetLValue(St, VD);
}
+
+ GRStateRef Assume(SVal Cond, bool Assumption, bool& isFeasible) {
+ return GRStateRef(Mgr->Assume(St, Cond, Assumption, isFeasible), *Mgr);
+ }
// Pretty-printing.
void print(std::ostream& Out, const char* nl = "\n",
const SymIntConstraint& C, bool& isFeasible);
const GRState* AssumeSymNE(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V, bool& isFeasible);
+ const llvm::APSInt& V, bool& isFeasible);
const GRState* AssumeSymEQ(const GRState* St, SymbolRef sym,
const llvm::APSInt& V, bool& isFeasible);
#endif
// FIXME: Add a flag to the checker where allocations are allowed to fail.
- if (RE.getKind() == RetEffect::OwnedAllocatedSymbol)
- state = state.AddNE(Sym, Eng.getBasicVals().getZeroWithPtrWidth());
+ if (RE.getKind() == RetEffect::OwnedAllocatedSymbol) {
+ bool isFeasible;
+ state = state.Assume(loc::SymbolVal(Sym), true, isFeasible);
+ assert(isFeasible && "Cannot assume fresh symbol is non-null.");
+ }
break;
}