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
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 43f5ef2..cb423e1 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -2257,7 +2257,7 @@
 #ifndef NDEBUG
 static GRExprEngine* GraphPrintCheckerState;
 static SourceManager* GraphPrintSourceManager;
-static GRState::CheckerStatePrinter* GraphCheckerStatePrinter;
+static GRState::Printer **GraphStatePrinterBeg, **GraphStatePrinterEnd;
 
 namespace llvm {
 template<>
@@ -2500,7 +2500,7 @@
     
     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 @@
   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 @@
 #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 @@
   
   GraphPrintCheckerState = NULL;
   GraphPrintSourceManager = NULL;
-  GraphCheckerStatePrinter = NULL;
+  GraphStatePrinterBeg = NULL;
+  GraphStatePrinterEnd = NULL;
 #endif
 }