1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Add Type::isIntOrIntVector, like Type::isFPOrFPVector.

llvm-svn: 41190
This commit is contained in:
Dan Gohman 2007-08-20 19:25:59 +00:00
parent 5da3149de5
commit 908f4e65ed
2 changed files with 16 additions and 0 deletions

View File

@ -180,6 +180,11 @@ public:
///
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 ||

View File

@ -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 {