[cfe-commits] r74128 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRState.h lib/Analysis/GRExprEngineInternalChecks.cpp lib/Analysis/GRState.cpp

Ted Kremenek kremenek at apple.com
Wed Jun 24 15:15:45 PDT 2009


Author: kremenek
Date: Wed Jun 24 17:15:30 2009
New Revision: 74128

URL: http://llvm.org/viewvc/llvm-project?rev=74128&view=rev
Log:
Remove GRStateManager::GetSValAsScalarOrLoc()/GetSVal().

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
    cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp
    cfe/trunk/lib/Analysis/GRState.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h?rev=74128&r1=74127&r2=74128&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Wed Jun 24 17:15:30 2009
@@ -559,26 +559,6 @@
   void iterBindings(const GRState* state, StoreManager::BindingsHandler& F) {
     StoreMgr->iterBindings(state->getStore(), F);
   }
-  
-  SVal GetSVal(const GRState* state, const MemRegion* R) {
-    return StoreMgr->Retrieve(state, loc::MemRegionVal(R));
-  }  
-
-  SVal GetSValAsScalarOrLoc(const GRState* state, const MemRegion *R) {
-    // We only want to do fetches from regions that we can actually bind
-    // values.  For example, SymbolicRegions of type 'id<...>' cannot
-    // have direct bindings (but their can be bindings on their subregions).
-    if (!R->isBoundable())
-      return UnknownVal();
-    
-    if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) {
-      QualType T = TR->getValueType(getContext());
-      if (Loc::IsLocType(T) || T->isIntegerType())
-        return GetSVal(state, R);
-    }
-  
-    return UnknownVal();
-  }
 
   const GRState* getPersistentState(GRState& Impl);
 
@@ -764,11 +744,7 @@
 }
 
 inline SVal GRState::getSVal(const MemRegion* R) const {
-  return Mgr->GetSVal(this, R);
-}
-
-inline SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const {
-  return Mgr->GetSValAsScalarOrLoc(this, R);
+  return Mgr->StoreMgr->Retrieve(this, loc::MemRegionVal(R));
 }
   
 inline BasicValueFactory &GRState::getBasicVals() const {

Modified: cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp?rev=74128&r1=74127&r2=74128&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp Wed Jun 24 17:15:30 2009
@@ -672,7 +672,6 @@
       return NULL;
 
     if (!StoreSite) {      
-      GRStateManager &StateMgr = BRC.getStateManager();
       const ExplodedNode<GRState> *Node = N, *Last = NULL;
 
       for ( ; Node ; Last = Node, Node = Node->getFirstPred()) {
@@ -686,7 +685,7 @@
               }
         }
         
-        if (StateMgr.GetSVal(Node->getState(), R) != V)
+        if (Node->getState()->getSVal(R) != V)
           break;
       }
 

Modified: cfe/trunk/lib/Analysis/GRState.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRState.cpp?rev=74128&r1=74127&r2=74128&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRState.cpp (original)
+++ cfe/trunk/lib/Analysis/GRState.cpp Wed Jun 24 17:15:30 2009
@@ -68,6 +68,22 @@
   return Mgr->getPersistentState(NewSt);    
 }
 
+SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const {
+  // We only want to do fetches from regions that we can actually bind
+  // values.  For example, SymbolicRegions of type 'id<...>' cannot
+  // have direct bindings (but their can be bindings on their subregions).
+  if (!R->isBoundable())
+    return UnknownVal();
+
+  if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) {
+    QualType T = TR->getValueType(Mgr->getContext());
+    if (Loc::IsLocType(T) || T->isIntegerType())
+      return getSVal(R);
+  }
+
+  return UnknownVal();
+}
+
 const GRState* GRStateManager::getInitialState() {
   GRState StateImpl(this, EnvMgr.getInitialEnvironment(), 
                     StoreMgr->getInitialStore(),





More information about the cfe-commits mailing list