[llvm-commits] [llvm] r41566 - /llvm/trunk/include/llvm/ADT/APInt.h
Chris Lattner
sabre at nondot.org
Wed Aug 29 09:21:19 PDT 2007
Author: lattner
Date: Wed Aug 29 11:21:18 2007
New Revision: 41566
URL: http://llvm.org/viewvc/llvm-project?rev=41566&view=rev
Log:
getMinSignedBits needs to take into consider the sign bit when the value is positive.
Modified:
llvm/trunk/include/llvm/ADT/APInt.h
Modified: llvm/trunk/include/llvm/ADT/APInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=41566&r1=41565&r2=41566&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/APInt.h (original)
+++ llvm/trunk/include/llvm/ADT/APInt.h Wed Aug 29 11:21:18 2007
@@ -856,7 +856,7 @@
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
More information about the llvm-commits
mailing list