Add a new method because sometimes the type of the conjured symbol is not the
type of the expression where we create the symbol.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68692 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/SVals.cpp b/lib/Analysis/SVals.cpp
index cf3e800..ddb2da6 100644
--- a/lib/Analysis/SVals.cpp
+++ b/lib/Analysis/SVals.cpp
@@ -312,6 +312,19 @@
return UnknownVal();
}
+SVal SVal::GetConjuredSymbolVal(SymbolManager &SymMgr, MemRegionManager& MRMgr,
+ const Expr* E, QualType T, unsigned Count) {
+ SymbolRef sym = SymMgr.getConjuredSymbol(E, T, Count);
+
+ if (Loc::IsLocType(T))
+ return Loc::MakeVal(MRMgr.getSymbolicRegion(sym));
+
+ if (T->isIntegerType() && T->isScalarType())
+ return NonLoc::MakeVal(sym);
+
+ return UnknownVal();
+}
+
nonloc::LocAsInteger nonloc::LocAsInteger::Make(BasicValueFactory& Vals, Loc V,
unsigned Bits) {
return LocAsInteger(Vals.getPersistentSValWithData(V, Bits));