Move APInt::operator[] inline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152692 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2012-03-14 00:38:15 +00:00
parent a189885188
commit 69ccf9fc0b
2 changed files with 5 additions and 7 deletions

View File

@ -842,7 +842,11 @@ public:
/// @returns the bit value at bitPosition /// @returns the bit value at bitPosition
/// @brief Array-indexing support. /// @brief Array-indexing support.
bool operator[](unsigned bitPosition) const; bool operator[](unsigned bitPosition) const {
assert(bitPosition < getBitWidth() && "Bit position out of bounds!");
return (maskBit(bitPosition) &
(isSingleWord() ? VAL : pVal[whichWord(bitPosition)])) != 0;
}
/// @} /// @}
/// @name Comparison Operators /// @name Comparison Operators

View File

@ -484,12 +484,6 @@ APInt APInt::operator-(const APInt& RHS) const {
return Result.clearUnusedBits(); return Result.clearUnusedBits();
} }
bool APInt::operator[](unsigned bitPosition) const {
assert(bitPosition < getBitWidth() && "Bit position out of bounds!");
return (maskBit(bitPosition) &
(isSingleWord() ? VAL : pVal[whichWord(bitPosition)])) != 0;
}
bool APInt::EqualSlowCase(const APInt& RHS) const { bool APInt::EqualSlowCase(const APInt& RHS) const {
// Get some facts about the number of bits used in the two operands. // Get some facts about the number of bits used in the two operands.
unsigned n1 = getActiveBits(); unsigned n1 = getActiveBits();