From: Benjamin Kramer Date: Wed, 14 Mar 2012 00:38:15 +0000 (+0000) Subject: Move APInt::operator[] inline. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=69ccf9fc0b131f2c71c3d60791425cbf52392ee4;p=oota-llvm.git Move APInt::operator[] inline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152692 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index d8ed2224985..41019899766 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 c5713a0eb17..9b81fe776a6 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();