Lazy bingding for region-store manager.
* Now Bind() methods take and return GRState* because binding could
  also alter GDM.
* No variables are initialized except those declared with initial
  values.
* failed C test cases are due to bugs in RemoveDeadBindings(),
which removes constraints that is still alive. This will be fixed in later
patch.
* default value of array and struct regions will be implemented in later patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61274 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/SVals.cpp b/lib/Analysis/SVals.cpp
index 3288b74..6cc5e91 100644
--- a/lib/Analysis/SVals.cpp
+++ b/lib/Analysis/SVals.cpp
@@ -242,6 +242,11 @@
 //===----------------------------------------------------------------------===//
 // Utility methods for constructing Non-Locs.
 //===----------------------------------------------------------------------===//
+
+NonLoc NonLoc::MakeVal(SymbolRef sym) {
+  return nonloc::SymbolVal(sym);
+}
+
 NonLoc NonLoc::MakeVal(BasicValueFactory& BasicVals, unsigned X, 
                        bool isUnsigned) {
   return nonloc::ConcreteInt(BasicVals.getValue(X, sizeof(unsigned)*8, 
@@ -281,6 +286,14 @@
   return nonloc::CompoundVal(BasicVals.getCompoundValData(T, Vals));
 }
 
+SVal SVal::MakeSymbolValue(SymbolManager& SymMgr, const MemRegion* R, 
+                           QualType T) {
+  if (Loc::IsLocType(T))
+    return Loc::MakeVal(SymMgr.getSymbol(R));
+  else
+    return NonLoc::MakeVal(SymMgr.getSymbol(R));
+}
+
 SVal SVal::GetSymbolValue(SymbolManager& SymMgr, VarDecl* D) {
 
   QualType T = D->getType();
@@ -320,6 +333,8 @@
 
 Loc Loc::MakeVal(AddrLabelExpr* E) { return loc::GotoLabel(E->getLabel()); }
 
+Loc Loc::MakeVal(SymbolRef sym) { return loc::SymbolVal(sym); }
+
 //===----------------------------------------------------------------------===//
 // Pretty-Printing.
 //===----------------------------------------------------------------------===//