[cfe-commits] r74006 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRState.h lib/Analysis/BasicStore.cpp lib/Analysis/CFRefCount.cpp lib/Analysis/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Tue Jun 23 14:37:46 PDT 2009


Author: kremenek
Date: Tue Jun 23 16:37:46 2009
New Revision: 74006

URL: http://llvm.org/viewvc/llvm-project?rev=74006&view=rev
Log:
Remove GRStateManager::getRegion/getSelfRegion().

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
    cfe/trunk/lib/Analysis/BasicStore.cpp
    cfe/trunk/lib/Analysis/CFRefCount.cpp
    cfe/trunk/lib/Analysis/GRExprEngine.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=74006&r1=74005&r2=74006&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Tue Jun 23 16:37:46 2009
@@ -199,6 +199,14 @@
                                bool assumption) const;
   
   //==---------------------------------------------------------------------==//
+  // Utility methods for getting regions.
+  //==---------------------------------------------------------------------==//
+
+  const VarRegion* getRegion(const VarDecl* D) const;
+
+  const MemRegion* getSelfRegion() const;
+
+  //==---------------------------------------------------------------------==//
   // Binding and retrieving values to/from the environment and symbolic store.
   //==---------------------------------------------------------------------==//
   
@@ -431,18 +439,7 @@
   /// Liveness - live-variables information of the ValueDecl* and block-level
   /// Expr* in the CFG. Used to get initial store and prune out dead state.
   LiveVariables& Liveness;
-
-private:
-
-  Environment RemoveBlkExpr(const Environment& Env, Expr* E) {
-    return EnvMgr.RemoveBlkExpr(Env, E);
-  }
   
-  // FIXME: Remove when we do lazy initializaton of variable bindings.
-//   const GRState* BindVar(const GRState* St, VarDecl* D, SVal V) {
-//     return SetSVal(St, getLoc(D), V);
-//   }
-    
 public:
   
   GRStateManager(ASTContext& Ctx,
@@ -464,7 +461,7 @@
   
   ~GRStateManager();
 
-  const GRState* getInitialState();
+  const GRState *getInitialState();
         
   ASTContext &getContext() { return ValueMgr.getContext(); }
   const ASTContext &getContext() const { return ValueMgr.getContext(); }               
@@ -510,17 +507,6 @@
     NewSt.Env = EnvMgr.RemoveSubExprBindings(NewSt.Env);
     return getPersistentState(NewSt);
   }
-
-  
-  // Utility methods for getting regions.
-  
-  VarRegion* getRegion(const VarDecl* D) {
-    return getRegionManager().getVarRegion(D);
-  }
-  
-  const MemRegion* getSelfRegion(const GRState* state) {
-    return StoreMgr->getSelfRegion(state->getStore());
-  }
   
 private:
 

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

==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Tue Jun 23 16:37:46 2009
@@ -535,7 +535,7 @@
 
       // Initialize globals and parameters to symbolic values.
       // Initialize local variables to undefined.
-      const MemRegion *R = StateMgr.getRegion(VD);
+      const MemRegion *R = ValMgr.getRegionManager().getVarRegion(VD);
       SVal X = (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD) ||
                 isa<ImplicitParamDecl>(VD))
             ? ValMgr.getRegionValueSymbolVal(R)

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

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Jun 23 16:37:46 2009
@@ -3091,7 +3091,7 @@
       if (Expr* Receiver = ME->getReceiver()) {
         SVal X = St->getSValAsScalarOrLoc(Receiver);
         if (loc::MemRegionVal* L = dyn_cast<loc::MemRegionVal>(&X))
-          if (L->getRegion() == Eng.getStateManager().getSelfRegion(St)) {
+          if (L->getRegion() == St->getSelfRegion()) {
             // Update the summary to make the default argument effect
             // 'StopTracking'.
             Summ = Summaries.copySummary(Summ);

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Tue Jun 23 16:37:46 2009
@@ -176,7 +176,7 @@
       const ParmVarDecl *PD = FD->getParamDecl(0);
       QualType T = PD->getType();
       if (T->isIntegerType())
-        if (const MemRegion *R = StateMgr.getRegion(PD)) {
+        if (const MemRegion *R = state->getRegion(PD)) {
           SVal V = state->getSVal(loc::MemRegionVal(R));
           SVal Constraint = EvalBinOp(state, BinaryOperator::GT, V,
                                       ValMgr.makeZeroVal(T),
@@ -2253,7 +2253,7 @@
       // update the state based on the new binding.  If the GRTransferFunc
       // object doesn't do anything, just auto-propagate the current state.
       GRStmtNodeBuilderRef BuilderRef(Dst, *Builder, *this, *I, state, DS,true);
-      getTF().EvalBind(BuilderRef, loc::MemRegionVal(StateMgr.getRegion(VD)),
+      getTF().EvalBind(BuilderRef, loc::MemRegionVal(state->getRegion(VD)),
                        InitVal);      
     } 
     else {





More information about the cfe-commits mailing list