Create a symbolic region instead of a loc::SymbolVal. This is a continued step
to eliminate the use of loc::SymbolVal. llvm-svn: 68685
This commit is contained in:
parent
fc8b2b9ff9
commit
cb5d3ced70
|
|
@ -76,8 +76,8 @@ public:
|
||||||
static SVal GetRValueSymbolVal(SymbolManager& SymMgr, MemRegionManager& MRMgr,
|
static SVal GetRValueSymbolVal(SymbolManager& SymMgr, MemRegionManager& MRMgr,
|
||||||
const MemRegion* R);
|
const MemRegion* R);
|
||||||
|
|
||||||
static SVal GetConjuredSymbolVal(SymbolManager& SymMgr, const Expr *E,
|
static SVal GetConjuredSymbolVal(SymbolManager& SymMgr, MemRegionManager&,
|
||||||
unsigned Count);
|
const Expr *E, unsigned Count);
|
||||||
|
|
||||||
inline bool isUnknown() const {
|
inline bool isUnknown() const {
|
||||||
return getRawKind() == UnknownKind;
|
return getRawKind() == UnknownKind;
|
||||||
|
|
|
||||||
|
|
@ -2536,7 +2536,8 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
|
||||||
|
|
||||||
// Conjure a new symbol if necessary to recover precision.
|
// Conjure a new symbol if necessary to recover precision.
|
||||||
if (Result.isUnknown() || !getConstraintManager().canReasonAbout(Result))
|
if (Result.isUnknown() || !getConstraintManager().canReasonAbout(Result))
|
||||||
Result = SVal::GetConjuredSymbolVal(SymMgr, Ex,
|
Result = SVal::GetConjuredSymbolVal(SymMgr,
|
||||||
|
getStoreManager().getRegionManager(),Ex,
|
||||||
Builder->getCurrentBlockCount());
|
Builder->getCurrentBlockCount());
|
||||||
|
|
||||||
state = BindExpr(state, U, U->isPostfix() ? V2 : Result);
|
state = BindExpr(state, U, U->isPostfix() ? V2 : Result);
|
||||||
|
|
|
||||||
|
|
@ -291,26 +291,23 @@ SVal SVal::GetRValueSymbolVal(SymbolManager& SymMgr, MemRegionManager& MRMgr,
|
||||||
return Loc::MakeVal(MRMgr.getSymbolicRegion(sym));
|
return Loc::MakeVal(MRMgr.getSymbolicRegion(sym));
|
||||||
|
|
||||||
// Only handle integers for now.
|
// Only handle integers for now.
|
||||||
if (T->isIntegerType())
|
if (T->isIntegerType() && T->isScalarType())
|
||||||
return NonLoc::MakeVal(sym);
|
return NonLoc::MakeVal(sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
return UnknownVal();
|
return UnknownVal();
|
||||||
}
|
}
|
||||||
|
|
||||||
SVal SVal::GetConjuredSymbolVal(SymbolManager &SymMgr, const Expr* E,
|
SVal SVal::GetConjuredSymbolVal(SymbolManager &SymMgr, MemRegionManager& MRMgr,
|
||||||
unsigned Count) {
|
const Expr* E, unsigned Count) {
|
||||||
|
|
||||||
QualType T = E->getType();
|
QualType T = E->getType();
|
||||||
|
SymbolRef sym = SymMgr.getConjuredSymbol(E, Count);
|
||||||
if (Loc::IsLocType(T)) {
|
|
||||||
SymbolRef Sym = SymMgr.getConjuredSymbol(E, Count);
|
if (Loc::IsLocType(T))
|
||||||
return loc::SymbolVal(Sym);
|
return Loc::MakeVal(MRMgr.getSymbolicRegion(sym));
|
||||||
}
|
|
||||||
else if (T->isIntegerType() && T->isScalarType()) {
|
if (T->isIntegerType() && T->isScalarType())
|
||||||
SymbolRef Sym = SymMgr.getConjuredSymbol(E, Count);
|
return NonLoc::MakeVal(sym);
|
||||||
return nonloc::SymbolVal(Sym);
|
|
||||||
}
|
|
||||||
|
|
||||||
return UnknownVal();
|
return UnknownVal();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue