зеркало из https://github.com/microsoft/clang-1.git
Create a symbolic region instead of a loc::SymbolVal. This is a continued step
to eliminate the use of loc::SymbolVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68685 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
fe630b943e
Коммит
867418fdb5
|
@ -76,8 +76,8 @@ public:
|
|||
static SVal GetRValueSymbolVal(SymbolManager& SymMgr, MemRegionManager& MRMgr,
|
||||
const MemRegion* R);
|
||||
|
||||
static SVal GetConjuredSymbolVal(SymbolManager& SymMgr, const Expr *E,
|
||||
unsigned Count);
|
||||
static SVal GetConjuredSymbolVal(SymbolManager& SymMgr, MemRegionManager&,
|
||||
const Expr *E, unsigned Count);
|
||||
|
||||
inline bool isUnknown() const {
|
||||
return getRawKind() == UnknownKind;
|
||||
|
|
|
@ -2536,7 +2536,8 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
|
|||
|
||||
// Conjure a new symbol if necessary to recover precision.
|
||||
if (Result.isUnknown() || !getConstraintManager().canReasonAbout(Result))
|
||||
Result = SVal::GetConjuredSymbolVal(SymMgr, Ex,
|
||||
Result = SVal::GetConjuredSymbolVal(SymMgr,
|
||||
getStoreManager().getRegionManager(),Ex,
|
||||
Builder->getCurrentBlockCount());
|
||||
|
||||
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));
|
||||
|
||||
// Only handle integers for now.
|
||||
if (T->isIntegerType())
|
||||
if (T->isIntegerType() && T->isScalarType())
|
||||
return NonLoc::MakeVal(sym);
|
||||
}
|
||||
|
||||
return UnknownVal();
|
||||
}
|
||||
|
||||
SVal SVal::GetConjuredSymbolVal(SymbolManager &SymMgr, const Expr* E,
|
||||
unsigned Count) {
|
||||
|
||||
SVal SVal::GetConjuredSymbolVal(SymbolManager &SymMgr, MemRegionManager& MRMgr,
|
||||
const Expr* E, unsigned Count) {
|
||||
QualType T = E->getType();
|
||||
SymbolRef sym = SymMgr.getConjuredSymbol(E, Count);
|
||||
|
||||
if (Loc::IsLocType(T)) {
|
||||
SymbolRef Sym = SymMgr.getConjuredSymbol(E, Count);
|
||||
return loc::SymbolVal(Sym);
|
||||
}
|
||||
else if (T->isIntegerType() && T->isScalarType()) {
|
||||
SymbolRef Sym = SymMgr.getConjuredSymbol(E, Count);
|
||||
return nonloc::SymbolVal(Sym);
|
||||
}
|
||||
if (Loc::IsLocType(T))
|
||||
return Loc::MakeVal(MRMgr.getSymbolicRegion(sym));
|
||||
|
||||
if (T->isIntegerType() && T->isScalarType())
|
||||
return NonLoc::MakeVal(sym);
|
||||
|
||||
return UnknownVal();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче