Skip to content

Commit 7f1f3af

Browse files
committed
[APInt] Use APINT_BITS_PER_WORD instead of recomputing it. NFC
1 parent e8f312d commit 7f1f3af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Support/APInt.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,10 @@ uint64_t APInt::extractBitsAsZExtValue(unsigned numBits,
502502
if (loWord == hiWord)
503503
return (U.pVal[loWord] >> loBit) & maskBits;
504504

505-
static_assert(8 * sizeof(WordType) <= 64, "This code assumes only two words affected");
506-
unsigned wordBits = 8 * sizeof(WordType);
505+
static_assert(APINT_BITS_PER_WORD <= 64,
506+
"This code assumes only two words affected");
507507
uint64_t retBits = U.pVal[loWord] >> loBit;
508-
retBits |= U.pVal[hiWord] << (wordBits - loBit);
508+
retBits |= U.pVal[hiWord] << (APINT_BITS_PER_WORD - loBit);
509509
retBits &= maskBits;
510510
return retBits;
511511
}

0 commit comments

Comments
 (0)