aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Support/APInt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 87edf74e..fe22e9b 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -496,14 +496,14 @@ uint64_t APInt::extractBitsAsZExtValue(unsigned numBits,
if (isSingleWord())
return (U.VAL >> bitPosition) & maskBits;
+ static_assert(APINT_BITS_PER_WORD >= 64,
+ "This code assumes only two words affected");
unsigned loBit = whichBit(bitPosition);
unsigned loWord = whichWord(bitPosition);
unsigned hiWord = whichWord(bitPosition + numBits - 1);
if (loWord == hiWord)
return (U.pVal[loWord] >> loBit) & maskBits;
- static_assert(APINT_BITS_PER_WORD <= 64,
- "This code assumes only two words affected");
uint64_t retBits = U.pVal[loWord] >> loBit;
retBits |= U.pVal[hiWord] << (APINT_BITS_PER_WORD - loBit);
retBits &= maskBits;