diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-13 21:24:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-13 21:24:49 +0000 |
commit | ae6814efb6c41bd0c0f6413d25097105284d5be7 (patch) | |
tree | 0f09f995a705f6c7dd77ec17f6c0dec040641733 /lib/Analysis/CFRefCount.cpp | |
parent | 7ba378a9289e807736ed4f24f015b8812ef5939a (diff) |
Renamed GRState::CheckerStatePrinter to GRState::Printer.
Updated checker state printer interface to allow transfer functions to return an arbitrary number of GRState::Printers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 2d69d9bb3d..256072ab3a 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -1211,10 +1211,10 @@ public: typedef llvm::DenseMap<GRExprEngine::NodeTy*, std::vector<SymbolID>*> LeaksTy; - class BindingsPrinter : public GRState::CheckerStatePrinter { + class BindingsPrinter : public GRState::Printer { public: - virtual void PrintCheckerState(std::ostream& Out, void* State, - const char* nl, const char* sep); + virtual void Print(std::ostream& Out, const GRState* state, + const char* nl, const char* sep); }; private: @@ -1231,6 +1231,10 @@ public: static RefBindings GetRefBindings(const GRState& StImpl) { return RefBindings((const RefBindings::TreeTy*) StImpl.CheckerState); } + + static RefBindings GetRefBindings(const GRState* state) { + return RefBindings((const RefBindings::TreeTy*) state->CheckerState); + } private: @@ -1272,8 +1276,8 @@ public: virtual void RegisterChecks(GRExprEngine& Eng); - virtual GRState::CheckerStatePrinter* getCheckerStatePrinter() { - return &Printer; + virtual void getStatePrinters(std::vector<GRState::Printer*>& Printers) { + Printers.push_back(&Printer); } bool isGCEnabled() const { return Summaries.isGCEnabled(); } @@ -1363,12 +1367,12 @@ public: -void CFRefCount::BindingsPrinter::PrintCheckerState(std::ostream& Out, - void* State, const char* nl, - const char* sep) { - RefBindings B((RefBindings::TreeTy*) State); +void CFRefCount::BindingsPrinter::Print(std::ostream& Out, const GRState* state, + const char* nl, const char* sep) { + + RefBindings B = GetRefBindings(state); - if (State) + if (!B.isEmpty()) Out << sep << nl; for (RefBindings::iterator I=B.begin(), E=B.end(); I!=E; ++I) { |