diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-06-23 20:38:51 +0000 | 
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-06-23 20:38:51 +0000 | 
| commit | 7df5691d2d23d4d55556f5e218cd79f3d14b6595 (patch) | |
| tree | a3b6e3a37e6363d5c72b521e7bea017f5a1f00c3 /clang/lib | |
| parent | 59ee3f507916eff2acbdebb5d6e858a9187ef5bc (diff) | |
| download | bcm5719-llvm-7df5691d2d23d4d55556f5e218cd79f3d14b6595.tar.gz bcm5719-llvm-7df5691d2d23d4d55556f5e218cd79f3d14b6595.zip  | |
Remove GRStateManager::BindLoc() and GRStateManager::Unbind().
llvm-svn: 73996
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Analysis/GRSimpleVals.cpp | 17 | ||||
| -rw-r--r-- | clang/lib/Analysis/GRState.cpp | 12 | 
3 files changed, 15 insertions, 16 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index c32c424b669..42c6ce3dfb6 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -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 diff --git a/clang/lib/Analysis/GRSimpleVals.cpp b/clang/lib/Analysis/GRSimpleVals.cpp index 480612113d1..9a1b2fc05e4 100644 --- a/clang/lib/Analysis/GRSimpleVals.cpp +++ b/clang/lib/Analysis/GRSimpleVals.cpp @@ -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);  }  //===----------------------------------------------------------------------===// diff --git a/clang/lib/Analysis/GRState.cpp b/clang/lib/Analysis/GRState.cpp index a64b2d7f5f4..3217c4ac4d0 100644 --- a/clang/lib/Analysis/GRState.cpp +++ b/clang/lib/Analysis/GRState.cpp @@ -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() {  | 

