mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-10 05:41:40 +00:00
Add isPositive for symmetry with isNegative.
llvm-svn: 34862
This commit is contained in:
parent
6f7b9afc1c
commit
e5244b132b
@ -106,7 +106,7 @@ class APInt {
|
||||
/// @returns a uint64_t type integer with just bit position at
|
||||
/// "whichBit(bitPosition)" setting, others zero.
|
||||
static inline uint64_t maskBit(uint32_t bitPosition) {
|
||||
return (static_cast<uint64_t>(1)) << whichBit(bitPosition);
|
||||
return 1ULL << whichBit(bitPosition);
|
||||
}
|
||||
|
||||
/// This method is used internally to clear the to "N" bits that are not used
|
||||
@ -365,6 +365,13 @@ public:
|
||||
return (*this)[BitWidth - 1];
|
||||
}
|
||||
|
||||
/// This just tests the high bit of the APInt to determine if the value is
|
||||
/// positove or not.
|
||||
/// @brief Determine if this APInt Value is positive.
|
||||
bool isPositive() const {
|
||||
return !isNegative();
|
||||
}
|
||||
|
||||
/// Arithmetic right-shift this APInt by shiftAmt.
|
||||
/// @brief Arithmetic right-shift function.
|
||||
APInt ashr(uint32_t shiftAmt) const;
|
||||
|
Loading…
Reference in New Issue
Block a user