]> granicus.if.org Git - clang/commitdiff
Ubigraph visualization: represent cached nodes with a different style.
authorTed Kremenek <kremenek@apple.com>
Thu, 28 Aug 2008 05:02:09 +0000 (05:02 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 28 Aug 2008 05:02:09 +0000 (05:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55463 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/AnalysisConsumer.cpp

index a8390e147c8695de8128365efc4a68f8ad840efc..0a59797549e4e3b215a7c8a2c975e44e944c300a 100644 (file)
@@ -479,8 +479,7 @@ class UbigraphViz : public ExplodedNodeImpl::Auditor {
   
 public:
   UbigraphViz(llvm::raw_ostream* out, llvm::sys::Path& dir,
-              llvm::sys::Path& filename)
-    : Out(out), Dir(dir), Filename(filename), Cntr(0) {} 
+              llvm::sys::Path& filename);
   
   ~UbigraphViz();
   
@@ -535,14 +534,26 @@ void UbigraphViz::AddEdge(ExplodedNodeImpl* Src, ExplodedNodeImpl* Dst) {
     M[Dst] = DstID = Cntr++;
     *Out << "('vertex', " << DstID << ")\n";
   }
-  else
+  else {
+    // We have hit DstID before.  Change its style to reflect a cache hit.
     DstID = DstI->second;
+    *Out << "('change_vertex_style', " << DstID << ", 1)\n";
+  }
 
   // Add the edge.
   *Out << "('edge', " << SrcID << ", " << DstID 
        << ", ('arrow','true'), ('oriented', 'true'))\n";
 }
 
+UbigraphViz::UbigraphViz(llvm::raw_ostream* out, llvm::sys::Path& dir,
+                         llvm::sys::Path& filename)
+  : Out(out), Dir(dir), Filename(filename), Cntr(0) {
+
+  *Out << "('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n";
+  *Out << "('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66'),"
+          " ('size', '1.5'))\n";
+}
+
 UbigraphViz::~UbigraphViz() {
   Out.reset(0);
   llvm::cerr << "Running 'ubiviz' program... ";