llvm.org GIT mirror llvm / 072e99e
Fix a bug in getMaxValue/getMinValue to pass the right signedness the the constructed APSInt, patch suggested by Ben Laurie! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63362 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
235235
236236 /// getMaxValue - Return the APSInt representing the maximum integer value
237237 /// with the given bit width and signedness.
238 static APSInt getMaxValue(uint32_t numBits, bool Signed) {
239 return APSInt(Signed ? APInt::getSignedMaxValue(numBits)
240 : APInt::getMaxValue(numBits), Signed);
238 static APSInt getMaxValue(uint32_t numBits, bool Unsigned) {
239 return APSInt(Unsigned ? APInt::getMaxValue(numBits)
240 : APInt::getSignedMaxValue(numBits), Unsigned);
241241 }
242242
243243 /// getMinValue - Return the APSInt representing the minimum integer value
244244 /// with the given bit width and signedness.
245 static APSInt getMinValue(uint32_t numBits, bool Signed) {
246 return APSInt(Signed ? APInt::getSignedMinValue(numBits)
247 : APInt::getMinValue(numBits), Signed);
245 static APSInt getMinValue(uint32_t numBits, bool Unsigned) {
246 return APSInt(Unsigned ? APInt::getMinValue(numBits)
247 : APInt::getSignedMinValue(numBits), Unsigned);
248248 }
249249
250250 /// Profile - Used to insert APSInt objects, or objects that contain APSInt