From 358033102ffaef4d1afb1c0b7e96440906f0b48f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 21 Jul 2008 21:06:55 +0000 Subject: Enhance the GraphWriter support for edge destinations, and teach the SelectionDAG graph writer to make use of them. Now, nodes with multiple values are displayed as such, with incoming edges pointing to the specific value they use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53875 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/GraphWriter.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'include/llvm/Support/GraphWriter.h') diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index afb2f545bb..20e85cce7d 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -146,11 +146,11 @@ public: for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) { if (i) O << "|"; - O << "" << DOTTraits::getEdgeSourceLabel(Node, EI); + O << "" << DOTTraits::getEdgeSourceLabel(Node, EI); } if (EI != EE) - O << "|truncated..."; + O << "|truncated..."; O << "}"; if (DOTTraits::renderGraphFromBottomUp()) O << "|"; } @@ -163,6 +163,20 @@ public: O << "|" << (void*)Node; } + if (DOTTraits::hasEdgeDestLabels()) { + O << "|{"; + + unsigned i = 0, e = DOTTraits::numEdgeDestLabels(Node); + for (; i != e && i != 64; ++i) { + if (i) O << "|"; + O << "" << DOTTraits::getEdgeDestLabel(Node, i); + } + + if (i != e) + O << "|truncated..."; + O << "}"; + } + O << "}\"];\n"; // Finish printing the "node" line // Output all of the edges now @@ -223,10 +237,10 @@ public: O << "\tNode" << SrcNodeID; if (SrcNodePort >= 0) - O << ":g" << SrcNodePort; + O << ":s" << SrcNodePort; O << " -> Node" << reinterpret_cast(DestNodeID); if (DestNodePort >= 0) - O << ":g" << DestNodePort; + O << ":d" << DestNodePort; if (!Attrs.empty()) O << "[" << Attrs << "]"; -- cgit v1.2.3