mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -584,22 +584,20 @@ bool APInt::slt(const APInt& RHS) const {
|
||||
return lhs.ult(rhs);
|
||||
}
|
||||
|
||||
APInt& APInt::set(unsigned bitPosition) {
|
||||
void APInt::set(unsigned bitPosition) {
|
||||
if (isSingleWord())
|
||||
VAL |= maskBit(bitPosition);
|
||||
else
|
||||
pVal[whichWord(bitPosition)] |= maskBit(bitPosition);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// Set the given bit to 0 whose position is given as "bitPosition".
|
||||
/// @brief Set a given bit to 0.
|
||||
APInt& APInt::clear(unsigned bitPosition) {
|
||||
void APInt::clear(unsigned bitPosition) {
|
||||
if (isSingleWord())
|
||||
VAL &= ~maskBit(bitPosition);
|
||||
else
|
||||
pVal[whichWord(bitPosition)] &= ~maskBit(bitPosition);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// @brief Toggle every bit to its opposite value.
|
||||
@@ -607,11 +605,10 @@ APInt& APInt::clear(unsigned bitPosition) {
|
||||
/// Toggle a given bit to its opposite value whose position is given
|
||||
/// as "bitPosition".
|
||||
/// @brief Toggles a given bit to its opposite value.
|
||||
APInt& APInt::flip(unsigned bitPosition) {
|
||||
void APInt::flip(unsigned bitPosition) {
|
||||
assert(bitPosition < BitWidth && "Out of the bit-width range!");
|
||||
if ((*this)[bitPosition]) clear(bitPosition);
|
||||
else set(bitPosition);
|
||||
return *this;
|
||||
}
|
||||
|
||||
unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) {
|
||||
|
||||
Reference in New Issue
Block a user