aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/APInt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index d7a604c416..80221f2880 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -697,7 +697,7 @@ public:
/// @returns the floor log base 2 of this APInt.
inline uint32_t logBase2() const {
- return getNumWords() * APINT_BITS_PER_WORD - 1 - countLeadingZeros();
+ return BitWidth - 1 - countLeadingZeros();
}
/// @brief Converts this APInt to a double value.