]> granicus.if.org Git - clang/commitdiff
Remove GRStateManager::getRegion/getSelfRegion().
authorTed Kremenek <kremenek@apple.com>
Tue, 23 Jun 2009 21:37:46 +0000 (21:37 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 23 Jun 2009 21:37:46 +0000 (21:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74006 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/GRState.h
lib/Analysis/BasicStore.cpp
lib/Analysis/CFRefCount.cpp
lib/Analysis/GRExprEngine.cpp

index 7c9c80bea2c375bd8377466b9614182d3d897a99..285bd02671b1658a6338c16f364a652cb129c6f1 100644 (file)
@@ -198,6 +198,14 @@ public:
   const GRState *assumeInBound(SVal idx, SVal upperBound, 
                                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 @@ private:
   /// 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 @@ public:
   
   ~GRStateManager();
 
-  const GRStategetInitialState();
+  const GRState *getInitialState();
         
   ASTContext &getContext() { return ValueMgr.getContext(); }
   const ASTContext &getContext() const { return ValueMgr.getContext(); }               
@@ -510,17 +507,6 @@ public:
     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:
 
index 6b346cd52557edea4f49ebaa3ae900cedee55f20..e4ea260548775559aef69df3a591432b1a495253 100644 (file)
@@ -535,7 +535,7 @@ Store BasicStoreManager::getInitialStore() {
 
       // 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)
index 46333a74f27d77f6b391881f289f8dc54dccd4c0..d4d10cf5d15da0fa160557246b97d1b1f4ac90d4 100644 (file)
@@ -3091,7 +3091,7 @@ void CFRefCount::EvalObjCMessageExpr(ExplodedNodeSet<GRState>& Dst,
       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);
index 42c6ce3dfb66568e986eb163d993efe939f91a00..5ea9b29ddaddfd535e58b5558a8c87a2d26aceb9 100644 (file)
@@ -176,7 +176,7 @@ const GRState* GRExprEngine::getInitialState() {
       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 @@ void GRExprEngine::VisitDeclStmt(DeclStmt* DS, NodeTy* Pred, NodeSet& Dst) {
       // 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 {