Allow simple nodes to have outgoing edges
authorChris Lattner <sabre@nondot.org>
Wed, 16 Oct 2002 20:15:38 +0000 (20:15 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 16 Oct 2002 20:15:38 +0000 (20:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4202 91177308-0d34-0410-b5e6-96231b3b80d8

include/Support/GraphWriter.h
include/llvm/Support/GraphWriter.h

index 60cae2e50020c4cc77d91abfde63a40cd6849042..743e3a309e60aa13239e321b68d2b4308a54e648 100644 (file)
@@ -141,17 +141,28 @@ public:
   }
 
   /// 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;
index 60cae2e50020c4cc77d91abfde63a40cd6849042..743e3a309e60aa13239e321b68d2b4308a54e648 100644 (file)
@@ -141,17 +141,28 @@ public:
   }
 
   /// 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;