Ubigraph visualization: represent cached nodes with a different style.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55463 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/AnalysisConsumer.cpp b/Driver/AnalysisConsumer.cpp
index a8390e1..0a59797 100644
--- a/Driver/AnalysisConsumer.cpp
+++ b/Driver/AnalysisConsumer.cpp
@@ -479,8 +479,7 @@
   
 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 @@
     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... ";