Hook up "EvalStore" from GRTransferFuncs to GRExprEngine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49804 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 9c6a37d..72bae32 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -689,7 +689,7 @@
 }
  
 //===----------------------------------------------------------------------===//
-// Transfer functions: DeclRefExprs (loads, getting l-values).
+// Transfer functions: Loads and stores.
 //===----------------------------------------------------------------------===//
 
 void GRExprEngine::VisitDeclRefExpr(DeclRefExpr* D, NodeTy* Pred, NodeSet& Dst){
@@ -708,6 +708,23 @@
   MakeNode(Dst, D, Pred, SetBlkExprRVal(St, D, Y));
 }
 
+void GRExprEngine::VisitStore(NodeSet& Dst, Expr* E, NodeTy* Pred,
+                              ValueState* St, LVal TargetLV, RVal Val) {
+  
+  assert (Builder && "GRStmtNodeBuilder must be defined.");
+  
+  unsigned size = Dst.size();  
+  SaveAndRestore<bool> OldSink(Builder->BuildSinks);
+  
+  EvalStore(Dst, E, Pred, St, TargetLV, Val);
+  
+  // Handle the case where no nodes where generated.  Auto-generate that
+  // contains the updated state if we aren't generating sinks.
+  
+  if (!Builder->BuildSinks && Dst.size() == size)
+    MakeNode(Dst, E, Pred, SetRVal(St, TargetLV, Val));    
+}
+
 //===----------------------------------------------------------------------===//
 // Transfer function: Function calls.
 //===----------------------------------------------------------------------===//
@@ -1637,7 +1654,7 @@
           // Simulate the effects of a "store":  bind the value of the RHS
           // to the L-Value represented by the LHS.
 
-          EvalStore(Dst, B, N2, SetRVal(St, B, RightV),
+          VisitStore(Dst, B, N2, SetRVal(St, B, RightV),
                     cast<LVal>(LeftV), RightV);
           
 //          St = SetRVal(SetRVal(St, B, RightV), cast<LVal>(LeftV), RightV);
@@ -1788,7 +1805,7 @@
           }
           
           //          St = SetRVal(SetRVal(St, B, Result), LeftLV, Result);          
-          EvalStore(Dst, B, N2, SetRVal(St, B, Result), LeftLV, Result);
+          VisitStore(Dst, B, N2, SetRVal(St, B, Result), LeftLV, Result);
           continue;
         }
       }