[llvm] r303236 - [APInt] Use getWord to shorten some code. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 23:45:30 PDT 2017
Author: ctopper
Date: Wed May 17 01:45:30 2017
New Revision: 303236
URL: http://llvm.org/viewvc/llvm-project?rev=303236&view=rev
Log:
[APInt] Use getWord to shorten some code. NFC
Modified:
llvm/trunk/include/llvm/ADT/APInt.h
Modified: llvm/trunk/include/llvm/ADT/APInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=303236&r1=303235&r2=303236&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/APInt.h (original)
+++ llvm/trunk/include/llvm/ADT/APInt.h Wed May 17 01:45:30 2017
@@ -1067,9 +1067,7 @@ public:
/// \returns the bit value at bitPosition
bool operator[](unsigned bitPosition) const {
assert(bitPosition < getBitWidth() && "Bit position out of bounds!");
- return (maskBit(bitPosition) &
- (isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)])) !=
- 0;
+ return (maskBit(bitPosition) & getWord(bitPosition)) != 0;
}
/// @}
More information about the llvm-commits
mailing list