aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-08-13 21:24:49 +0000
committerTed Kremenek <kremenek@apple.com>2008-08-13 21:24:49 +0000
commitae6814efb6c41bd0c0f6413d25097105284d5be7 (patch)
tree0f09f995a705f6c7dd77ec17f6c0dec040641733 /lib/Analysis/GRExprEngine.cpp
parent7ba378a9289e807736ed4f24f015b8812ef5939a (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/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 43f5ef2185..cb423e18af 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -2257,7 +2257,7 @@ void GRExprEngine::EvalBinOp(GRStateSet& OStates, const GRState* St,
#ifndef NDEBUG
static GRExprEngine* GraphPrintCheckerState;
static SourceManager* GraphPrintSourceManager;
-static GRState::CheckerStatePrinter* GraphCheckerStatePrinter;
+static GRState::Printer **GraphStatePrinterBeg, **GraphStatePrinterEnd;
namespace llvm {
template<>
@@ -2500,7 +2500,7 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
Out << "\\|StateID: " << (void*) N->getState() << "\\|";
- N->getState()->printDOT(Out, GraphCheckerStatePrinter);
+ N->getState()->printDOT(Out, GraphStatePrinterBeg, GraphStatePrinterEnd);
Out << "\\l";
return Out.str();
@@ -2565,13 +2565,20 @@ void GRExprEngine::ViewGraph(bool trim) {
else {
GraphPrintCheckerState = this;
GraphPrintSourceManager = &getContext().getSourceManager();
- GraphCheckerStatePrinter = getTF().getCheckerStatePrinter();
+
+ // Get the state printers.
+ std::vector<GRState::Printer*> Printers;
+ getTF().getStatePrinters(Printers);
+ GraphStatePrinterBeg = Printers.empty() ? 0 : &Printers[0];
+ GraphStatePrinterEnd = Printers.empty() ? 0 : &Printers[0]+Printers.size();
+
llvm::ViewGraph(*G.roots_begin(), "GRExprEngine");
GraphPrintCheckerState = NULL;
GraphPrintSourceManager = NULL;
- GraphCheckerStatePrinter = NULL;
+ GraphStatePrinterBeg = NULL;
+ GraphStatePrinterEnd = NULL;
}
#endif
}
@@ -2580,7 +2587,12 @@ void GRExprEngine::ViewGraph(NodeTy** Beg, NodeTy** End) {
#ifndef NDEBUG
GraphPrintCheckerState = this;
GraphPrintSourceManager = &getContext().getSourceManager();
- GraphCheckerStatePrinter = getTF().getCheckerStatePrinter();
+
+ // Get the state printers.
+ std::vector<GRState::Printer*> Printers;
+ getTF().getStatePrinters(Printers);
+ GraphStatePrinterBeg = Printers.empty() ? 0 : &Printers[0];
+ GraphStatePrinterEnd = Printers.empty() ? 0 : &Printers[0]+Printers.size();
GRExprEngine::GraphTy* TrimmedG = G.Trim(Beg, End);
@@ -2593,6 +2605,7 @@ void GRExprEngine::ViewGraph(NodeTy** Beg, NodeTy** End) {
GraphPrintCheckerState = NULL;
GraphPrintSourceManager = NULL;
- GraphCheckerStatePrinter = NULL;
+ GraphStatePrinterBeg = NULL;
+ GraphStatePrinterEnd = NULL;
#endif
}