From c6af2432c802d241c8fffbe0371c023e6c58844e Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Fri, 24 May 2013 22:23:49 +0000 Subject: Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182680 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/APInt.h | 12 ++++++------ include/llvm/ADT/BitVector.h | 12 ++++++------ include/llvm/ADT/SmallBitVector.h | 8 ++++---- include/llvm/ADT/SparseBitVector.h | 12 ++++++------ 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'include/llvm/ADT') diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index 6f9450b8b0..a7fc207bb7 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -1399,18 +1399,18 @@ public: /// equivalent of the string given by \p str. static unsigned getBitsNeeded(StringRef str, uint8_t radix); - /// \brief Count the number of zeros from the msb to the first one bit. + /// \brief The APInt version of the countLeadingZeros functions in + /// MathExtras.h. /// - /// This function is an APInt version of the countLeadingZeros_{32,64} - /// functions in MathExtras.h. It counts the number of zeros from the most - /// significant bit to the first one bit. + /// It counts the number of zeros from the most significant bit to the first + /// one bit. /// /// \returns BitWidth if the value is zero, otherwise returns the number of - /// zeros from the most significant bit to the first one bits. + /// zeros from the most significant bit to the first one bits. unsigned countLeadingZeros() const { if (isSingleWord()) { unsigned unusedBits = APINT_BITS_PER_WORD - BitWidth; - return CountLeadingZeros_64(VAL) - unusedBits; + return llvm::countLeadingZeros(VAL) - unusedBits; } return countLeadingZerosSlowCase(); } diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index 82cfdf437d..3789db4e45 100644 --- a/include/llvm/ADT/BitVector.h +++ b/include/llvm/ADT/BitVector.h @@ -153,9 +153,9 @@ public: for (unsigned i = 0; i < NumBitWords(size()); ++i) if (Bits[i] != 0) { if (sizeof(BitWord) == 4) - return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]); + return i * BITWORD_SIZE + countTrailingZeros((uint32_t)Bits[i]); if (sizeof(BitWord) == 8) - return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]); + return i * BITWORD_SIZE + countTrailingZeros(Bits[i]); llvm_unreachable("Unsupported!"); } return -1; @@ -176,9 +176,9 @@ public: if (Copy != 0) { if (sizeof(BitWord) == 4) - return WordPos * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Copy); + return WordPos * BITWORD_SIZE + countTrailingZeros((uint32_t)Copy); if (sizeof(BitWord) == 8) - return WordPos * BITWORD_SIZE + CountTrailingZeros_64(Copy); + return WordPos * BITWORD_SIZE + countTrailingZeros(Copy); llvm_unreachable("Unsupported!"); } @@ -186,9 +186,9 @@ public: for (unsigned i = WordPos+1; i < NumBitWords(size()); ++i) if (Bits[i] != 0) { if (sizeof(BitWord) == 4) - return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]); + return i * BITWORD_SIZE + countTrailingZeros((uint32_t)Bits[i]); if (sizeof(BitWord) == 8) - return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]); + return i * BITWORD_SIZE + countTrailingZeros(Bits[i]); llvm_unreachable("Unsupported!"); } return -1; diff --git a/include/llvm/ADT/SmallBitVector.h b/include/llvm/ADT/SmallBitVector.h index 652492a153..fe9bef96e3 100644 --- a/include/llvm/ADT/SmallBitVector.h +++ b/include/llvm/ADT/SmallBitVector.h @@ -216,9 +216,9 @@ public: if (Bits == 0) return -1; if (NumBaseBits == 32) - return CountTrailingZeros_32(Bits); + return countTrailingZeros(Bits); if (NumBaseBits == 64) - return CountTrailingZeros_64(Bits); + return countTrailingZeros(Bits); llvm_unreachable("Unsupported!"); } return getPointer()->find_first(); @@ -234,9 +234,9 @@ public: if (Bits == 0 || Prev + 1 >= getSmallSize()) return -1; if (NumBaseBits == 32) - return CountTrailingZeros_32(Bits); + return countTrailingZeros(Bits); if (NumBaseBits == 64) - return CountTrailingZeros_64(Bits); + return countTrailingZeros(Bits); llvm_unreachable("Unsupported!"); } return getPointer()->find_next(Prev); diff --git a/include/llvm/ADT/SparseBitVector.h b/include/llvm/ADT/SparseBitVector.h index 306e92832f..7a10f85704 100644 --- a/include/llvm/ADT/SparseBitVector.h +++ b/include/llvm/ADT/SparseBitVector.h @@ -137,9 +137,9 @@ public: for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) if (Bits[i] != 0) { if (sizeof(BitWord) == 4) - return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]); + return i * BITWORD_SIZE + countTrailingZeros(Bits[i]); if (sizeof(BitWord) == 8) - return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]); + return i * BITWORD_SIZE + countTrailingZeros(Bits[i]); llvm_unreachable("Unsupported!"); } llvm_unreachable("Illegal empty element"); @@ -162,9 +162,9 @@ public: if (Copy != 0) { if (sizeof(BitWord) == 4) - return WordPos * BITWORD_SIZE + CountTrailingZeros_32(Copy); + return WordPos * BITWORD_SIZE + countTrailingZeros(Copy); if (sizeof(BitWord) == 8) - return WordPos * BITWORD_SIZE + CountTrailingZeros_64(Copy); + return WordPos * BITWORD_SIZE + countTrailingZeros(Copy); llvm_unreachable("Unsupported!"); } @@ -172,9 +172,9 @@ public: for (unsigned i = WordPos+1; i < BITWORDS_PER_ELEMENT; ++i) if (Bits[i] != 0) { if (sizeof(BitWord) == 4) - return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]); + return i * BITWORD_SIZE + countTrailingZeros(Bits[i]); if (sizeof(BitWord) == 8) - return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]); + return i * BITWORD_SIZE + countTrailingZeros(Bits[i]); llvm_unreachable("Unsupported!"); } return -1; -- cgit v1.2.3