mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
20580a1cf6
commit
ed871805f7
@ -234,6 +234,20 @@ public:
|
||||
return APSInt(~static_cast<const APInt&>(*this), IsUnsigned);
|
||||
}
|
||||
|
||||
/// 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);
|
||||
}
|
||||
|
||||
/// 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);
|
||||
}
|
||||
|
||||
/// Profile - Used to insert APSInt objects, or objects that contain APSInt
|
||||
/// objects, into FoldingSets.
|
||||
void Profile(FoldingSetNodeID& ID) const;
|
||||
|
Loading…
Reference in New Issue
Block a user