diff options
author | Dan Gohman <gohman@apple.com> | 2010-01-05 00:42:54 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-01-05 00:42:54 +0000 |
commit | 26b1b1fd113e0c5a68deda1556e37b608f127641 (patch) | |
tree | ce51a9b2faa7e77e64c6109f41bba96e12a5d87a /include/llvm/CodeGen/ValueTypes.h | |
parent | 0f73d3fb093c02629297c7bde25cd37eaa65c48f (diff) | |
download | llvm-26b1b1fd113e0c5a68deda1556e37b608f127641.tar.gz llvm-26b1b1fd113e0c5a68deda1556e37b608f127641.tar.bz2 llvm-26b1b1fd113e0c5a68deda1556e37b608f127641.tar.xz |
Simplify this code; avoid duplicating the low-level implementation code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/ValueTypes.h')
-rw-r--r-- | include/llvm/CodeGen/ValueTypes.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index 703c4aa683..0125190e37 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -437,25 +437,17 @@ namespace llvm { /// isFloatingPoint - Return true if this is a FP, or a vector FP type. bool isFloatingPoint() const { - return isSimple() ? - ((V >= MVT::f32 && V <= MVT::ppcf128) || - (V >= MVT::v2f32 && V <= MVT::v4f64)) : isExtendedFloatingPoint(); + return isSimple() ? V.isFloatingPoint() : isExtendedFloatingPoint(); } /// isInteger - Return true if this is an integer, or a vector integer type. bool isInteger() const { - return isSimple() ? - ((V >= MVT::FIRST_INTEGER_VALUETYPE && - V <= MVT::LAST_INTEGER_VALUETYPE) || - (V >= MVT::v2i8 && V <= MVT::v4i64)) : isExtendedInteger(); + return isSimple() ? V.isInteger() : isExtendedInteger(); } /// isVector - Return true if this is a vector value type. bool isVector() const { - return isSimple() ? - (V >= MVT::FIRST_VECTOR_VALUETYPE && V <= - MVT::LAST_VECTOR_VALUETYPE) : - isExtendedVector(); + return isSimple() ? V.isVector() : isExtendedVector(); } /// is64BitVector - Return true if this is a 64-bit vector type. @@ -641,7 +633,7 @@ namespace llvm { static EVT getEVT(const Type *Ty, bool HandleUnknown = false); intptr_t getRawBits() { - if (V.SimpleTy <= MVT::LastSimpleValueType) + if (isSimple()) return V.SimpleTy; else return (intptr_t)(LLVMTy); |