Did my commit for the last patch for the .loc directory from the wrong place and
[oota-llvm.git] / include / llvm / Support / GraphWriter.h
index 5e91d2543e8beb9a08d5cb963b83c76e4c8396a4..2d29e525fb43d19938eb9ff6b39355c04e0c2ee2 100644 (file)
@@ -92,6 +92,20 @@ public:
     DTraits = DOTTraits(SN);
   }
 
+  void writeGraph(const std::string &Title = "") {
+    // Output the header for the graph...
+    writeHeader(Title);
+
+    // Emit all of the nodes in the graph...
+    writeNodes();
+
+    // Output any customizations on the graph
+    DOTGraphTraits<GraphType>::addCustomGraphFeatures(G, *this);
+
+    // Output the end of the graph
+    writeFooter();
+  }
+
   void writeHeader(const std::string &Title) {
     std::string GraphName = DTraits.getGraphName(G);
 
@@ -286,17 +300,9 @@ raw_ostream &WriteGraph(raw_ostream &O, const GraphType &G,
   // Start the graph emission process...
   GraphWriter<GraphType> W(O, G, ShortNames);
 
-  // Output the header for the graph...
-  W.writeHeader(Title);
-
-  // Emit all of the nodes in the graph...
-  W.writeNodes();
-
-  // Output any customizations on the graph
-  DOTGraphTraits<GraphType>::addCustomGraphFeatures(G, W);
+  // Emit the graph.
+  W.writeGraph(Title);
 
-  // Output the end of the graph
-  W.writeFooter();
   return O;
 }