[llvm-commits] [llvm] r63362 - /llvm/trunk/include/llvm/ADT/APSInt.h

Chris Lattner sabre at nondot.org
Thu Jan 29 17:58:19 PST 2009


Author: lattner
Date: Thu Jan 29 19:58:19 2009
New Revision: 63362

URL: http://llvm.org/viewvc/llvm-project?rev=63362&view=rev
Log:
Fix a bug in getMaxValue/getMinValue to pass the right signedness the
the constructed APSInt, patch suggested by Ben Laurie!

Modified:
    llvm/trunk/include/llvm/ADT/APSInt.h

Modified: llvm/trunk/include/llvm/ADT/APSInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APSInt.h?rev=63362&r1=63361&r2=63362&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/APSInt.h (original)
+++ llvm/trunk/include/llvm/ADT/APSInt.h Thu Jan 29 19:58:19 2009
@@ -236,16 +236,16 @@
 
   /// getMaxValue - Return the APSInt representing the maximum integer value
   ///  with the given bit width and signedness.
-  static APSInt getMaxValue(uint32_t numBits, bool Signed) {
-    return APSInt(Signed ? APInt::getSignedMaxValue(numBits)
-                         : APInt::getMaxValue(numBits), Signed);
+  static APSInt getMaxValue(uint32_t numBits, bool Unsigned) {
+    return APSInt(Unsigned ? APInt::getMaxValue(numBits)
+                           : APInt::getSignedMaxValue(numBits), Unsigned);
   }
 
   /// getMinValue - Return the APSInt representing the minimum integer value
   ///  with the given bit width and signedness.
-  static APSInt getMinValue(uint32_t numBits, bool Signed) {
-    return APSInt(Signed ? APInt::getSignedMinValue(numBits)
-                         : APInt::getMinValue(numBits), Signed);
+  static APSInt getMinValue(uint32_t numBits, bool Unsigned) {
+    return APSInt(Unsigned ? APInt::getMinValue(numBits)
+                           : APInt::getSignedMinValue(numBits), Unsigned);
   }
 
   /// Profile - Used to insert APSInt objects, or objects that contain APSInt





More information about the llvm-commits mailing list