forked from OSchip/llvm-project
[APSInt][NFC] Clean up doxygen comments
Add a Doxygen class comment and clean up other Doxygen comments in this file while we're at it.
This commit is contained in:
parent
ff8a1cae18
commit
3e8d1e8b12
|
@ -18,6 +18,7 @@
|
|||
|
||||
namespace llvm {
|
||||
|
||||
/// An arbitrary precision integer that knows its signedness.
|
||||
class LLVM_NODISCARD APSInt : public APInt {
|
||||
bool IsUnsigned;
|
||||
|
||||
|
@ -25,8 +26,7 @@ public:
|
|||
/// Default constructor that creates an uninitialized APInt.
|
||||
explicit APSInt() : IsUnsigned(false) {}
|
||||
|
||||
/// APSInt ctor - Create an APSInt with the specified width, default to
|
||||
/// unsigned.
|
||||
/// Create an APSInt with the specified width, default to unsigned.
|
||||
explicit APSInt(uint32_t BitWidth, bool isUnsigned = true)
|
||||
: APInt(BitWidth, 0), IsUnsigned(isUnsigned) {}
|
||||
|
||||
|
@ -78,11 +78,11 @@ public:
|
|||
void setIsUnsigned(bool Val) { IsUnsigned = Val; }
|
||||
void setIsSigned(bool Val) { IsUnsigned = !Val; }
|
||||
|
||||
/// toString - Append this APSInt to the specified SmallString.
|
||||
/// Append this APSInt to the specified SmallString.
|
||||
void toString(SmallVectorImpl<char> &Str, unsigned Radix = 10) const {
|
||||
APInt::toString(Str, Radix, isSigned());
|
||||
}
|
||||
/// toString - Converts an APInt to a std::string. This is an inefficient
|
||||
/// Converts an APInt to a std::string. This is an inefficient
|
||||
/// method; you should prefer passing in a SmallString instead.
|
||||
std::string toString(unsigned Radix) const {
|
||||
return APInt::toString(Radix, isSigned());
|
||||
|
@ -282,15 +282,15 @@ 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.
|
||||
/// Return the APSInt representing the maximum integer value with the given
|
||||
/// bit width and signedness.
|
||||
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.
|
||||
/// Return the APSInt representing the minimum integer value with the given
|
||||
/// bit width and signedness.
|
||||
static APSInt getMinValue(uint32_t numBits, bool Unsigned) {
|
||||
return APSInt(Unsigned ? APInt::getMinValue(numBits)
|
||||
: APInt::getSignedMinValue(numBits), Unsigned);
|
||||
|
@ -331,8 +331,8 @@ public:
|
|||
static APSInt get(int64_t X) { return APSInt(APInt(64, X), false); }
|
||||
static APSInt getUnsigned(uint64_t X) { return APSInt(APInt(64, X), true); }
|
||||
|
||||
/// Profile - Used to insert APSInt objects, or objects that contain APSInt
|
||||
/// objects, into FoldingSets.
|
||||
/// Used to insert APSInt objects, or objects that contain APSInt objects,
|
||||
/// into FoldingSets.
|
||||
void Profile(FoldingSetNodeID& ID) const;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue