aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Type.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 3f8643e7e6..3e085f4027 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 {