diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-04-14 00:00:10 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-04-14 00:00:10 +0000 |
commit | 0468ab302537912264f61066fe8b780e52c7f5ef (patch) | |
tree | 9f5d9d6112318091547e2eacfd016e0391a7c465 /lib/Support/APInt.cpp | |
parent | f6a15eb1a1c5313a3fa9fb466f46a0740e1c0ede (diff) |
We want the number of bits needed, not the power of 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r-- | lib/Support/APInt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index a35b116b42..d7933fc5a3 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -693,7 +693,7 @@ uint32_t APInt::getBitsNeeded(const char* str, uint32_t slen, uint8_t radix) { APInt tmp(sufficient, str, slen, radix); // Compute how many bits are required. - return isNegative + tmp.logBase2(); + return isNegative + tmp.logBase2() + 1; } uint64_t APInt::getHashValue() const { |