From ceba6ead45be421ff99c3b3cfd7e3762946541ec Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sat, 16 Aug 2008 00:49:49 +0000 Subject: 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 --- clang/lib/Analysis/CFRefCount.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'clang/lib/Analysis/CFRefCount.cpp') 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& Printers) { - Printers.push_back(&Printer); + virtual void RegisterPrinters(std::vector& Printers) { + Printers.push_back(new BindingsPrinter()); } bool isGCEnabled() const { return Summaries.isGCEnabled(); } @@ -1598,7 +1597,7 @@ void CFRefCount::EvalSummary(ExplodedNodeSet& Dst, ? cast(lval::SymbolVal(Sym)) : cast(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& 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& Dst, QualType RetT = GetReturnType(Ex, Eng.getContext()); state = state.set(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& Dst, QualType RetT = GetReturnType(Ex, Eng.getContext()); state = state.set(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; } } -- cgit v1.2.3