diff options
author | Dan Gohman <gohman@apple.com> | 2007-08-20 19:25:59 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-08-20 19:25:59 +0000 |
commit | ef1af7d6d5be039e7eea46f8f3a2720fb5a1a153 (patch) | |
tree | 241cfde0b6fed3053bcaf393af567ff05c7deeca /lib | |
parent | 7abff319570dd286f2b9529ea7749fe4f97e47f6 (diff) | |
download | external_llvm-ef1af7d6d5be039e7eea46f8f3a2720fb5a1a153.zip external_llvm-ef1af7d6d5be039e7eea46f8f3a2720fb5a1a153.tar.gz external_llvm-ef1af7d6d5be039e7eea46f8f3a2720fb5a1a153.tar.bz2 |
Add Type::isIntOrIntVector, like Type::isFPOrFPVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Type.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 3f8643e..3e085f4 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -126,6 +126,17 @@ const Type *Type::getVAArgsPromotedType() const { return this; } +/// isIntOrIntVector - Return true if this is an integer type or a vector of +/// integer types. +/// +bool Type::isIntOrIntVector() const { + if (isInteger()) + return true; + if (ID != Type::VectorTyID) return false; + + return cast<VectorType>(this)->getElementType()->isInteger(); +} + /// isFPOrFPVector - Return true if this is a FP type or a vector of FP types. /// bool Type::isFPOrFPVector() const { |