[llvm-commits] CVS: llvm/include/Support/GraphWriter.h
Chris Lattner
lattner at cs.uiuc.edu
Wed Oct 16 15:16:01 PDT 2002
Changes in directory llvm/include/Support:
GraphWriter.h updated: 1.7 -> 1.8
---
Log message:
Allow simple nodes to have outgoing edges
---
Diffs of the changes:
Index: llvm/include/Support/GraphWriter.h
diff -u llvm/include/Support/GraphWriter.h:1.7 llvm/include/Support/GraphWriter.h:1.8
--- llvm/include/Support/GraphWriter.h:1.7 Tue Oct 15 21:03:18 2002
+++ llvm/include/Support/GraphWriter.h Wed Oct 16 15:15:38 2002
@@ -141,17 +141,28 @@
}
/// emitSimpleNode - Outputs a simple (non-record) node
- void emitSimpleNode(void *ID, const std::string &Attr,
- const std::string &Label) {
+ void emitSimpleNode(const void *ID, const std::string &Attr,
+ const std::string &Label, unsigned NumEdgeSources = 0) {
O << "\tNode" << ID << "[ ";
if (!Attr.empty())
O << Attr << ",";
- O << " label =\"" << DOT::EscapeString(Label) << "\"];\n";
+ O << " label =\"{" << DOT::EscapeString(Label);
+ if (NumEdgeSources) {
+ O << "|{";
+
+ for (unsigned i = 0; i != NumEdgeSources; ++i) {
+ if (i) O << "|";
+ O << "<g" << i << ">";
+ }
+ O << "}";
+ }
+ O << "}\"];\n";
}
/// emitEdge - Output an edge from a simple node into the graph...
- void emitEdge(void *SrcNodeID, int SrcNodePort,
- void *DestNodeID, int DestNodePort, const std::string &Attrs) {
+ void emitEdge(const void *SrcNodeID, int SrcNodePort,
+ const void *DestNodeID, int DestNodePort,
+ const std::string &Attrs) {
O << "\tNode" << SrcNodeID;
if (SrcNodePort >= 0)
O << ":g" << SrcNodePort;
More information about the llvm-commits
mailing list