diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-16 00:49:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-16 00:49:49 +0000 |
commit | 1c72ef092f3d931639cf44b4f4f9d0eedc1baa8f (patch) | |
tree | 6e8f87c61a1d28ccf6050fb3f12121b8588d9791 /lib/Analysis/CFRefCount.cpp | |
parent | dd463b8db0b07d2fdb99ffc7a7eb28eeb449c5d4 (diff) |
GRState:
- Remove ConstNotEq from GRState/GRStateManager (!= tracking uses GDM instead).
- GRStateManager now can book-keep "contexts" (e.g., factory objects) for uses
with data elements stored into the GDM.
- Refactor pretty-printing of states to use GRState::Printer objects
exclusively. This removed a huge amount of pretty-printing logic from
GRExprEngine.
CFRefCount
- Simplified some API calls based on refinements to the GDM api.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54835 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 9a769988a1..2fdd0290e1 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -1264,7 +1264,6 @@ private: UseAfterReleasesTy UseAfterReleases; ReleasesNotOwnedTy ReleasesNotOwned; LeaksTy Leaks; - BindingsPrinter Printer; RefBindings Update(RefBindings B, SymbolID sym, RefVal V, ArgEffect E, RefVal::Kind& hasErr); @@ -1301,8 +1300,8 @@ public: virtual void RegisterChecks(GRExprEngine& Eng); - virtual void getStatePrinters(std::vector<GRState::Printer*>& Printers) { - Printers.push_back(&Printer); + virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) { + Printers.push_back(new BindingsPrinter()); } bool isGCEnabled() const { return Summaries.isGCEnabled(); } @@ -1598,7 +1597,7 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst, ? cast<RVal>(lval::SymbolVal(Sym)) : cast<RVal>(nonlval::SymbolVal(Sym)); - state = state.SetRVal(Ex, X, Eng.getCFG().isBlkExpr(Ex), false); + state = state.SetRVal(Ex, X, false); } break; @@ -1608,14 +1607,14 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst, assert (arg_end >= arg_beg); assert (idx < (unsigned) (arg_end - arg_beg)); RVal V = state.GetRVal(*(arg_beg+idx)); - state = state.SetRVal(Ex, V, Eng.getCFG().isBlkExpr(Ex), false); + state = state.SetRVal(Ex, V, false); break; } case RetEffect::ReceiverAlias: { assert (Receiver); RVal V = state.GetRVal(Receiver); - state = state.SetRVal(Ex, V, Eng.getCFG().isBlkExpr(Ex), false); + state = state.SetRVal(Ex, V, false); break; } @@ -1626,15 +1625,13 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst, QualType RetT = GetReturnType(Ex, Eng.getContext()); state = state.set<RefBindings>(Sym, RefVal::makeOwned(RetT), RefBFactory); - state = state.SetRVal(Ex, lval::SymbolVal(Sym), - Eng.getCFG().isBlkExpr(Ex), false); + state = state.SetRVal(Ex, lval::SymbolVal(Sym), false); #if 0 RefBindings B = GetRefBindings(StImpl); SetRefBindings(StImpl, RefBFactory.Add(B, Sym, RefVal::makeOwned(RetT))); #endif - // FIXME: Add a flag to the checker where allocations are allowed to fail. if (RE.getKind() == RetEffect::OwnedAllocatedSymbol) state = state.AddNE(Sym, Eng.getBasicVals().getZeroWithPtrWidth()); @@ -1648,8 +1645,7 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst, QualType RetT = GetReturnType(Ex, Eng.getContext()); state = state.set<RefBindings>(Sym, RefVal::makeNotOwned(RetT), RefBFactory); - state = state.SetRVal(Ex, lval::SymbolVal(Sym), - Eng.getCFG().isBlkExpr(Ex), false); + state = state.SetRVal(Ex, lval::SymbolVal(Sym), false); break; } } |