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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58437 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/SVals.cpp b/lib/Analysis/SVals.cpp
index 8d5b8ab..b323087 100644
--- a/lib/Analysis/SVals.cpp
+++ b/lib/Analysis/SVals.cpp
@@ -245,9 +245,9 @@
   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 @@
   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 @@
       Out << " [as " << C.getNumBits() << " bit integer]";
       break;
     }
-      
+            
     default:
       assert (false && "Pretty-printed not implemented for this NonLoc.");
       break;