From 6468d49755567c56f80a82d9b6263777bb91fe73 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 12 Jan 2007 23:30:31 +0000 Subject: [PATCH] Move a function out of line. llvm-svn: 33158 --- lib/CodeGen/SelectionDAG/TargetLowering.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index d780dd28c93..91745705fc7 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1741,3 +1741,24 @@ 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(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; + } + break; + case Type::FloatTyID: return MVT::f32; + case Type::DoubleTyID: return MVT::f64; + case Type::PointerTyID: return PointerTy; + case Type::PackedTyID: return MVT::Vector; + } +}