[APInt] Move the setBit and clearBit methods inline.

This makes setBit/clearBit more consistent with setBits which is already inlined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2017-05-02 05:49:40 +00:00
parent afb34f6072
commit 382616f0dc
2 changed files with 16 additions and 18 deletions
-16
View File
@@ -392,13 +392,6 @@ int APInt::compareSigned(const APInt& RHS) const {
return tcCompare(pVal, RHS.pVal, getNumWords());
}
void APInt::setBit(unsigned bitPosition) {
if (isSingleWord())
VAL |= maskBit(bitPosition);
else
pVal[whichWord(bitPosition)] |= maskBit(bitPosition);
}
void APInt::setBitsSlowCase(unsigned loBit, unsigned hiBit) {
unsigned loWord = whichWord(loBit);
unsigned hiWord = whichWord(hiBit);
@@ -426,15 +419,6 @@ void APInt::setBitsSlowCase(unsigned loBit, unsigned hiBit) {
pVal[word] = WORD_MAX;
}
/// Set the given bit to 0 whose position is given as "bitPosition".
/// @brief Set a given bit to 0.
void APInt::clearBit(unsigned bitPosition) {
if (isSingleWord())
VAL &= ~maskBit(bitPosition);
else
pVal[whichWord(bitPosition)] &= ~maskBit(bitPosition);
}
/// @brief Toggle every bit to its opposite value.
void APInt::flipAllBitsSlowCase() {
tcComplement(pVal, getNumWords());