forked from OSchip/llvm-project
Add a new predicate for integer type equality tests.
llvm-svn: 92759
This commit is contained in:
parent
0ec2cca8f2
commit
76aa677ec3
|
@ -217,6 +217,9 @@ public:
|
|||
///
|
||||
bool isInteger() const { return ID == IntegerTyID; }
|
||||
|
||||
/// isInteger - Return true if this is an IntegerType of the specified width.
|
||||
bool isInteger(unsigned Bitwidth) const;
|
||||
|
||||
/// isIntOrIntVector - Return true if this is an integer type or a vector of
|
||||
/// integer types.
|
||||
///
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue