Revert 95541.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95545 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp
index 72456cc..978be8d 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/lib/Checker/GRExprEngine.cpp
@@ -392,7 +392,7 @@
       if (!R)
         break;
     
-      SVal V = state->Load(loc::MemRegionVal(R));
+      SVal V = state->getSVal(loc::MemRegionVal(R));
       SVal Constraint_untested = EvalBinOp(state, BinaryOperator::GT, V,
                                            ValMgr.makeZeroVal(T),
                                            getContext().IntTy);
@@ -414,7 +414,7 @@
       // method.
       const ImplicitParamDecl *SelfD = MD->getSelfDecl();
       const MemRegion *R = state->getRegion(SelfD, InitLoc);
-      SVal V = state->Load(loc::MemRegionVal(R));
+      SVal V = state->getSVal(loc::MemRegionVal(R));
     
       if (const Loc *LV = dyn_cast<Loc>(&V)) {
         // Assume that the pointer value in 'self' is non-null.
@@ -633,8 +633,7 @@
       }
       else if (B->getOpcode() == BinaryOperator::Comma) {
         const GRState* state = GetState(Pred);
-        MakeNode(Dst, B, Pred, state->BindExpr(B, 
-                                               state->getExprVal(B->getRHS())));
+        MakeNode(Dst, B, Pred, state->BindExpr(B, state->getSVal(B->getRHS())));
         break;
       }
 
@@ -765,8 +764,7 @@
 
       if (Expr* LastExpr = dyn_cast<Expr>(*SE->getSubStmt()->body_rbegin())) {
         const GRState* state = GetState(Pred);
-        MakeNode(Dst, SE, Pred, state->BindExpr(SE, 
-                                                state->getExprVal(LastExpr)));
+        MakeNode(Dst, SE, Pred, state->BindExpr(SE, state->getSVal(LastExpr)));
       }
       else
         Dst.Add(Pred);
@@ -1045,7 +1043,7 @@
   if (!bitsInit || !T->isIntegerType() || Ctx.getTypeSize(T) > bits)
     return UnknownVal();
 
