mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 05:00:26 +00:00
Add an isUnitValue method for comparison against 1. This just follows a
common pattern with isNullValue, isAllOnesValue, etc. It also helps to prevent things like getZExtValue() == 1, which could assert for large bitwidths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c100b96b15
commit
37eeaa729b
@ -127,6 +127,13 @@ public:
|
||||
return Val == 0;
|
||||
}
|
||||
|
||||
/// This is just a convenience method to make client code smaller for a
|
||||
/// common case.
|
||||
/// @brief Determine if the value is one.
|
||||
virtual bool isUnitValue() const {
|
||||
return Val == 1;
|
||||
}
|
||||
|
||||
/// This function will return true iff every bit in this constant is set
|
||||
/// to true.
|
||||
/// @returns true iff this constant's bits are all set to true.
|
||||
|
Loading…
Reference in New Issue
Block a user