[llvm-commits] CVS: llvm/include/Support/DOTGraphTraits.h GraphWriter.h
Chris Lattner
lattner at cs.uiuc.edu
Tue Oct 15 20:46:01 PDT 2002
Changes in directory llvm/include/Support:
DOTGraphTraits.h updated: 1.2 -> 1.3
GraphWriter.h updated: 1.5 -> 1.6
---
Log message:
* Add new DOTGraphTraits::addCustomGraphFeatures method
---
Diffs of the changes:
Index: llvm/include/Support/DOTGraphTraits.h
diff -u llvm/include/Support/DOTGraphTraits.h:1.2 llvm/include/Support/DOTGraphTraits.h:1.3
--- llvm/include/Support/DOTGraphTraits.h:1.2 Thu Oct 10 17:29:10 2002
+++ llvm/include/Support/DOTGraphTraits.h Tue Oct 15 20:44:59 2002
@@ -60,6 +60,15 @@
/// edge.
template<typename EdgeIter>
static EdgeIter getEdgeTarget(void *Node, EdgeIter I) { return I; }
+
+ /// addCustomGraphFeatures - If a graph is made up of more than just
+ /// straight-forward nodes and edges, this is the place to put all of the
+ /// custom stuff neccesary. The GraphWriter object, instantiated with your
+ /// GraphType is passed in as an argument. You may call arbitrary methods on
+ /// it to add things to the output graph.
+ ///
+ template<typename GraphWriter>
+ static void addCustomGraphFeatures(void *Graph, GraphWriter &GW) {}
};
Index: llvm/include/Support/GraphWriter.h
diff -u llvm/include/Support/GraphWriter.h:1.5 llvm/include/Support/GraphWriter.h:1.6
--- llvm/include/Support/GraphWriter.h:1.5 Tue Oct 15 20:34:18 2002
+++ llvm/include/Support/GraphWriter.h Tue Oct 15 20:44:59 2002
@@ -72,7 +72,11 @@
O << DOTTraits::getGraphProperties(G);
O << "\n";
+ // Emit all of the nodes in the graph...
writeNodes();
+
+ // Output any customizations on the graph
+ DOTTraits::addCustomGraphFeatures(G, *this);
}
~GraphWriter() {
More information about the llvm-commits
mailing list