llvm.org GIT mirror llvm / ed87180
Added static methods to APSInt: getMinValue and getMaxValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56355 91177308-0d34-0410-b5e6-96231b3b80d8 Ted Kremenek 12 years ago
1 changed file(s) with 14 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
233233 return APSInt(~static_cast(*this), IsUnsigned);
234234 }
235235
236 /// getMaxValue - Return the APSInt representing the maximum integer value
237 /// 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);
241 }
242
243 /// getMinValue - Return the APSInt representing the minimum integer value
244 /// 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);
248 }
249
236250 /// Profile - Used to insert APSInt objects, or objects that contain APSInt
237251 /// objects, into FoldingSets.
238252 void Profile(FoldingSetNodeID& ID) const;