summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-10 23:26:00 +0000
committerChris Lattner <sabre@nondot.org>2005-01-10 23:26:00 +0000
commit12be02722f840360451f44841d6345ba8d04a2c2 (patch)
tree088de7c1003200812be2555ea75525a250ae958f /llvm/lib/CodeGen
parent9e4c76123c049048e8079739d63e0b7b161f6e73 (diff)
downloadbcm5719-llvm-12be02722f840360451f44841d6345ba8d04a2c2.tar.gz
bcm5719-llvm-12be02722f840360451f44841d6345ba8d04a2c2.zip
Put the operation name in each node, put the function name on the graph.
llvm-svn: 19444
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index 9c483332266..db094a0a120 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -18,6 +18,23 @@
#include <fstream>
using namespace llvm;
+namespace llvm {
+ template<>
+ struct DOTGraphTraits<SelectionDAG*> : 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'.
///
OpenPOWER on IntegriCloud