Move APInt::operator[] inline.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 14 Mar 2012 00:38:15 +0000 (00:38 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 14 Mar 2012 00:38:15 +0000 (00:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152692 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/APInt.h
lib/Support/APInt.cpp

index d8ed22249850092e3b0562725e654efc598a98f8..41019899766b0a2827612d45bdf0743cbca350af 100644 (file)
@@ -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
index c5713a0eb17086f4995d961da74b233e6d25dff6..9b81fe776a6111738db3e60aa4a209f7f07414e7 100644 (file)
@@ -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();