Do not point edge heads to source labels
authorTobias Grosser <grosser@fim.uni-passau.de>
Mon, 30 Nov 2009 12:37:39 +0000 (12:37 +0000)
committerTobias Grosser <grosser@fim.uni-passau.de>
Mon, 30 Nov 2009 12:37:39 +0000 (12:37 +0000)
If no destination label is available, just point to the node itself
instead of pointing to some source label. Source and destination labels are
not related in any way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90132 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/GraphWriter.h

index 6d1b18eba6bac6adada1748300c650b082ddca15..c89eb55c98f0fb7ddbf8383dfda2bfb8900e5818 100644 (file)
@@ -247,12 +247,8 @@ public:
     if (SrcNodePort >= 0)
       O << ":s" << SrcNodePort;
     O << " -> Node" << DestNodeID;
-    if (DestNodePort >= 0) {
-      if (DOTTraits::hasEdgeDestLabels())
-        O << ":d" << DestNodePort;
-      else
-        O << ":s" << DestNodePort;
-    }
+    if (DestNodePort >= 0 && DOTTraits::hasEdgeDestLabels())
+      O << ":d" << DestNodePort;
 
     if (!Attrs.empty())
       O << "[" << Attrs << "]";