summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/APInt.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-29 16:21:18 +0000
committerChris Lattner <sabre@nondot.org>2007-08-29 16:21:18 +0000
commitcd3c4cac6ea3ce3bff0ce763d45c3f7a2d673178 (patch)
tree0066ac0b1612e6ab9c3c416320a214b63f14f59a /include/llvm/ADT/APInt.h
parentd80fb8b3660f78706b99602eb1f1c34d56ba11af (diff)
downloadllvm-cd3c4cac6ea3ce3bff0ce763d45c3f7a2d673178.tar.gz
llvm-cd3c4cac6ea3ce3bff0ce763d45c3f7a2d673178.tar.bz2
llvm-cd3c4cac6ea3ce3bff0ce763d45c3f7a2d673178.tar.xz
getMinSignedBits needs to take into consider the sign bit when the value is positive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41566 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/APInt.h')
-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 0102d67e07..9a5643bfc5 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -856,7 +856,7 @@ public:
inline uint32_t getMinSignedBits() const {
if (isNegative())
return BitWidth - countLeadingOnes() + 1;
- return getActiveBits();
+ return getActiveBits()+1;
}
/// This method attempts to return the value of this APInt as a zero extended