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 /include/llvm/ADT/APInt.h | |
parent | a18988518869a84cb4d6510e265b1fb1a52268d1 (diff) | |
download | external_llvm-69ccf9fc0b131f2c71c3d60791425cbf52392ee4.zip external_llvm-69ccf9fc0b131f2c71c3d60791425cbf52392ee4.tar.gz external_llvm-69ccf9fc0b131f2c71c3d60791425cbf52392ee4.tar.bz2 |
Move APInt::operator[] inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/APInt.h')
-rw-r--r-- | include/llvm/ADT/APInt.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index d8ed222..4101989 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 |