[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp

Chris Lattner sabre at nondot.org
Fri Oct 20 11:06:23 PDT 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGPrinter.cpp updated: 1.40 -> 1.41
---
Log message:

Make flag and chain edges visually distinguishable from value edges in DOT
output.


---
Diffs of the changes:  (+16 -1)

 SelectionDAGPrinter.cpp |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.40 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.41
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.40	Tue Oct 17 16:18:26 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp	Fri Oct 20 13:06:09 2006
@@ -41,6 +41,20 @@
                                     const SelectionDAG *Graph) {
       return true;
     }
+    
+    /// If you want to override the dot attributes printed for a particular
+    /// edge, override this method.
+    template<typename EdgeIter>
+    static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
+      SDOperand Op = EI.getNode()->getOperand(EI.getOperand());
+      MVT::ValueType VT = Op.getValueType();
+      if (VT == MVT::Flag)
+        return "color=red,style=bold";
+      else if (VT == MVT::Other)
+        return "style=dashed";
+      return "";
+    }
+    
 
     static std::string getNodeLabel(const SDNode *Node,
                                     const SelectionDAG *Graph);
@@ -114,7 +128,8 @@
       Op += LBB->getName();
     //Op += " " + (const void*)BBDN->getBasicBlock();
   } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(Node)) {
-    if (G && R->getReg() != 0 && MRegisterInfo::isPhysicalRegister(R->getReg())) {
+    if (G && R->getReg() != 0 &&
+        MRegisterInfo::isPhysicalRegister(R->getReg())) {
       Op = Op + " " + G->getTarget().getRegisterInfo()->getName(R->getReg());
     } else {
       Op += " #" + utostr(R->getReg());






More information about the llvm-commits mailing list