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

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 16 11:31:34 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGPrinter.cpp updated: 1.18 -> 1.19
---
Log message:

Use a extant helper to do this.


---
Diffs of the changes:  (+7 -19)

 SelectionDAGPrinter.cpp |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.18 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.19
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.18	Thu Aug  4 09:22:41 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp	Tue Aug 16 13:31:23 2005
@@ -47,26 +47,14 @@
 
 std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
                                                         const SelectionDAG *G) {
-  std::string Op = Node->getOperationName();
-
-  for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i) {
-    switch (Node->getValueType(i)) {
-    default: Op += ":unknownvt!"; break;
-    case MVT::Other: Op += ":ch"; break;
-    case MVT::i1:    Op += ":i1"; break;
-    case MVT::i8:    Op += ":i8"; break;
-    case MVT::i16:   Op += ":i16"; break;
-    case MVT::i32:   Op += ":i32"; break;
-    case MVT::i64:   Op += ":i64"; break;
-    case MVT::i128:  Op += ":i128"; break;
-    case MVT::f32:   Op += ":f32"; break;
-    case MVT::f64:   Op += ":f64"; break;
-    case MVT::f80:   Op += ":f80"; break;
-    case MVT::f128:  Op += ":f128"; break;
-    case MVT::isVoid: Op += ":void"; break;
-    }
-  }
+  std::string Op = Node->getOperationName(G);
 
+  for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
+    if (Node->getValueType(i) == MVT::Other)
+      Op += ":ch";
+    else
+      Op = Op + ":" + MVT::getValueTypeString(Node->getValueType(i));
+    
   if (const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(Node)) {
     Op += ": " + utostr(CSDN->getValue());
   } else if (const ConstantFPSDNode *CSDN = dyn_cast<ConstantFPSDNode>(Node)) {






More information about the llvm-commits mailing list