class APSInt
Declaration
class APSInt : public APInt { /* full declaration omitted */ };
Description
An arbitrary precision integer that knows its signedness.
Declared at: llvm/include/llvm/ADT/APSInt.h:23
Inherits from: APInt
Member Variables
- private bool IsUnsigned = false
Inherited from APInt:
- public static WORDTYPE_MAX = ~unsigned long(0)
Method Overview
- public APSInt(uint32_t BitWidth, bool isUnsigned = true)
- public APSInt(llvm::APInt I, bool isUnsigned = true)
- public APSInt(llvm::StringRef Str)
- public APSInt()
- public void Profile(llvm::FoldingSetNodeID & ID) const
- public static int compareValues(const llvm::APSInt & I1, const llvm::APSInt & I2)
- public llvm::APSInt extOrTrunc(uint32_t width) const
- public llvm::APSInt extend(uint32_t width) const
- public static llvm::APSInt get(int64_t X)
- public int64_t getExtValue() const
- public static llvm::APSInt getMaxValue(uint32_t numBits, bool Unsigned)
- public static llvm::APSInt getMinValue(uint32_t numBits, bool Unsigned)
- public static llvm::APSInt getUnsigned(uint64_t X)
- public bool isNegative() const
- public bool isNonNegative() const
- public static bool isSameValue(const llvm::APSInt & I1, const llvm::APSInt & I2)
- public bool isSigned() const
- public bool isStrictlyPositive() const
- public bool isUnsigned() const
- public void setIsSigned(bool Val)
- public void setIsUnsigned(bool Val)
- public void toString(SmallVectorImpl<char> & Str, unsigned int Radix = 10) const
- public llvm::APSInt trunc(uint32_t width) const
Inherited from APInt:
- public Profile
- public abs
- public ashr
- public ashr
- public ashrInPlace
- public ashrInPlace
- public bitsToDouble
- public bitsToFloat
- public byteSwap
- public ceilLogBase2
- public clearAllBits
- public clearBit
- public clearLowBits
- public clearSignBit
- public concat
- public countLeadingOnes
- public countLeadingZeros
- public countPopulation
- public countTrailingOnes
- public countTrailingZeros
- public doubleToBits
- public dump
- public eq
- public exactLogBase2
- public extractBits
- public extractBitsAsZExtValue
- public flipAllBits
- public flipBit
- public floatToBits
- public getActiveBits
- public getActiveWords
- public getAllOnes
- public getAllOnesValue
- public getBitWidth
- public getBitsNeeded
- public getBitsSet
- public getBitsSetFrom
- public getBitsSetWithWrap
- public getBoolValue
- public getHiBits
- public getHighBitsSet
- public getLimitedValue
- public getLoBits
- public getLowBitsSet
- public getMaxValue
- public getMinSignedBits
- public getMinValue
- public getNullValue
- public getNumSignBits
- public getNumWords
- public getNumWords
- public getOneBitSet
- public getRawData
- public getSExtValue
- public getSignMask
- public getSignedMaxValue
- public getSignedMinValue
- public getSignificantBits
- public getSplat
- public getSufficientBitsNeeded
- public getZExtValue
- public getZero
- public getZeroWidth
- public insertBits
- public insertBits
- public intersects
- public isAllOnes
- public isAllOnesValue
- public isIntN
- public isMask
- public isMask
- public isMaxSignedValue
- public isMaxValue
- public isMinSignedValue
- public isMinValue
- public isNegatedPowerOf2
- public isNegative
- public isNonNegative
- public isNonPositive
- public isNullValue
- public isOne
- public isOneValue
- public isPowerOf2
- public isSameValue
- public isShiftedMask
- public isShiftedMask
- public isSignBitClear
- public isSignBitSet
- public isSignMask
- public isSignedIntN
- public isSingleWord
- public isSplat
- public isStrictlyPositive
- public isSubsetOf
- public isZero
- public logBase2
- public lshr
- public lshr
- public lshrInPlace
- public lshrInPlace
- public multiplicativeInverse
- public ne
- public nearestLogBase2
- public needsCleanup
- public negate
- public print
- public reverseBits
- public rotl
- public rotl
- public rotr
- public rotr
- public roundToDouble
- public roundToDouble
- public sadd_ov
- public sadd_sat
- public sdiv
- public sdiv
- public sdiv_ov
- public sdivrem
- public sdivrem
- public setAllBits
- public setBit
- public setBitVal
- public setBits
- public setBitsFrom
- public setBitsWithWrap
- public setHighBits
- public setLowBits
- public setSignBit
- public sext
- public sextOrTrunc
- public sge
- public sge
- public sgt
- public sgt
- public shl
- public shl
- public signedRoundToDouble
- public sle
- public sle
- public slt
- public slt
- public smul_ov
- public smul_sat
- public sqrt
- public srem
- public srem
- public sshl_ov
- public sshl_sat
- public ssub_ov
- public ssub_sat
- public tcAdd
- public tcAddPart
- public tcAssign
- public tcClearBit
- public tcCompare
- public tcDecrement
- public tcDivide
- public tcExtract
- public tcExtractBit
- public tcFullMultiply
- public tcIncrement
- public tcIsZero
- public tcLSB
- public tcMSB
- public tcMultiply
- public tcMultiplyPart
- public tcNegate
- public tcSet
- public tcSetBit
- public tcShiftLeft
- public tcShiftRight
- public tcSubtract
- public tcSubtractPart
- public toString
- public toStringSigned
- public toStringUnsigned
- public trunc
- public truncSSat
- public truncUSat
- public uadd_ov
- public uadd_sat
- public udiv
- public udiv
- public udivrem
- public udivrem
- public uge
- public uge
- public ugt
- public ugt
- public ule
- public ule
- public ult
- public ult
- public umul_ov
- public umul_sat
- public urem
- public urem
- public ushl_ov
- public ushl_sat
- public usub_ov
- public usub_sat
- public zext
- public zextOrTrunc
Methods
¶APSInt(uint32_t BitWidth, bool isUnsigned = true)
APSInt(uint32_t BitWidth, bool isUnsigned = true)
Description
Create an APSInt with the specified width, default to unsigned.
Declared at: llvm/include/llvm/ADT/APSInt.h:31
Parameters
- uint32_t BitWidth
- bool isUnsigned = true
¶APSInt(llvm::APInt I, bool isUnsigned = true)
APSInt(llvm::APInt I, bool isUnsigned = true)
Declared at: llvm/include/llvm/ADT/APSInt.h:34
Parameters
- llvm::APInt I
- bool isUnsigned = true
¶APSInt(llvm::StringRef Str)
APSInt(llvm::StringRef Str)
Description
Construct an APSInt from a string representation. This constructor interprets the string \p Str using the radix of 10. The interpretation stops at the end of the string. The bit width of the constructed APSInt is determined automatically.
Declared at: llvm/include/llvm/ADT/APSInt.h:44
Parameters
- llvm::StringRef Str
- the string to be interpreted.
¶APSInt()
APSInt()
Description
Default constructor that creates an uninitialized APInt.
Declared at: llvm/include/llvm/ADT/APSInt.h:28
¶void Profile(llvm::FoldingSetNodeID& ID) const
void Profile(llvm::FoldingSetNodeID& ID) const
Description
Used to insert APSInt objects, or objects that contain APSInt objects, into FoldingSets.
Declared at: llvm/include/llvm/ADT/APSInt.h:332
Parameters
¶static int compareValues(const llvm::APSInt& I1,
const llvm::APSInt& I2)
static int compareValues(const llvm::APSInt& I1,
const llvm::APSInt& I2)
Description
Compare underlying values of two numbers.
Declared at: llvm/include/llvm/ADT/APSInt.h:302
Parameters
- const llvm::APSInt& I1
- const llvm::APSInt& I2
¶llvm::APSInt extOrTrunc(uint32_t width) const
llvm::APSInt extOrTrunc(uint32_t width) const
Declared at: llvm/include/llvm/ADT/APSInt.h:105
Parameters
- uint32_t width
¶llvm::APSInt extend(uint32_t width) const
llvm::APSInt extend(uint32_t width) const
Declared at: llvm/include/llvm/ADT/APSInt.h:98
Parameters
- uint32_t width
¶static llvm::APSInt get(int64_t X)
static llvm::APSInt get(int64_t X)
Declared at: llvm/include/llvm/ADT/APSInt.h:327
Parameters
- int64_t X
¶int64_t getExtValue() const
int64_t getExtValue() const
Description
Get the correctly-extended \c int64_t value.
Declared at: llvm/include/llvm/ADT/APSInt.h:89
¶static llvm::APSInt getMaxValue(uint32_t numBits,
bool Unsigned)
static llvm::APSInt getMaxValue(uint32_t numBits,
bool Unsigned)
Description
Return the APSInt representing the maximum integer value with the given bit width and signedness.
Declared at: llvm/include/llvm/ADT/APSInt.h:283
Parameters
- uint32_t numBits
- bool Unsigned
¶static llvm::APSInt getMinValue(uint32_t numBits,
bool Unsigned)
static llvm::APSInt getMinValue(uint32_t numBits,
bool Unsigned)
Description
Return the APSInt representing the minimum integer value with the given bit width and signedness.
Declared at: llvm/include/llvm/ADT/APSInt.h:290
Parameters
- uint32_t numBits
- bool Unsigned
¶static llvm::APSInt getUnsigned(uint64_t X)
static llvm::APSInt getUnsigned(uint64_t X)
Declared at: llvm/include/llvm/ADT/APSInt.h:328
Parameters
- uint64_t X
¶bool isNegative() const
bool isNegative() const
Description
Determine sign of this APSInt.
Declared at: llvm/include/llvm/ADT/APSInt.h:49
Returns
true if this APSInt is negative, false otherwise
¶bool isNonNegative() const
bool isNonNegative() const
Description
Determine if this APSInt Value is non-negative (>= 0)
Declared at: llvm/include/llvm/ADT/APSInt.h:54
Returns
true if this APSInt is non-negative, false otherwise
¶static bool isSameValue(const llvm::APSInt& I1,
const llvm::APSInt& I2)
static bool isSameValue(const llvm::APSInt& I1,
const llvm::APSInt& I2)
Description
Determine if two APSInts have the same value, zero- or sign-extending as needed.
Declared at: llvm/include/llvm/ADT/APSInt.h:297
Parameters
- const llvm::APSInt& I1
- const llvm::APSInt& I2
¶bool isSigned() const
bool isSigned() const
Declared at: llvm/include/llvm/ADT/APSInt.h:77
¶bool isStrictlyPositive() const
bool isStrictlyPositive() const
Description
Determine if this APSInt Value is positive. This tests if the value of this APSInt is positive (> 0). Note that 0 is not a positive value.
Declared at: llvm/include/llvm/ADT/APSInt.h:62
Returns
true if this APSInt is positive.
¶bool isUnsigned() const
bool isUnsigned() const
Declared at: llvm/include/llvm/ADT/APSInt.h:78
¶void setIsSigned(bool Val)
void setIsSigned(bool Val)
Declared at: llvm/include/llvm/ADT/APSInt.h:80
Parameters
- bool Val
¶void setIsUnsigned(bool Val)
void setIsUnsigned(bool Val)
Declared at: llvm/include/llvm/ADT/APSInt.h:79
Parameters
- bool Val
¶void toString(SmallVectorImpl<char>& Str,
unsigned int Radix = 10) const
void toString(SmallVectorImpl<char>& Str,
unsigned int Radix = 10) const
Description
Append this APSInt to the specified SmallString.
Declared at: llvm/include/llvm/ADT/APSInt.h:83
Parameters
- SmallVectorImpl<char>& Str
- unsigned int Radix = 10
¶llvm::APSInt trunc(uint32_t width) const
llvm::APSInt trunc(uint32_t width) const
Declared at: llvm/include/llvm/ADT/APSInt.h:94
Parameters
- uint32_t width