]> granicus.if.org Git - clang/commitdiff
API cleanup: move more methods from GRStateManager to GRState.
authorTed Kremenek <kremenek@apple.com>
Tue, 23 Jun 2009 17:55:07 +0000 (17:55 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 23 Jun 2009 17:55:07 +0000 (17:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73968 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/GRState.h
lib/Analysis/BugReporter.cpp
lib/Analysis/GRState.cpp

index 2cb3f9470cf0e657c510cfa2a31b9165edef0b21..2954bd4733fa4b2a099b2c0395a27a67593f820e 100644 (file)
@@ -530,21 +530,6 @@ public:
   
 private:
 
-  // Methods that query & manipulate the Environment.  
-  SVal GetSVal(const GRState* St, const Stmt* Ex) {
-    return St->getEnvironment().GetSVal(Ex, ValueMgr);
-  }
-  
-  SVal GetSValAsScalarOrLoc(const GRState* state, const Stmt *S) {
-    if (const Expr *Ex = dyn_cast<Expr>(S)) {
-      QualType T = Ex->getType();
-      if (Loc::IsLocType(T) || T->isIntegerType())
-        return GetSVal(state, S);
-    }
-    
-    return UnknownVal();
-  }
-
   SVal GetBlkExprSVal(const GRState* St, const Stmt* Ex) {
     return St->getEnvironment().GetBlkExprSVal(Ex, ValueMgr);
   }
@@ -599,11 +584,6 @@ public:
   void iterBindings(const GRState* state, StoreManager::BindingsHandler& F) {
     StoreMgr->iterBindings(state->getStore(), F);
   }
-    
-  
-  SVal GetSVal(const GRState* state, Loc LV, QualType T = QualType()) {
-    return StoreMgr->Retrieve(state, LV, T);
-  }
   
   SVal GetSVal(const GRState* state, const MemRegion* R) {
     return StoreMgr->Retrieve(state, loc::MemRegionVal(R));
@@ -781,19 +761,25 @@ inline const llvm::APSInt *GRState::getSymVal(SymbolRef sym) const {
 }
   
 inline SVal GRState::getSVal(const Stmt* Ex) const {
-  return Mgr->GetSVal(this, Ex);
+  return getEnvironment().GetSVal(Ex, Mgr->ValueMgr);
 }
 
 inline SVal GRState::getBlkExprSVal(const Stmt* Ex) const {  
   return Mgr->GetBlkExprSVal(this, Ex);
 }
 
-inline SVal GRState::getSValAsScalarOrLoc(const Stmt *Ex) const {
-  return Mgr->GetSValAsScalarOrLoc(this, Ex);
+inline SVal GRState::getSValAsScalarOrLoc(const Stmt *S) const {
+  if (const Expr *Ex = dyn_cast<Expr>(S)) {
+    QualType T = Ex->getType();
+    if (Loc::IsLocType(T) || T->isIntegerType())
+      return getSVal(S);
+  }
+    
+  return UnknownVal();
 }
 
 inline SVal GRState::getSVal(Loc LV, QualType T) const {
-  return Mgr->GetSVal(this, LV, T);
+  return Mgr->StoreMgr->Retrieve(this, LV, T);
 }
 
 inline SVal GRState::getSVal(const MemRegion* R) const {
index 5dbbfc33e426e0bf5e78c13d87c0fd4b7f5633ad..9c9029cfff34787c4af7c2ed7828c13db4783c8f 100644 (file)
@@ -380,7 +380,7 @@ public:
       return true;
     
     // Check if the previous state has this binding.    
-    SVal X = VMgr.GetSVal(PrevSt, loc::MemRegionVal(R));
+    SVal X = PrevSt->getSVal(loc::MemRegionVal(R));
     
     if (X == V) // Same binding?
       return true;
index aeb1c04cafba9016fe37a034fae1c51c9ca65860..a64b2d7f5f493cbd695f679b95bb92a367e37c2b 100644 (file)
@@ -282,7 +282,7 @@ bool GRState::scanReachableSymbols(SVal val, SymbolVisitor& visitor) const {
 bool GRStateManager::isEqual(const GRState* state, Expr* Ex,
                              const llvm::APSInt& Y) {
   
-  SVal V = GetSVal(state, Ex);
+  SVal V = state->getSVal(Ex);
   
   if (loc::ConcreteInt* X = dyn_cast<loc::ConcreteInt>(&V))
     return X->getValue() == Y;