]> granicus.if.org Git - clang/commitdiff
Expanded graph-visualization to include optional pretty-printing of checker-specific...
authorTed Kremenek <kremenek@apple.com>
Tue, 11 Mar 2008 19:02:40 +0000 (19:02 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 11 Mar 2008 19:02:40 +0000 (19:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48238 91177308-0d34-0410-b5e6-96231b3b80d8

Analysis/GRExprEngine.cpp
include/clang/Analysis/PathSensitive/GRTransferFuncs.h

index 6d1c03d537d5bbb18a32410339858697ef335a12..e2fec9f88f585ab3402826c5dbd79548f0b71848 100644 (file)
@@ -1554,6 +1554,7 @@ GRExprEngine::AssumeSymInt(ValueState* St, bool Assumption,
 #ifndef NDEBUG
 static GRExprEngine* GraphPrintCheckerState;
 static SourceManager* GraphPrintSourceManager;
+static ValueState::CheckerStatePrinter* GraphCheckerStatePrinter;
 
 namespace llvm {
 template<>
@@ -1794,7 +1795,7 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
     
     Out << "\\|StateID: " << (void*) N->getState() << "\\|";
 
-    N->getState()->printDOT(Out);
+    N->getState()->printDOT(Out, GraphCheckerStatePrinter);
       
     Out << "\\l";
     return Out.str();
@@ -1825,11 +1826,13 @@ void GRExprEngine::ViewGraph(bool trim) {
   else {
     GraphPrintCheckerState = this;
     GraphPrintSourceManager = &getContext().getSourceManager();
+    GraphCheckerStatePrinter = TF->getCheckerStatePrinter();
 
     llvm::ViewGraph(*G.roots_begin(), "GRExprEngine");
     
     GraphPrintCheckerState = NULL;
     GraphPrintSourceManager = NULL;
+    GraphCheckerStatePrinter = NULL;
   }
 #endif
 }
@@ -1838,6 +1841,7 @@ void GRExprEngine::ViewGraph(NodeTy** Beg, NodeTy** End) {
 #ifndef NDEBUG
   GraphPrintCheckerState = this;
   GraphPrintSourceManager = &getContext().getSourceManager();
+  GraphCheckerStatePrinter = TF->getCheckerStatePrinter();
   
   GRExprEngine::GraphTy* TrimmedG = G.Trim(Beg, End);
 
@@ -1850,5 +1854,6 @@ void GRExprEngine::ViewGraph(NodeTy** Beg, NodeTy** End) {
   
   GraphPrintCheckerState = NULL;
   GraphPrintSourceManager = NULL;
+  GraphCheckerStatePrinter = NULL;
 #endif
 }
index 256cadd945c6f71b0046518adf5ccc7b577c0416..7432c7fb61b0b93b6f6df0b156aafea0573c5cd8 100644 (file)
 
 #include "clang/Analysis/PathSensitive/RValues.h"
 #include "clang/Analysis/PathSensitive/GRCoreEngine.h"
+#include "clang/Analysis/PathSensitive/ValueState.h"
 
 namespace clang {
   
-  class ValueState;
-  class ValueStateManager;
-  
 class GRTransferFuncs {
 public:
   GRTransferFuncs() {}
   virtual ~GRTransferFuncs() {}
   
+  virtual ValueState::CheckerStatePrinter* getCheckerStatePrinter() {
+    return NULL;
+  }
+  
   // Casts.
   
   virtual RVal EvalCast(BasicValueFactory& BasicVals, NonLVal V,