Skip to content

Commit 3ffde4a

Browse files
authored
[APInt] Removed redundant assert and condition in APInt::SetBits (#138038)
During [pull request](#137098) it was suggested that I remove these redundant parts of APInt::SetBits.
1 parent 39f5a42 commit 3ffde4a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/include/llvm/ADT/APInt.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,11 +1366,10 @@ class [[nodiscard]] APInt {
13661366
/// This function handles case when \p loBit <= \p hiBit.
13671367
void setBits(unsigned loBit, unsigned hiBit) {
13681368
assert(hiBit <= BitWidth && "hiBit out of range");
1369-
assert(loBit <= BitWidth && "loBit out of range");
13701369
assert(loBit <= hiBit && "loBit greater than hiBit");
13711370
if (loBit == hiBit)
13721371
return;
1373-
if (loBit < APINT_BITS_PER_WORD && hiBit <= APINT_BITS_PER_WORD) {
1372+
if (hiBit <= APINT_BITS_PER_WORD) {
13741373
uint64_t mask = WORDTYPE_MAX >> (APINT_BITS_PER_WORD - (hiBit - loBit));
13751374
mask <<= loBit;
13761375
if (isSingleWord())

0 commit comments

Comments
 (0)