projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6a15eb
)
We want the number of bits needed, not the power of 2.
author
Reid Spencer
<rspencer@reidspencer.com>
Sat, 14 Apr 2007 00:00:10 +0000
(
00:00
+0000)
committer
Reid Spencer
<rspencer@reidspencer.com>
Sat, 14 Apr 2007 00:00:10 +0000
(
00:00
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35977
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/APInt.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/APInt.cpp
b/lib/Support/APInt.cpp
index a35b116b42e4316da3a19d3f680148b2066317cf..d7933fc5a387cdeed2167c2e5979440d79a03514 100644
(file)
--- 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 {