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
This commit is contained in:
Reid Spencer 2007-04-14 00:00:10 +00:00
parent f6a15eb1a1
commit 0468ab3025

View File

@ -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 {