Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3ffde4a

Browse filesBrowse 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
Copy full SHA for 3ffde4a

File tree

1 file changed

+1
-2
lines changed
Filter options

1 file changed

+1
-2
lines changed

‎llvm/include/llvm/ADT/APInt.h

Copy file name to clipboardExpand all lines: llvm/include/llvm/ADT/APInt.h
+1-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.