-  return state->getExprVal(Ex);
+  return state->getSVal(Ex);
 }
 
 void GRExprEngine::ProcessBranch(Stmt* Condition, Stmt* Term,
@@ -1072,7 +1070,7 @@
     return;
 
   const GRState* PrevState = builder.getState();
-  SVal X = PrevState->getExprVal(Condition);
+  SVal X = PrevState->getSVal(Condition);
 
   if (X.isUnknown()) {
     // Give it a chance to recover from unknown.
@@ -1123,7 +1121,7 @@
 void GRExprEngine::ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder) {
 
   const GRState *state = builder.getState();
-  SVal V = state->getExprVal(builder.getTarget());
+  SVal V = state->getSVal(builder.getTarget());
 
   // Three possibilities:
   //
@@ -1171,13 +1169,13 @@
          Pred->getLocationContext()->getCFG()->isBlkExpr(Ex));
 
   const GRState* state = GetState(Pred);
-  SVal X = state->getExprVal(Ex);
+  SVal X = state->getSVal(Ex);
 
   assert (X.isUndef());
 
   Expr *SE = (Expr*) cast<UndefinedVal>(X).getData();
   assert(SE);
-  X = state->getExprVal(SE);
+  X = state->getSVal(SE);
 
   // Make sure that we invalidate the previous binding.
   MakeNode(Dst, Ex, Pred, state->BindExpr(Ex, X, true));
@@ -1201,7 +1199,7 @@
   typedef GRSwitchNodeBuilder::iterator iterator;
   const GRState* state = builder.getState();
   Expr* CondE = builder.getCondition();
-  SVal  CondV_untested = state->getExprVal(CondE);
+  SVal  CondV_untested = state->getSVal(CondE);
 
   if (CondV_untested.isUndef()) {
     //ExplodedNode* N = builder.generateDefaultCaseNode(state, true);
@@ -1302,14 +1300,14 @@
   assert(B==CurrentStmt && Pred->getLocationContext()->getCFG()->isBlkExpr(B));
 
   const GRState* state = GetState(Pred);
-  SVal X = state->getExprVal(B);
+  SVal X = state->getSVal(B);
   assert(X.isUndef());
 
   const Expr *Ex = (const Expr*) cast<UndefinedVal>(X).getData();
   assert(Ex);
 
   if (Ex == B->getRHS()) {
-    X = state->getExprVal(Ex);
+    X = state->getSVal(Ex);
 
     // Handle undefined values.
     if (X.isUndef()) {
@@ -1389,7 +1387,7 @@
       // reference region.
       if (VD->getType()->isReferenceType()) {
         if (const MemRegion *R = V.getAsRegion())
-          V = state->Load(R);
+          V = state->getSVal(R);
         else
           V = UnknownVal();
       }
@@ -1448,8 +1446,8 @@
 
     for (ExplodedNodeSet::iterator I2=Tmp3.begin(),E2=Tmp3.end();I2!=E2; ++I2) {
       const GRState* state = GetState(*I2);
-      SVal V = state->getLValue(A->getType(), state->getExprVal(Idx),
-                                state->getExprVal(Base));
+      SVal V = state->getLValue(A->getType(), state->getSVal(Idx),
+                                state->getSVal(Base));
 
       if (asLValue)
         MakeNode(Dst, A, *I2, state->BindExpr(A, V),
@@ -1481,7 +1479,7 @@
     // FIXME: Should we insert some assumption logic in here to determine
     // if "Base" is a valid piece of memory?  Before we put this assumption
     // later when using FieldOffset lvals (which we no longer have).
-    SVal L = state->getLValue(Field, state->getExprVal(Base));
+    SVal L = state->getLValue(Field, state->getSVal(Base));
 
     if (asLValue)
       MakeNode(Dst, M, *I, state->BindExpr(M, L), ProgramPoint::PostLValueKind);
@@ -1593,7 +1591,7 @@
       // Perform the load from the referenced value.
       for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end() ; I!=E; ++I) {
         state = GetState(*I);
-        location = state->getExprVal(Ex);
+        location = state->getSVal(Ex);
         EvalLoadCommon(Dst, Ex, *I, state, location, tag, LoadTy);
       }    
       return;
@@ -1629,7 +1627,7 @@
                ProgramPoint::PostLoadKind, tag);
     }
     else {
-      SVal V = state->Load(cast<Loc>(location), LoadTy.isNull() ? 
+      SVal V = state->getSVal(cast<Loc>(location), LoadTy.isNull() ? 
                                                      Ex->getType() : LoadTy);
       MakeNode(Dst, Ex, *NI, state->BindExpr(Ex, V), ProgramPoint::PostLoadKind,
                tag);
@@ -1762,7 +1760,7 @@
        DI != DE; ++DI) {
     
     const GRState* state = GetState(*DI);
-    SVal L = state->getExprVal(Callee);
+    SVal L = state->getSVal(Callee);
     
     // FIXME: Add support for symbolic function calls (calls involving
     //  function pointer values that are symbolic).
@@ -1817,7 +1815,7 @@
   for (ExplodedNodeSet::iterator NI = DstTmp4.begin(), NE = DstTmp4.end();
        NI!=NE; ++NI) {
     const GRState *state = GetState(*NI);
-    EvalLoad(Dst, CE, *NI, state, state->getExprVal(CE),
+    EvalLoad(Dst, CE, *NI, state, state->getSVal(CE),
              &ConvertToRvalueTag, LoadTy);
   }
 }
@@ -1844,7 +1842,7 @@
     }
 
     const GRState* state = Pred->getState();
-    SVal V = state->getExprVal(Ex);
+    SVal V = state->getSVal(Ex);
     if (nonloc::SymExprVal *SEV = dyn_cast<nonloc::SymExprVal>(&V)) {
       // First assume that the condition is true.
       if (const GRState *stateTrue = state->Assume(*SEV, true)) {
@@ -1882,7 +1880,7 @@
 
   for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
     const GRState* state = GetState(*I);
-    SVal BaseVal = state->getExprVal(Base);
+    SVal BaseVal = state->getSVal(Base);
     SVal location = state->getLValue(Ex->getDecl(), BaseVal);
 
     if (asLValue)
@@ -1940,7 +1938,7 @@
 
   for (ExplodedNodeSet::iterator I = Tmp.begin(), E = Tmp.end(); I!=E; ++I) {
     const GRState* state = GetState(*I);
-    VisitObjCForCollectionStmtAux(S, *I, Dst, state->getExprVal(elem));
+    VisitObjCForCollectionStmtAux(S, *I, Dst, state->getSVal(elem));
   }
 }
 
@@ -2064,7 +2062,7 @@
 
       // Bifurcate the state into nil and non-nil ones.
       DefinedOrUnknownSVal receiverVal = 
-        cast<DefinedOrUnknownSVal>(state->getExprVal(Receiver));
+        cast<DefinedOrUnknownSVal>(state->getSVal(Receiver));
 
       const GRState *notNilState, *nilState;
       llvm::tie(notNilState, nilState) = state->Assume(receiverVal);
@@ -2166,7 +2164,7 @@
        NE = DstRValueConvert.end();
        NI!=NE; ++NI) {
     const GRState *state = GetState(*NI);
-    EvalLoad(Dst, ME, *NI, state, state->getExprVal(ME),
+    EvalLoad(Dst, ME, *NI, state, state->getSVal(ME),
              &ConvertToRvalueTag, LoadTy);
   }
 }
@@ -2214,7 +2212,7 @@
       // Copy the SVal of Ex to CastE.
       ExplodedNode *N = *I;
       const GRState *state = GetState(N);
-      SVal V = state->getExprVal(Ex);
+      SVal V = state->getSVal(Ex);
       state = state->BindExpr(CastE, V);
       MakeNode(Dst, CastE, N, state);
     }
@@ -2236,7 +2234,7 @@
     for (ExplodedNodeSet::iterator I = S2.begin(), E = S2.end(); I != E; ++I) {
       ExplodedNode* N = *I;
       const GRState* state = GetState(N);
-      SVal V = state->getExprVal(Ex);
+      SVal V = state->getSVal(Ex);
       V = SVator.EvalCast(V, T, ExTy);
       state = state->BindExpr(CastE, V);
       MakeNode(Dst, CastE, N, state);
@@ -2259,7 +2257,7 @@
 
   for (ExplodedNodeSet::iterator I = Tmp.begin(), EI = Tmp.end(); I!=EI; ++I) {
     const GRState* state = GetState(*I);
-    SVal ILV = state->getExprVal(ILE);
+    SVal ILV = state->getSVal(ILE);
     const LocationContext *LC = (*I)->getLocationContext();
     state = state->bindCompoundLiteral(CL, LC, ILV);
 
@@ -2307,7 +2305,7 @@
     const LocationContext *LC = N->getLocationContext();
 
     if (InitEx) {
-      SVal InitVal = state->getExprVal(InitEx);
+      SVal InitVal = state->getSVal(InitEx);
 
       // Recover some path-sensitivity if a scalar value evaluated to
       // UnknownVal.
@@ -2339,7 +2337,7 @@
     const GRState *state = GetState(N);
     
     const LocationContext *LC = N->getLocationContext();
-    SVal InitVal = state->getExprVal(InitEx);
+    SVal InitVal = state->getSVal(InitEx);
       
     // Recover some path-sensitivity if a scalar value evaluated to
     // UnknownVal.
@@ -2410,7 +2408,7 @@
       for (ExplodedNodeSet::iterator NI=Tmp.begin(),NE=Tmp.end();NI!=NE;++NI) {
         // Get the last initializer value.
         state = GetState(*NI);
-        SVal InitV = state->getExprVal(cast<Expr>(*X.Itr));
+        SVal InitV = state->getSVal(cast<Expr>(*X.Itr));
 
         // Construct the new list of values by prepending the new value to
         // the already constructed list.
@@ -2441,7 +2439,7 @@
     Visit(Init, Pred, Tmp);
     for (ExplodedNodeSet::iterator I=Tmp.begin(), EI=Tmp.end(); I != EI; ++I) {
       state = GetState(*I);
-      MakeNode(Dst, E, *I, state->BindExpr(E, state->getExprVal(Init)));
+      MakeNode(Dst, E, *I, state->BindExpr(E, state->getSVal(Init)));
     }
     return;
   }
@@ -2504,7 +2502,7 @@
       for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
 
         const GRState* state = GetState(*I);
-        SVal location = state->getExprVal(Ex);
+        SVal location = state->getSVal(Ex);
 
         if (asLValue)
           MakeNode(Dst, U, *I, state->BindExpr(U, location),
@@ -2534,7 +2532,7 @@
         // For all other types, UnaryOperator::Real is an identity operation.
         assert (U->getType() == Ex->getType());
         const GRState* state = GetState(*I);
-        MakeNode(Dst, U, *I, state->BindExpr(U, state->getExprVal(Ex)));
+        MakeNode(Dst, U, *I, state->BindExpr(U, state->getSVal(Ex)));
       }
 
       return;
@@ -2594,7 +2592,7 @@
 
       for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
         const GRState* state = GetState(*I);
-        MakeNode(Dst, U, *I, state->BindExpr(U, state->getExprVal(Ex)));
+        MakeNode(Dst, U, *I, state->BindExpr(U, state->getSVal(Ex)));
       }
 
       return;
@@ -2609,7 +2607,7 @@
 
       for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
         const GRState* state = GetState(*I);
-        SVal V = state->getExprVal(Ex);
+        SVal V = state->getSVal(Ex);
         state = state->BindExpr(U, V);
         MakeNode(Dst, U, *I, state);
       }
@@ -2630,7 +2628,7 @@
         const GRState* state = GetState(*I);
 
         // Get the value of the subexpression.
-        SVal V = state->getExprVal(Ex);
+        SVal V = state->getSVal(Ex);
 
         if (V.isUnknownOrUndef()) {
           MakeNode(Dst, U, *I, state->BindExpr(U, V));
@@ -2704,7 +2702,7 @@
   for (ExplodedNodeSet::iterator I = Tmp.begin(), E = Tmp.end(); I!=E; ++I) {
 
     const GRState* state = GetState(*I);
-    SVal V1 = state->getExprVal(Ex);
+    SVal V1 = state->getSVal(Ex);
 
     // Perform a load.
     ExplodedNodeSet Tmp2;
@@ -2713,7 +2711,7 @@
     for (ExplodedNodeSet::iterator I2=Tmp2.begin(), E2=Tmp2.end();I2!=E2;++I2) {
 
       state = GetState(*I2);
-      SVal V2_untested = state->getExprVal(Ex);
+      SVal V2_untested = state->getSVal(Ex);
 
       // Propagate unknown and undefined values.
       if (V2_untested.isUnknownOrUndef()) {
@@ -2782,7 +2780,7 @@
                                                Pred->getLocationContext());
   
   const GRState *state = GetState(Pred);
-  SVal V = state->Load(loc::MemRegionVal(R));
+  SVal V = state->getSVal(loc::MemRegionVal(R));
   MakeNode(Dst, TE, Pred, state->BindExpr(TE, V));
 }
 
@@ -2828,7 +2826,7 @@
     for (AsmStmt::outputs_iterator OI = A->begin_outputs(),
                                    OE = A->end_outputs(); OI != OE; ++OI) {
 
-      SVal X = state->getExprVal(*OI);
+      SVal X = state->getSVal(*OI);
       assert (!isa<NonLoc>(X));  // Should be an Lval, or unknown, undef.
 
       if (isa<Loc>(X))
@@ -2908,7 +2906,7 @@
   ExplodedNodeSet Tmp3;
 
   for (ExplodedNodeSet::iterator I1=Tmp1.begin(), E1=Tmp1.end(); I1!=E1; ++I1) {
-    SVal LeftV = (*I1)->getState()->getExprVal(LHS);
+    SVal LeftV = (*I1)->getState()->getSVal(LHS);
     ExplodedNodeSet Tmp2;
     Visit(RHS, *I1, Tmp2);
 
@@ -2922,7 +2920,7 @@
 
       const GRState *state = GetState(*I2);
       const GRState *OldSt = state;
-      SVal RightV = state->getExprVal(RHS);
+      SVal RightV = state->getSVal(RHS);
 
       BinaryOperator::Opcode Op = B->getOpcode();
 
@@ -2987,13 +2985,13 @@
       // Perform a load (the LHS).  This performs the checks for
       // null dereferences, and so on.
       ExplodedNodeSet Tmp4;
-      SVal location = state->getExprVal(LHS);
+      SVal location = state->getSVal(LHS);
       EvalLoad(Tmp4, LHS, *I2, state, location);
 
       for (ExplodedNodeSet::iterator I4=Tmp4.begin(), E4=Tmp4.end(); I4!=E4;
            ++I4) {
         state = GetState(*I4);
-        SVal V = state->getExprVal(LHS);
+        SVal V = state->getSVal(LHS);
 
         // Get the computation type.
         QualType CTy =
@@ -3058,7 +3056,7 @@
     
     // Bind the temporary object to the value of the expression. Then bind
     // the expression to the location of the object.
-    SVal V = state->getExprVal(Ex);
+    SVal V = state->getSVal(Ex);
 
     const MemRegion *R = 
       ValMgr.getRegionManager().getCXXObjectRegion(Ex,