diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-01-12 23:30:31 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-01-12 23:30:31 +0000 |
commit | 02114aa0e507a10b18989ff6f4542d8572a07da0 (patch) | |
tree | 280243b94ac4a9e4475ba410e412c302b8c08964 /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 286bf46a23c0c066b12de1d89e750e1ffcc1e05b (diff) |
Move a function out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index d780dd28c9..91745705fc 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<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; + } + break; + case Type::FloatTyID: return MVT::f32; + case Type::DoubleTyID: return MVT::f64; + case Type::PointerTyID: return PointerTy; + case Type::PackedTyID: return MVT::Vector; + } +} |