summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-03-31 04:05:24 +0000
committerChris Lattner <sabre@nondot.org>2007-03-31 04:05:24 +0000
commitf2d71d49e21cdd05205514759e91e9bae3be5e6a (patch)
tree6497138aa0e7a1e6b6cef5c566474ab02e6d6680
parent516f38b35f9da5ded1036d8472e33ede2f3e4b13 (diff)
downloadbcm5719-llvm-f2d71d49e21cdd05205514759e91e9bae3be5e6a.tar.gz
bcm5719-llvm-f2d71d49e21cdd05205514759e91e9bae3be5e6a.zip
switch TL::getValueType to use MVT::getValueType.
llvm-svn: 35527
-rw-r--r--llvm/include/llvm/Target/TargetLowering.h5
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp22
2 files changed, 4 insertions, 23 deletions
diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h
index 5cdad25f518..139580a7dfc 100644
--- a/llvm/include/llvm/Target/TargetLowering.h
+++ b/llvm/include/llvm/Target/TargetLowering.h
@@ -340,7 +340,10 @@ public:
/// getValueType - Return the MVT::ValueType corresponding to this LLVM type.
/// This is fixed by the LLVM operations except for the pointer size.
- MVT::ValueType getValueType(const Type *Ty) const;
+ MVT::ValueType getValueType(const Type *Ty) const {
+ MVT::ValueType VT = MVT::getValueType(Ty);
+ return VT == MVT::iPTR ? PointerTy : VT;
+ }
/// getNumElements - Return the number of registers that this ValueType will
/// eventually require. This is one for any types promoted to live in larger
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 5cd099c779d..195b1504a57 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -2273,25 +2273,3 @@ SDOperand TargetLowering::BuildUDIV(SDNode *N, SelectionDAG &DAG,
DAG.getConstant(magics.s-1, getShiftAmountTy()));
}
}
-
-MVT::ValueType TargetLowering::getValueType(const Type *Ty) const {
- switch (Ty->getTypeID()) {
- default: assert(0 && "Unknown type!");
- case Type::VoidTyID: return MVT::isVoid;
- case Type::IntegerTyID:
- switch (cast<IntegerType>(Ty)->getBitWidth()) {
- default: assert(0 && "Invalid width for value type");
- case 1: return MVT::i1;
- case 8: return MVT::i8;
- case 16: return MVT::i16;
- case 32: return MVT::i32;
- case 64: return MVT::i64;
- case 128: return MVT::i128;
- }
- break;
- case Type::FloatTyID: return MVT::f32;
- case Type::DoubleTyID: return MVT::f64;
- case Type::PointerTyID: return PointerTy;
- case Type::VectorTyID: return MVT::Vector;
- }
-}
OpenPOWER on IntegriCloud