Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit d455d4f

Browse files
committed
Use NumBaseBits in a few more places in SmallBitVector instead of recalculating it. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177142 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 7a86ffb commit d455d4f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/llvm/ADT/SmallBitVector.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ class SmallBitVector {
178178
unsigned count() const {
179179
if (isSmall()) {
180180
uintptr_t Bits = getSmallBits();
181-
if (sizeof(uintptr_t) * CHAR_BIT == 32)
181+
if (NumBaseBits == 32)
182182
return CountPopulation_32(Bits);
183-
if (sizeof(uintptr_t) * CHAR_BIT == 64)
183+
if (NumBaseBits == 64)
184184
return CountPopulation_64(Bits);
185185
llvm_unreachable("Unsupported!");
186186
}
@@ -215,9 +215,9 @@ class SmallBitVector {
215215
uintptr_t Bits = getSmallBits();
216216
if (Bits == 0)
217217
return -1;
218-
if (sizeof(uintptr_t) * CHAR_BIT == 32)
218+
if (NumBaseBits == 32)
219219
return CountTrailingZeros_32(Bits);
220-
if (sizeof(uintptr_t) * CHAR_BIT == 64)
220+
if (NumBaseBits == 64)
221221
return CountTrailingZeros_64(Bits);
222222
llvm_unreachable("Unsupported!");
223223
}
@@ -233,9 +233,9 @@ class SmallBitVector {
233233
Bits &= ~uintptr_t(0) << (Prev + 1);
234234
if (Bits == 0 || Prev + 1 >= getSmallSize())
235235
return -1;
236-
if (sizeof(uintptr_t) * CHAR_BIT == 32)
236+
if (NumBaseBits == 32)
237237
return CountTrailingZeros_32(Bits);
238-
if (sizeof(uintptr_t) * CHAR_BIT == 64)
238+
if (NumBaseBits == 64)
239239
return CountTrailingZeros_64(Bits);
240240
llvm_unreachable("Unsupported!");
241241
}

0 commit comments

Comments
 (0)