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 | ceba6ead45be421ff99c3b3cfd7e3762946541ec (patch) | |
| tree | f71eb6c9f6360665a9ec8651d2884218139e9655 /clang/lib/Analysis/CFRefCount.cpp | |
| parent | 3b977558cea10add50a5c2cbd94d7d66267781dd (diff) | |
| download | bcm5719-llvm-ceba6ead45be421ff99c3b3cfd7e3762946541ec.tar.gz bcm5719-llvm-ceba6ead45be421ff99c3b3cfd7e3762946541ec.zip | |
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.
llvm-svn: 54835
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
| -rw-r--r-- | clang/lib/Analysis/CFRefCount.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 9a769988a10..2fdd0290e1d 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/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; } } |

