]> granicus.if.org Git - clang/commitdiff
Remove GRStateManager::BindLoc() and GRStateManager::Unbind().
authorTed Kremenek <kremenek@apple.com>
Tue, 23 Jun 2009 20:38:51 +0000 (20:38 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 23 Jun 2009 20:38:51 +0000 (20:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73996 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/GRState.h
lib/Analysis/GRExprEngine.cpp
lib/Analysis/GRSimpleVals.cpp
lib/Analysis/GRState.cpp

index 1f230dfaf20c0341796b85869919f22fb59cdfa5..7c9c80bea2c375bd8377466b9614182d3d897a99 100644 (file)
@@ -593,17 +593,7 @@ public:
   
     return UnknownVal();
   }
-  
-  const GRState* BindLoc(const GRState* St, Loc LV, SVal V) {
-    return StoreMgr->Bind(St, LV, V);
-  }
 
-  void Unbind(GRState& St, Loc LV) {
-    St.St = StoreMgr->Remove(St.St, LV);
-  }
-  
-  const GRState* Unbind(const GRState* St, Loc LV);
-  
   const GRState* getPersistentState(GRState& Impl);
 
   bool isEqual(const GRState* state, Expr* Ex, const llvm::APSInt& V);
@@ -722,7 +712,7 @@ inline const GRState *GRState::bindExpr(const Stmt* Ex, SVal V,
 }
   
 inline const GRState *GRState::bindLoc(Loc LV, SVal V) const {
-  return Mgr->BindLoc(this, LV, V);
+  return Mgr->StoreMgr->Bind(this, LV, V);
 }
 
 inline const GRState *GRState::bindLoc(SVal LV, SVal V) const {
@@ -844,10 +834,6 @@ CB GRState::scanReachableSymbols(SVal val) const {
   scanReachableSymbols(val, cb);
   return cb;
 }
-  
-inline const GRState *GRState::unbindLoc(Loc LV) const {
-  return Mgr->Unbind(this, LV);
-}
 
 } // end clang namespace
 
index c32c424b6698aae4b7556b1a38e9956180bedf56..42c6ce3dfb66568e986eb163d993efe939f91a00 100644 (file)
@@ -1046,7 +1046,7 @@ void GRExprEngine::EvalBind(NodeSet& Dst, Expr* Ex, NodeTy* Pred,
   else {
     // We are binding to a value other than 'unknown'.  Perform the binding
     // using the StoreManager.
-    newState = StateMgr.BindLoc(state, cast<Loc>(location), Val);
+    newState = state->bindLoc(cast<Loc>(location), Val);
   }
 
   // The next thing to do is check if the GRTransferFuncs object wants to
index 480612113d10ee3df5aebb4d49704081acdd239f..9a1b2fc05e4af6f7de4df4b90d942b15d9c1d05b 100644 (file)
@@ -354,24 +354,23 @@ void GRSimpleVals::EvalCall(ExplodedNodeSet<GRState>& Dst,
                             CallExpr* CE, SVal L,
                             ExplodedNode<GRState>* Pred) {
   
-  GRStateManager& StateMgr = Eng.getStateManager();
-  const GRState* St = Builder.GetState(Pred);
+  const GRState* state = Builder.GetState(Pred);
   
   // Invalidate all arguments passed in by reference (Locs).
 
   for (CallExpr::arg_iterator I = CE->arg_begin(), E = CE->arg_end();
         I != E; ++I) {
 
-    SVal V = St->getSVal(*I);
+    SVal V = state->getSVal(*I);
     
     if (isa<loc::MemRegionVal>(V)) {
       const MemRegion *R = cast<loc::MemRegionVal>(V).getRegion();
+      
       if (R->isBoundable())
-        St = StateMgr.BindLoc(St, cast<Loc>(V), UnknownVal());
+        state = state->bindLoc(cast<Loc>(V), UnknownVal());
     } else if (isa<nonloc::LocAsInteger>(V))
-      St = StateMgr.BindLoc(St, cast<nonloc::LocAsInteger>(V).getLoc(),
-                            UnknownVal());
-    
+        state = state->bindLoc(cast<nonloc::LocAsInteger>(V).getLoc(),
+                               UnknownVal());
   }
   
   // Make up a symbol for the return value of this function.  
@@ -381,10 +380,10 @@ void GRSimpleVals::EvalCall(ExplodedNodeSet<GRState>& Dst,
   if (Loc::IsLocType(T) || (T->isIntegerType() && T->isScalarType())) {    
     unsigned Count = Builder.getCurrentBlockCount();
     SVal X = Eng.getValueManager().getConjuredSymbolVal(CE, Count);
-    St = St->bindExpr(CE, X, Eng.getCFG().isBlkExpr(CE), false);
+    state = state->bindExpr(CE, X, Eng.getCFG().isBlkExpr(CE), false);
   }  
     
-  Builder.MakeNode(Dst, CE, Pred, St);
+  Builder.MakeNode(Dst, CE, Pred, state);
 }
 
 //===----------------------------------------------------------------------===//
index a64b2d7f5f493cbd695f679b95bb92a367e37c2b..3217c4ac4d0b09900c5192b038c4d093bf0d3e4f 100644 (file)
@@ -56,16 +56,16 @@ GRStateManager::RemoveDeadBindings(const GRState* state, Stmt* Loc,
                                            SymReaper);
 }
 
-const GRState* GRStateManager::Unbind(const GRState* St, Loc LV) {
-  Store OldStore = St->getStore();
-  Store NewStore = StoreMgr->Remove(OldStore, LV);
+const GRState *GRState::unbindLoc(Loc LV) const {
+  Store OldStore = getStore();
+  Store NewStore = Mgr->StoreMgr->Remove(OldStore, LV);
   
   if (NewStore == OldStore)
-    return St;
+    return this;
   
-  GRState NewSt = *St;
+  GRState NewSt = *this;
   NewSt.St = NewStore;
-  return getPersistentState(NewSt);    
+  return Mgr->getPersistentState(NewSt);    
 }
 
 const GRState* GRStateManager::getInitialState() {