[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Jan 10 15:26:12 PST 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGPrinter.cpp updated: 1.1 -> 1.2
---
Log message:
Put the operation name in each node, put the function name on the graph.
---
Diffs of the changes: (+17 -0)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.1 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.2
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.1 Mon Jan 10 17:08:40 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Mon Jan 10 17:26:00 2005
@@ -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'.
///
More information about the llvm-commits
mailing list