Skip to content
Snippets Groups Projects
Commit ed871805 authored by Ted Kremenek's avatar Ted Kremenek
Browse files

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
parent 20580a1c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment