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
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.