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

Ted Kremenek kremenek at apple.com
Tue Mar 11 11:25:34 PDT 2008


Author: kremenek
Date: Tue Mar 11 13:25:33 2008
New Revision: 48236

URL: http://llvm.org/viewvc/llvm-project?rev=48236&view=rev
Log:
Expanded graph visualization interface to include specifying a range of
nodes to use a trim sources.

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

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

==============================================================================
--- cfe/trunk/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/Analysis/GRExprEngine.cpp Tue Mar 11 13:25:33 2008
@@ -1814,28 +1814,39 @@
 #endif
 
 void GRExprEngine::ViewGraph(bool trim) {
-#ifndef NDEBUG
-  GraphPrintCheckerState = this;
-  GraphPrintSourceManager = &getContext().getSourceManager();
-  
+#ifndef NDEBUG  
   if (trim) {
     llvm::SmallVector<NodeTy*, 10> Sources;
     AddSources(Sources, null_derefs_begin(), null_derefs_end());
     AddSources(Sources, undef_derefs_begin(), undef_derefs_end());
     
-    GRExprEngine::GraphTy* TrimmedG = G.Trim(&Sources[0],
-                                             &Sources[0]+Sources.size());
-    
-    if (!TrimmedG)
-      llvm::cerr << "warning: Trimmed ExplodedGraph is empty.\n";
-    else {
-      llvm::ViewGraph(*TrimmedG->roots_begin(), "TrimmedGRExprEngine");    
-      delete TrimmedG;
-    }
+    ViewGraph(&Sources[0], &Sources[0]+Sources.size());
   }
-  else
+  else {
+    GraphPrintCheckerState = this;
+    GraphPrintSourceManager = &getContext().getSourceManager();
+
     llvm::ViewGraph(*G.roots_begin(), "GRExprEngine");
+    
+    GraphPrintCheckerState = NULL;
+    GraphPrintSourceManager = NULL;
+  }
+#endif
+}
+
+void GRExprEngine::ViewGraph(NodeTy** Beg, NodeTy** End) {
+#ifndef NDEBUG
+  GraphPrintCheckerState = this;
+  GraphPrintSourceManager = &getContext().getSourceManager();
   
+  GRExprEngine::GraphTy* TrimmedG = G.Trim(Beg, End);
+
+  if (!TrimmedG)
+    llvm::cerr << "warning: Trimmed ExplodedGraph is empty.\n";
+  else {
+    llvm::ViewGraph(*TrimmedG->roots_begin(), "TrimmedGRExprEngine");    
+    delete TrimmedG;
+  }  
   
   GraphPrintCheckerState = NULL;
   GraphPrintSourceManager = NULL;

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

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Tue Mar 11 13:25:33 2008
@@ -153,6 +153,8 @@
   ///  simulation.
   void ViewGraph(bool trim = false);
   
+  void ViewGraph(NodeTy** Beg, NodeTy** End);
+  
   /// getInitialState - Return the initial state used for the root vertex
   ///  in the ExplodedGraph.
   ValueState* getInitialState();





More information about the cfe-commits mailing list