[cfe-commits] r48238 - in /cfe/trunk: Analysis/GRExprEngine.cpp include/clang/Analysis/PathSensitive/GRTransferFuncs.h

Ted Kremenek kremenek at apple.com
Tue Mar 11 12:02:40 PDT 2008


Author: kremenek
Date: Tue Mar 11 14:02:40 2008
New Revision: 48238

URL: http://llvm.org/viewvc/llvm-project?rev=48238&view=rev
Log:
Expanded graph-visualization to include optional pretty-printing of checker-specific state.

Modified:
    cfe/trunk/Analysis/GRExprEngine.cpp
    cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h

Modified: cfe/trunk/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/GRExprEngine.cpp?rev=48238&r1=48237&r2=48238&view=diff

==============================================================================
--- cfe/trunk/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/Analysis/GRExprEngine.cpp Tue Mar 11 14:02:40 2008
@@ -1554,6 +1554,7 @@
 #ifndef NDEBUG
 static GRExprEngine* GraphPrintCheckerState;
 static SourceManager* GraphPrintSourceManager;
+static ValueState::CheckerStatePrinter* GraphCheckerStatePrinter;
 
 namespace llvm {
 template<>
@@ -1794,7 +1795,7 @@
     
     Out << "\\|StateID: " << (void*) N->getState() << "\\|";
 
-    N->getState()->printDOT(Out);
+    N->getState()->printDOT(Out, GraphCheckerStatePrinter);
       
     Out << "\\l";
     return Out.str();
@@ -1825,11 +1826,13 @@
   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 @@
 #ifndef NDEBUG
   GraphPrintCheckerState = this;
   GraphPrintSourceManager = &getContext().getSourceManager();
+  GraphCheckerStatePrinter = TF->getCheckerStatePrinter();
   
   GRExprEngine::GraphTy* TrimmedG = G.Trim(Beg, End);
 
@@ -1850,5 +1854,6 @@
   
   GraphPrintCheckerState = NULL;
   GraphPrintSourceManager = NULL;
+  GraphCheckerStatePrinter = NULL;
 #endif
 }

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h?rev=48238&r1=48237&r2=48238&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h Tue Mar 11 14:02:40 2008
@@ -17,17 +17,19 @@
 
 #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,





More information about the cfe-commits mailing list