From e0646b86e3cdc35c5dd0e1c10b7ac564066e3bd6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 10 Jan 2005 23:26:00 +0000 Subject: [PATCH] Put the operation name in each node, put the function name on the graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19444 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../SelectionDAG/SelectionDAGPrinter.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index 9c483332266..db094a0a120 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -18,6 +18,23 @@ #include using namespace llvm; +namespace llvm { + template<> + struct DOTGraphTraits : public DefaultDOTGraphTraits { + static std::string getGraphName(const SelectionDAG *G) { + return G->getMachineFunction().getFunction()->getName(); + } + static std::string getNodeLabel(const SDNode *Node, + const SelectionDAG *Graph) { + return Node->getOperationName(); + } + + static std::string getNodeAttributes(const SDNode *N) { + return "shape=Mrecord"; + } + }; +} + /// viewGraph - Pop up a ghostview window with the reachable parts of the DAG /// rendered using 'dot'. ///