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

Chris Lattner lattner at cs.uiuc.edu
Fri Jan 14 23:14:45 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.33 -> 1.34
---
Log message:

Common code factored out.


---
Diffs of the changes:  (+4 -24)

Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.33 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.34
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.33	Sat Jan 15 00:17:04 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Sat Jan 15 01:14:32 2005
@@ -480,19 +480,6 @@
   return SDOperand(N, 0);
 }
 
-static const Type *getTypeFor(MVT::ValueType VT) {
-  switch (VT) {
-  default: assert(0 && "Unknown MVT!");
-  case MVT::i1: return Type::BoolTy;
-  case MVT::i8: return Type::UByteTy;
-  case MVT::i16: return Type::UShortTy;
-  case MVT::i32: return Type::UIntTy;
-  case MVT::i64: return Type::ULongTy;
-  case MVT::f32: return Type::FloatTy;
-  case MVT::f64: return Type::DoubleTy;
-  }
-}
-
 SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
                                 SDOperand Operand) {
   if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Operand.Val)) {
@@ -1096,17 +1083,10 @@
 
   for (unsigned i = 0, e = getNumValues(); i != e; ++i) {
     if (i) std::cerr << ",";
-    switch (getValueType(i)) {
-    default: assert(0 && "Unknown value type!");
-    case MVT::i1:    std::cerr << "i1"; break;
-    case MVT::i8:    std::cerr << "i8"; break;
-    case MVT::i16:   std::cerr << "i16"; break;
-    case MVT::i32:   std::cerr << "i32"; break;
-    case MVT::i64:   std::cerr << "i64"; break;
-    case MVT::f32:   std::cerr << "f32"; break;
-    case MVT::f64:   std::cerr << "f64"; break;
-    case MVT::Other: std::cerr << "ch"; break;
-    }
+    if (getValueType(i) == MVT::Other)
+      std::cerr << "ch";
+    else
+      std::cerr << MVT::getValueTypeString(getValueType(i));
   }
   std::cerr << " = " << getOperationName();
 






More information about the llvm-commits mailing list