diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 20:04:48 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 20:04:48 +0000 |
| commit | 76aa677ec348ce6e88a5af977b135a05799419d4 (patch) | |
| tree | 10669daf2b51c49c1f62205c6111750b8f1ff42a /llvm/lib | |
| parent | 0ec2cca8f28e49ca6273e67711090e69720348b8 (diff) | |
| download | bcm5719-llvm-76aa677ec348ce6e88a5af977b135a05799419d4.tar.gz bcm5719-llvm-76aa677ec348ce6e88a5af977b135a05799419d4.zip | |
Add a new predicate for integer type equality tests.
llvm-svn: 92759
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. /// |

