diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-14 00:38:15 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-14 00:38:15 +0000 |
commit | 69ccf9fc0b131f2c71c3d60791425cbf52392ee4 (patch) | |
tree | fed6ef05b8a05f548691acbd1480851d92fde85b | |
parent | a18988518869a84cb4d6510e265b1fb1a52268d1 (diff) |
Move APInt::operator[] inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152692 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/APInt.h | 6 | ||||
-rw-r--r-- | lib/Support/APInt.cpp | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index d8ed222498..4101989976 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -842,7 +842,11 @@ public: /// @returns the bit value at bitPosition /// @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 diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index c5713a0eb1..9b81fe776a 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -484,12 +484,6 @@ APInt APInt::operator-(const APInt& RHS) const { 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 { // Get some facts about the number of bits used in the two operands. unsigned n1 = getActiveBits(); |