///
bool isInteger() const { return ID == IntegerTyID; }
+ /// isIntOrIntVector - Return true if this is an integer type or a vector of
+ /// integer types.
+ ///
+ bool isIntOrIntVector() const;
+
/// isFloatingPoint - Return true if this is one of the two floating point
/// types
bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID ||
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 {