diff options
author | Craig Topper <craig.topper@gmail.com> | 2013-03-15 06:01:42 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2013-03-15 06:01:42 +0000 |
commit | d455d4f4576059606823920150e0fc89a73412e1 (patch) | |
tree | 60f3e9d86e1301cf3329cf2ec67a492ae2a6c5c1 /include/llvm/ADT | |
parent | 7a86ffb19fd9e74960690cb41caae390832d3b5a (diff) | |
download | llvm-d455d4f4576059606823920150e0fc89a73412e1.tar.gz llvm-d455d4f4576059606823920150e0fc89a73412e1.tar.bz2 llvm-d455d4f4576059606823920150e0fc89a73412e1.tar.xz |
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
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r-- | include/llvm/ADT/SmallBitVector.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/llvm/ADT/SmallBitVector.h b/include/llvm/ADT/SmallBitVector.h index 62620fa267..652492a153 100644 --- a/include/llvm/ADT/SmallBitVector.h +++ b/include/llvm/ADT/SmallBitVector.h @@ -178,9 +178,9 @@ public: unsigned count() const { if (isSmall()) { uintptr_t Bits = getSmallBits(); - if (sizeof(uintptr_t) * CHAR_BIT == 32) + if (NumBaseBits == 32) return CountPopulation_32(Bits); - if (sizeof(uintptr_t) * CHAR_BIT == 64) + if (NumBaseBits == 64) return CountPopulation_64(Bits); llvm_unreachable("Unsupported!"); } @@ -215,9 +215,9 @@ public: uintptr_t Bits = getSmallBits(); if (Bits == 0) return -1; - if (sizeof(uintptr_t) * CHAR_BIT == 32) + if (NumBaseBits == 32) return CountTrailingZeros_32(Bits); - if (sizeof(uintptr_t) * CHAR_BIT == 64) + if (NumBaseBits == 64) return CountTrailingZeros_64(Bits); llvm_unreachable("Unsupported!"); } @@ -233,9 +233,9 @@ public: Bits &= ~uintptr_t(0) << (Prev + 1); if (Bits == 0 || Prev + 1 >= getSmallSize()) return -1; - if (sizeof(uintptr_t) * CHAR_BIT == 32) + if (NumBaseBits == 32) return CountTrailingZeros_32(Bits); - if (sizeof(uintptr_t) * CHAR_BIT == 64) + if (NumBaseBits == 64) return CountTrailingZeros_64(Bits); llvm_unreachable("Unsupported!"); } |