CompoundVal now uses an ImmutableList<SVal> to store its set of SVals. This change was motivated by the need to allow state-splitting in GRExprEngine::VisitInitListExpr. As a side-benefit, we no longer need to perform any copies of SVals when creating a CompoundSVal, and the profiling of CompoundSVal is now constant time.

llvm-svn: 58437
This commit is contained in:
Ted Kremenek
2008-10-30 17:44:46 +00:00
parent 1e0d95e17e
commit ec9a252a9b
4 changed files with 44 additions and 51 deletions

View File

@@ -245,9 +245,9 @@ NonLoc NonLoc::MakeIntTruthVal(BasicValueFactory& BasicVals, bool b) {
return nonloc::ConcreteInt(BasicVals.getTruthValue(b));
}
NonLoc NonLoc::MakeCompoundVal(QualType T, SVal* Vals, unsigned NumSVals,
NonLoc NonLoc::MakeCompoundVal(QualType T, llvm::ImmutableList<SVal> Vals,
BasicValueFactory& BasicVals) {
return nonloc::CompoundVal(BasicVals.getCompoundValData(T, Vals, NumSVals));
return nonloc::CompoundVal(BasicVals.getCompoundValData(T, Vals));
}
SVal SVal::GetSymbolValue(SymbolManager& SymMgr, VarDecl* D) {
@@ -260,6 +260,11 @@ SVal SVal::GetSymbolValue(SymbolManager& SymMgr, VarDecl* D) {
return nonloc::SymbolVal(SymMgr.getSymbol(D));
}
nonloc::LocAsInteger nonloc::LocAsInteger::Make(BasicValueFactory& Vals, Loc V,
unsigned Bits) {
return LocAsInteger(Vals.getPersistentSValWithData(V, Bits));
}
//===----------------------------------------------------------------------===//
// Utility methods for constructing Locs.
//===----------------------------------------------------------------------===//
@@ -353,7 +358,7 @@ void NonLoc::print(std::ostream& Out) const {
Out << " [as " << C.getNumBits() << " bit integer]";
break;
}
default:
assert (false && "Pretty-printed not implemented for this NonLoc.");
break;