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:
Jay Foad
2010-11-30 09:02:01 +00:00
parent d872f144e2
commit a99793c5ea
4 changed files with 39 additions and 33 deletions
+3 -6
View File
@@ -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) {