diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Type.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 77ede893b1b..20945be79df 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -124,6 +124,11 @@ const Type *Type::getScalarType() const { return this; } +/// isInteger - Return true if this is an IntegerType of the specified width. +bool Type::isInteger(unsigned Bitwidth) const { + return isInteger() && cast<IntegerType>(this)->getBitWidth() == Bitwidth; +} + /// isIntOrIntVector - Return true if this is an integer type or a vector of /// integer types. /// |