LLVM  6.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
llvm::APSInt Class Reference

#include "llvm/ADT/APSInt.h"

Inheritance diagram for llvm::APSInt:
Inheritance graph
[legend]
Collaboration diagram for llvm::APSInt:
Collaboration graph
[legend]

Public Member Functions

 APSInt ()
 Default constructor that creates an uninitialized APInt. More...
 
 APSInt (uint32_t BitWidth, bool isUnsigned=true)
 APSInt ctor - Create an APSInt with the specified width, default to unsigned. More...
 
 APSInt (APInt I, bool isUnsigned=true)
 
 APSInt (StringRef Str)
 Construct an APSInt from a string representation. More...
 
APSIntoperator= (APInt RHS)
 
APSIntoperator= (uint64_t RHS)
 
bool isSigned () const
 
bool isUnsigned () const
 
void setIsUnsigned (bool Val)
 
void setIsSigned (bool Val)
 
void toString (SmallVectorImpl< char > &Str, unsigned Radix=10) const
 toString - Append this APSInt to the specified SmallString. More...
 
std::string toString (unsigned Radix) const
 toString - Converts an APInt to a std::string. More...
 
int64_t getExtValue () const
 Get the correctly-extended int64_t value. More...
 
APSInt trunc (uint32_t width) const
 
APSInt extend (uint32_t width) const
 
APSInt extOrTrunc (uint32_t width) const
 
const APSIntoperator%= (const APSInt &RHS)
 
const APSIntoperator/= (const APSInt &RHS)
 
APSInt operator% (const APSInt &RHS) const
 
APSInt operator/ (const APSInt &RHS) const
 
APSInt operator>> (unsigned Amt) const
 
APSIntoperator>>= (unsigned Amt)
 
bool operator< (const APSInt &RHS) const
 
bool operator> (const APSInt &RHS) const
 
bool operator<= (const APSInt &RHS) const
 
bool operator>= (const APSInt &RHS) const
 
bool operator== (const APSInt &RHS) const
 
bool operator!= (const APSInt &RHS) const
 
bool operator== (int64_t RHS) const
 
bool operator!= (int64_t RHS) const
 
bool operator<= (int64_t RHS) const
 
bool operator>= (int64_t RHS) const
 
bool operator< (int64_t RHS) const
 
bool operator> (int64_t RHS) const
 
APSInt operator<< (unsigned Bits) const
 
APSIntoperator<<= (unsigned Amt)
 
APSIntoperator++ ()
 
APSIntoperator-- ()
 
APSInt operator++ (int)
 
APSInt operator-- (int)
 
APSInt operator- () const
 
APSIntoperator+= (const APSInt &RHS)
 
APSIntoperator-= (const APSInt &RHS)
 
APSIntoperator*= (const APSInt &RHS)
 
APSIntoperator &= (const APSInt &RHS)
 
APSIntoperator|= (const APSInt &RHS)
 
APSIntoperator^= (const APSInt &RHS)
 
APSInt operator & (const APSInt &RHS) const
 
APSInt operator| (const APSInt &RHS) const
 
APSInt operator^ (const APSInt &RHS) const
 
APSInt operator* (const APSInt &RHS) const
 
APSInt operator+ (const APSInt &RHS) const
 
APSInt operator- (const APSInt &RHS) const
 
APSInt operator~ () const
 
void Profile (FoldingSetNodeID &ID) const
 Profile - Used to insert APSInt objects, or objects that contain APSInt objects, into FoldingSets. More...
 
- Public Member Functions inherited from llvm::APInt
 APInt (unsigned numBits, uint64_t val, bool isSigned=false)
 Create a new APInt of numBits width, initialized as val. More...
 
 APInt (unsigned numBits, ArrayRef< uint64_t > bigVal)
 Construct an APInt of numBits width, initialized as bigVal[]. More...
 
 APInt (unsigned numBits, unsigned numWords, const uint64_t bigVal[])
 Equivalent to APInt(numBits, ArrayRef<uint64_t>(bigVal, numWords)), but deprecated because this constructor is prone to ambiguity with the APInt(unsigned, uint64_t, bool) constructor. More...
 
 APInt (unsigned numBits, StringRef str, uint8_t radix)
 Construct an APInt from a string representation. More...
 
 APInt (const APInt &that)
 Simply makes *this a copy of that. More...
 
 APInt (APInt &&that)
 Move Constructor. More...
 
 ~APInt ()
 Destructor. More...
 
 APInt ()
 Default constructor that creates an uninteresting APInt representing a 1-bit zero value. More...
 
bool needsCleanup () const
 Returns whether this instance allocated memory. More...
 
void Profile (FoldingSetNodeID &id) const
 Used to insert APInt objects, or objects that contain APInt objects, into FoldingSets. More...
 
bool isNegative () const
 Determine sign of this APInt. More...
 
bool isNonNegative () const
 Determine if this APInt Value is non-negative (>= 0) More...
 
bool isSignBitSet () const
 Determine if sign bit of this APInt is set. More...
 
bool isSignBitClear () const
 Determine if sign bit of this APInt is clear. More...
 
bool isStrictlyPositive () const
 Determine if this APInt Value is positive. More...
 
bool isAllOnesValue () const
 Determine if all bits are set. More...
 
bool isNullValue () const
 Determine if all bits are clear. More...
 
bool isOneValue () const
 Determine if this is a value of 1. More...
 
bool isMaxValue () const
 Determine if this is the largest unsigned value. More...
 
bool isMaxSignedValue () const
 Determine if this is the largest signed value. More...
 
bool isMinValue () const
 Determine if this is the smallest unsigned value. More...
 
bool isMinSignedValue () const
 Determine if this is the smallest signed value. More...
 
bool isIntN (unsigned N) const
 Check if this APInt has an N-bits unsigned integer value. More...
 
bool isSignedIntN (unsigned N) const
 Check if this APInt has an N-bits signed integer value. More...
 
bool isPowerOf2 () const
 Check if this APInt's value is a power of two greater than zero. More...
 
bool isSignMask () const
 Check if the APInt's value is returned by getSignMask. More...
 
bool getBoolValue () const
 Convert APInt to a boolean value. More...
 
uint64_t getLimitedValue (uint64_t Limit=UINT64_MAX) const
 If this value is smaller than the specified limit, return it, otherwise return the limit value. More...
 
bool isSplat (unsigned SplatSizeInBits) const
 Check if the APInt consists of a repeated bit pattern. More...
 
bool isMask (unsigned numBits) const
 
bool isMask () const
 
bool isShiftedMask () const
 Return true if this APInt value contains a sequence of ones with the remainder zero. More...
 
const APInt operator++ (int)
 Postfix increment operator. More...
 
APIntoperator++ ()
 Prefix increment operator. More...
 
const APInt operator-- (int)
 Postfix decrement operator. More...
 
APIntoperator-- ()
 Prefix decrement operator. More...
 
bool operator! () const
 Logical negation operator. More...
 
APIntoperator= (const APInt &RHS)
 Copy assignment operator. More...
 
APIntoperator= (APInt &&that)
 Move assignment operator. More...
 
APIntoperator= (uint64_t RHS)
 Assignment operator. More...
 
APIntoperator &= (const APInt &RHS)
 Bitwise AND assignment operator. More...
 
APIntoperator &= (uint64_t RHS)
 Bitwise AND assignment operator. More...
 
APIntoperator|= (const APInt &RHS)
 Bitwise OR assignment operator. More...
 
APIntoperator|= (uint64_t RHS)
 Bitwise OR assignment operator. More...
 
APIntoperator^= (const APInt &RHS)
 Bitwise XOR assignment operator. More...
 
APIntoperator^= (uint64_t RHS)
 Bitwise XOR assignment operator. More...
 
APIntoperator*= (const APInt &RHS)
 Multiplication assignment operator. More...
 
APIntoperator*= (uint64_t RHS)
 
APIntoperator+= (const APInt &RHS)
 Addition assignment operator. More...
 
APIntoperator+= (uint64_t RHS)
 
APIntoperator-= (const APInt &RHS)
 Subtraction assignment operator. More...
 
APIntoperator-= (uint64_t RHS)
 
APIntoperator<<= (unsigned ShiftAmt)
 Left-shift assignment function. More...
 
APIntoperator<<= (const APInt &ShiftAmt)
 Left-shift assignment function. More...
 
bool operator== (const APInt &RHS) const
 Equality operator. More...
 
bool operator== (uint64_t Val) const
 Equality operator. More...
 
bool eq (const APInt &RHS) const
 Equality comparison. More...
 
bool operator!= (const APInt &RHS) const
 Inequality operator. More...
 
bool operator!= (uint64_t Val) const
 Inequality operator. More...
 
bool ne (const APInt &RHS) const
 Inequality comparison. More...
 
bool ult (const APInt &RHS) const
 Unsigned less than comparison. More...
 
bool ult (uint64_t RHS) const
 Unsigned less than comparison. More...
 
bool slt (const APInt &RHS) const
 Signed less than comparison. More...
 
bool slt (int64_t RHS) const
 Signed less than comparison. More...
 
bool ule (const APInt &RHS) const
 Unsigned less or equal comparison. More...
 
bool ule (uint64_t RHS) const
 Unsigned less or equal comparison. More...
 
bool sle (const APInt &RHS) const
 Signed less or equal comparison. More...
 
bool sle (uint64_t RHS) const
 Signed less or equal comparison. More...
 
bool ugt (const APInt &RHS) const
 Unsigned greather than comparison. More...
 
bool ugt (uint64_t RHS) const
 Unsigned greater than comparison. More...
 
bool sgt (const APInt &RHS) const
 Signed greather than comparison. More...
 
bool sgt (int64_t RHS) const
 Signed greater than comparison. More...
 
bool uge (const APInt &RHS) const
 Unsigned greater or equal comparison. More...
 
bool uge (uint64_t RHS) const
 Unsigned greater or equal comparison. More...
 
bool sge (const APInt &RHS) const
 Signed greather or equal comparison. More...
 
bool sge (int64_t RHS) const
 Signed greater or equal comparison. More...
 
bool intersects (const APInt &RHS) const
 This operation tests if there are any pairs of corresponding bits between this APInt and RHS that are both set. More...
 
bool isSubsetOf (const APInt &RHS) const
 This operation checks that all bits set in this APInt are also set in RHS. More...
 
APInt trunc (unsigned width) const
 Truncate to new width. More...
 
APInt sext (unsigned width) const
 Sign extend to a new width. More...
 
APInt zext (unsigned width) const
 Zero extend to a new width. More...
 
APInt sextOrTrunc (unsigned width) const
 Sign extend or truncate to width. More...
 
APInt zextOrTrunc (unsigned width) const
 Zero extend or truncate to width. More...
 
APInt sextOrSelf (unsigned width) const
 Sign extend or truncate to width. More...
 
APInt zextOrSelf (unsigned width) const
 Zero extend or truncate to width. More...
 
void setAllBits ()
 Set every bit to 1. More...
 
void setBit (unsigned BitPosition)
 Set a given bit to 1. More...
 
void setSignBit ()
 Set the sign bit to 1. More...
 
void setBits (unsigned loBit, unsigned hiBit)
 Set the bits from loBit (inclusive) to hiBit (exclusive) to 1. More...
 
void setBitsFrom (unsigned loBit)
 Set the top bits starting from loBit. More...
 
void setLowBits (unsigned loBits)
 Set the bottom loBits bits. More...
 
void setHighBits (unsigned hiBits)
 Set the top hiBits bits. More...
 
void clearAllBits ()
 Set every bit to 0. More...
 
void clearBit (unsigned BitPosition)
 Set a given bit to 0. More...
 
void clearSignBit ()
 Set the sign bit to 0. More...
 
void flipAllBits ()
 Toggle every bit to its opposite value. More...
 
void flipBit (unsigned bitPosition)
 Toggles a given bit to its opposite value. More...
 
void negate ()
 Negate this APInt in place. More...
 
void insertBits (const APInt &SubBits, unsigned bitPosition)
 Insert the bits from a smaller APInt starting at bitPosition. More...
 
APInt extractBits (unsigned numBits, unsigned bitPosition) const
 Return an APInt with the extracted bits [bitPosition,bitPosition+numBits). More...
 
unsigned logBase2 () const
 
unsigned ceilLogBase2 () const
 
unsigned nearestLogBase2 () const
 
int32_t exactLogBase2 () const
 
APInt sqrt () const
 Compute the square root. More...
 
APInt abs () const
 Get the absolute value;. More...
 
APInt multiplicativeInverse (const APInt &modulo) const
 Computes the multiplicative inverse of this APInt for a given modulo. More...
 
ms magic () const
 Calculate the magic numbers required to implement a signed integer division by a constant as a sequence of multiplies, adds and shifts. More...
 
mu magicu (unsigned LeadingZeros=0) const
 Calculate the magic numbers required to implement an unsigned integer division by a constant as a sequence of multiplies, adds and shifts. More...
 
APInt getHiBits (unsigned numBits) const
 Compute an APInt containing numBits highbits from this APInt. More...
 
APInt getLoBits (unsigned numBits) const
 Compute an APInt containing numBits lowbits from this APInt. More...
 
const uint64_t * getRawData () const
 This function returns a pointer to the internal storage of the APInt. More...
 
APInt operator* (const APInt &RHS) const
 Multiplication operator. More...
 
APInt operator<< (unsigned Bits) const
 Left logical shift operator. More...
 
APInt operator<< (const APInt &Bits) const
 Left logical shift operator. More...
 
APInt ashr (unsigned ShiftAmt) const
 Arithmetic right-shift function. More...
 
void ashrInPlace (unsigned ShiftAmt)
 Arithmetic right-shift this APInt by ShiftAmt in place. More...
 
APInt lshr (unsigned shiftAmt) const
 Logical right-shift function. More...
 
void lshrInPlace (unsigned ShiftAmt)
 Logical right-shift this APInt by ShiftAmt in place. More...
 
APInt shl (unsigned shiftAmt) const
 Left-shift function. More...
 
APInt rotl (unsigned rotateAmt) const
 Rotate left by rotateAmt. More...
 
APInt rotr (unsigned rotateAmt) const
 Rotate right by rotateAmt. More...
 
APInt ashr (const APInt &ShiftAmt) const
 Arithmetic right-shift function. More...
 
void ashrInPlace (const APInt &shiftAmt)
 Arithmetic right-shift this APInt by shiftAmt in place. More...
 
APInt lshr (const APInt &ShiftAmt) const
 Logical right-shift function. More...
 
void lshrInPlace (const APInt &ShiftAmt)
 Logical right-shift this APInt by ShiftAmt in place. More...
 
APInt shl (const APInt &ShiftAmt) const
 Left-shift function. More...
 
APInt rotl (const APInt &rotateAmt) const
 Rotate left by rotateAmt. More...
 
APInt rotr (const APInt &rotateAmt) const
 Rotate right by rotateAmt. More...
 
APInt udiv (const APInt &RHS) const
 Unsigned division operation. More...
 
APInt udiv (uint64_t RHS) const
 
APInt sdiv (const APInt &RHS) const
 Signed division function for APInt. More...
 
APInt sdiv (int64_t RHS) const
 
APInt urem (const APInt &RHS) const
 Unsigned remainder operation. More...
 
uint64_t urem (uint64_t RHS) const
 
APInt srem (const APInt &RHS) const
 Function for signed remainder operation. More...
 
int64_t srem (int64_t RHS) const
 
APInt sadd_ov (const APInt &RHS, bool &Overflow) const
 
APInt uadd_ov (const APInt &RHS, bool &Overflow) const
 
APInt ssub_ov (const APInt &RHS, bool &Overflow) const
 
APInt usub_ov (const APInt &RHS, bool &Overflow) const
 
APInt sdiv_ov (const APInt &RHS, bool &Overflow) const
 
APInt smul_ov (const APInt &RHS, bool &Overflow) const
 
APInt umul_ov (const APInt &RHS, bool &Overflow) const
 
APInt sshl_ov (const APInt &Amt, bool &Overflow) const
 
APInt ushl_ov (const APInt &Amt, bool &Overflow) const
 
bool operator[] (unsigned bitPosition) const
 Array-indexing support. More...
 
unsigned getBitWidth () const
 Return the number of bits in the APInt. More...
 
unsigned getNumWords () const
 Get the number of words. More...
 
unsigned getActiveBits () const
 Compute the number of active bits in the value. More...
 
unsigned getActiveWords () const
 Compute the number of active words in the value of this APInt. More...
 
unsigned getMinSignedBits () const
 Get the minimum bit size for this signed APInt. More...
 
uint64_t getZExtValue () const
 Get zero extended value. More...
 
int64_t getSExtValue () const
 Get sign extended value. More...
 
unsigned countLeadingZeros () const
 The APInt version of the countLeadingZeros functions in MathExtras.h. More...
 
unsigned countLeadingOnes () const
 Count the number of leading one bits. More...
 
unsigned getNumSignBits () const
 Computes the number of leading bits of this APInt that are equal to its sign bit. More...
 
unsigned countTrailingZeros () const
 Count the number of trailing zero bits. More...
 
unsigned countTrailingOnes () const
 Count the number of trailing one bits. More...
 
unsigned countPopulation () const
 Count the number of bits set. More...
 
void print (raw_ostream &OS, bool isSigned) const
 
void toString (SmallVectorImpl< char > &Str, unsigned Radix, bool Signed, bool formatAsCLiteral=false) const
 Converts an APInt to a string and append it to Str. More...
 
void toStringUnsigned (SmallVectorImpl< char > &Str, unsigned Radix=10) const
 Considers the APInt to be unsigned and converts it into a string in the radix given. More...
 
void toStringSigned (SmallVectorImpl< char > &Str, unsigned Radix=10) const
 Considers the APInt to be signed and converts it into a string in the radix given. More...
 
std::string toString (unsigned Radix, bool Signed) const
 Return the APInt as a std::string. More...
 
APInt byteSwap () const
 
APInt reverseBits () const
 
double roundToDouble (bool isSigned) const
 Converts this APInt to a double value. More...
 
double roundToDouble () const
 Converts this unsigned APInt to a double value. More...
 
double signedRoundToDouble () const
 Converts this signed APInt to a double value. More...
 
double bitsToDouble () const
 Converts APInt bits to a double. More...
 
float bitsToFloat () const
 Converts APInt bits to a double. More...
 
void dump () const
 debug method More...
 

Static Public Member Functions

static APSInt getMaxValue (uint32_t numBits, bool Unsigned)
 getMaxValue - Return the APSInt representing the maximum integer value with the given bit width and signedness. More...
 
static APSInt getMinValue (uint32_t numBits, bool Unsigned)
 getMinValue - Return the APSInt representing the minimum integer value with the given bit width and signedness. More...
 
static bool isSameValue (const APSInt &I1, const APSInt &I2)
 Determine if two APSInts have the same value, zero- or sign-extending as needed. More...
 
static int compareValues (const APSInt &I1, const APSInt &I2)
 Compare underlying values of two numbers. More...
 
static APSInt get (int64_t X)
 
static APSInt getUnsigned (uint64_t X)
 
- Static Public Member Functions inherited from llvm::APInt
static APInt getMaxValue (unsigned numBits)
 Gets maximum unsigned value of APInt for specific bit width. More...
 
static APInt getSignedMaxValue (unsigned numBits)
 Gets maximum signed value of APInt for a specific bit width. More...
 
static APInt getMinValue (unsigned numBits)
 Gets minimum unsigned value of APInt for a specific bit width. More...
 
static APInt getSignedMinValue (unsigned numBits)
 Gets minimum signed value of APInt for a specific bit width. More...
 
static APInt getSignMask (unsigned BitWidth)
 Get the SignMask for a specific bit width. More...
 
static APInt getAllOnesValue (unsigned numBits)
 Get the all-ones value. More...
 
static APInt getNullValue (unsigned numBits)
 Get the '0' value. More...
 
static APInt getOneBitSet (unsigned numBits, unsigned BitNo)
 Return an APInt with exactly one bit set in the result. More...
 
static APInt getBitsSet (unsigned numBits, unsigned loBit, unsigned hiBit)
 Get a value with a block of bits set. More...
 
static APInt getBitsSetFrom (unsigned numBits, unsigned loBit)
 Get a value with upper bits starting at loBit set. More...
 
static APInt getHighBitsSet (unsigned numBits, unsigned hiBitsSet)
 Get a value with high bits set. More...
 
static APInt getLowBitsSet (unsigned numBits, unsigned loBitsSet)
 Get a value with low bits set. More...
 
static APInt getSplat (unsigned NewLen, const APInt &V)
 Return a value containing V broadcasted over NewLen bits. More...
 
static bool isSameValue (const APInt &I1, const APInt &I2)
 Determine if two APInts have the same value, after zero-extending one of them (if needed!) to ensure that the bit-widths match. More...
 
static void udivrem (const APInt &LHS, const APInt &RHS, APInt &Quotient, APInt &Remainder)
 Dual division/remainder interface. More...
 
static void udivrem (const APInt &LHS, uint64_t RHS, APInt &Quotient, uint64_t &Remainder)
 
static void sdivrem (const APInt &LHS, const APInt &RHS, APInt &Quotient, APInt &Remainder)
 
static void sdivrem (const APInt &LHS, int64_t RHS, APInt &Quotient, int64_t &Remainder)
 
static unsigned getNumWords (unsigned BitWidth)
 Get the number of words. More...
 
static unsigned getBitsNeeded (StringRef str, uint8_t radix)
 Get bits required for string value. More...
 
static APInt doubleToBits (double V)
 Converts a double to APInt bits. More...
 
static APInt floatToBits (float V)
 Converts a float to APInt bits. More...
 
static void tcSet (WordType *, WordType, unsigned)
 Sets the least significant part of a bignum to the input value, and zeroes out higher parts. More...
 
static void tcAssign (WordType *, const WordType *, unsigned)
 Assign one bignum to another. More...
 
static bool tcIsZero (const WordType *, unsigned)
 Returns true if a bignum is zero, false otherwise. More...
 
static int tcExtractBit (const WordType *, unsigned bit)
 Extract the given bit of a bignum; returns 0 or 1. Zero-based. More...
 
static void tcExtract (WordType *, unsigned dstCount, const WordType *, unsigned srcBits, unsigned srcLSB)
 Copy the bit vector of width srcBITS from SRC, starting at bit srcLSB, to DST, of dstCOUNT parts, such that the bit srcLSB becomes the least significant bit of DST. More...
 
static void tcSetBit (WordType *, unsigned bit)
 Set the given bit of a bignum. Zero-based. More...
 
static void tcClearBit (WordType *, unsigned bit)
 Clear the given bit of a bignum. Zero-based. More...
 
static unsigned tcLSB (const WordType *, unsigned n)
 Returns the bit number of the least or most significant set bit of a number. More...
 
static unsigned tcMSB (const WordType *parts, unsigned n)
 
static void tcNegate (WordType *, unsigned)
 Negate a bignum in-place. More...
 
static WordType tcAdd (WordType *, const WordType *, WordType carry, unsigned)
 DST += RHS + CARRY where CARRY is zero or one. Returns the carry flag. More...
 
static WordType tcAddPart (WordType *, WordType, unsigned)
 DST += RHS. Returns the carry flag. More...
 
static WordType tcSubtract (WordType *, const WordType *, WordType carry, unsigned)
 DST -= RHS + CARRY where CARRY is zero or one. Returns the carry flag. More...
 
static WordType tcSubtractPart (WordType *, WordType, unsigned)
 DST -= RHS. Returns the carry flag. More...
 
static int tcMultiplyPart (WordType *dst, const WordType *src, WordType multiplier, WordType carry, unsigned srcParts, unsigned dstParts, bool add)
 DST += SRC * MULTIPLIER + PART if add is true DST = SRC * MULTIPLIER + PART if add is false. More...
 
static int tcMultiply (WordType *, const WordType *, const WordType *, unsigned)
 DST = LHS * RHS, where DST has the same width as the operands and is filled with the least significant parts of the result. More...
 
static void tcFullMultiply (WordType *, const WordType *, const WordType *, unsigned, unsigned)
 DST = LHS * RHS, where DST has width the sum of the widths of the operands. More...
 
static int tcDivide (WordType *lhs, const WordType *rhs, WordType *remainder, WordType *scratch, unsigned parts)
 If RHS is zero LHS and REMAINDER are left unchanged, return one. More...
 
static void tcShiftLeft (WordType *, unsigned Words, unsigned Count)
 Shift a bignum left Count bits. More...
 
static void tcShiftRight (WordType *, unsigned Words, unsigned Count)
 Shift a bignum right Count bits. More...
 
static void tcAnd (WordType *, const WordType *, unsigned)
 The obvious AND, OR and XOR and complement operations. More...
 
static void tcOr (WordType *, const WordType *, unsigned)
 
static void tcXor (WordType *, const WordType *, unsigned)
 
static void tcComplement (WordType *, unsigned)
 
static int tcCompare (const WordType *, const WordType *, unsigned)
 Comparison (unsigned) of two bignums. More...
 
static WordType tcIncrement (WordType *dst, unsigned parts)
 Increment a bignum in-place. Return the carry flag. More...
 
static WordType tcDecrement (WordType *dst, unsigned parts)
 Decrement a bignum in-place. Return the borrow flag. More...
 
static void tcSetLeastSignificantBits (WordType *, unsigned, unsigned bits)
 Set the least significant BITS and clear the rest. More...
 

Additional Inherited Members

- Public Types inherited from llvm::APInt
enum  : unsigned { APINT_WORD_SIZE = sizeof(WordType), APINT_BITS_PER_WORD = APINT_WORD_SIZE * CHAR_BIT }
 This enum is used to hold the constants we needed for APInt. More...
 
typedef uint64_t WordType
 
- Static Public Attributes inherited from llvm::APInt
static const WordType WORD_MAX = ~WordType(0)
 

Detailed Description

Definition at line 22 of file APSInt.h.

Constructor & Destructor Documentation

◆ APSInt() [1/4]

llvm::APSInt::APSInt ( )
inlineexplicit

Default constructor that creates an uninitialized APInt.

Definition at line 27 of file APSInt.h.

Referenced by APSInt().

◆ APSInt() [2/4]

llvm::APSInt::APSInt ( uint32_t  BitWidth,
bool  isUnsigned = true 
)
inlineexplicit

APSInt ctor - Create an APSInt with the specified width, default to unsigned.

Definition at line 31 of file APSInt.h.

◆ APSInt() [3/4]

llvm::APSInt::APSInt ( APInt  I,
bool  isUnsigned = true 
)
inlineexplicit

Definition at line 34 of file APSInt.h.

References llvm::lltok::APSInt.

◆ APSInt() [4/4]

APSInt::APSInt ( StringRef  Str)
explicit

Construct an APSInt from a string representation.

This constructor interprets the string 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.

Parameters
Strthe string to be interpreted.

Definition at line 21 of file APSInt.cpp.

References APSInt(), assert(), llvm::StringRef::empty(), llvm::APInt::getActiveBits(), llvm::APInt::getMinSignedBits(), llvm::StringRef::size(), and llvm::APInt::trunc().

Member Function Documentation

◆ compareValues()

static int llvm::APSInt::compareValues ( const APSInt I1,
const APSInt I2 
)
inlinestatic

Compare underlying values of two numbers.

Definition at line 289 of file APSInt.h.

References assert(), extend(), llvm::APInt::getBitWidth(), llvm::APInt::isNegative(), and isSigned().

◆ extend()

APSInt llvm::APSInt::extend ( uint32_t  width) const
inline

Definition at line 85 of file APSInt.h.

References llvm::lltok::APSInt.

Referenced by compareValues().

◆ extOrTrunc()

APSInt llvm::APSInt::extOrTrunc ( uint32_t  width) const
inline

Definition at line 92 of file APSInt.h.

References llvm::lltok::APSInt.

Referenced by FunctionNumber().

◆ get()

static APSInt llvm::APSInt::get ( int64_t  X)
inlinestatic

Definition at line 314 of file APSInt.h.

References llvm::lltok::APSInt, and X.

◆ getExtValue()

int64_t llvm::APSInt::getExtValue ( ) const
inline

Get the correctly-extended int64_t value.

Definition at line 76 of file APSInt.h.

References assert().

Referenced by llvm::codeview::CodeViewRecordIO::mapEncodedInteger().

◆ getMaxValue()

static APSInt llvm::APSInt::getMaxValue ( uint32_t  numBits,
bool  Unsigned 
)
inlinestatic

getMaxValue - Return the APSInt representing the maximum integer value with the given bit width and signedness.

Definition at line 270 of file APSInt.h.

References llvm::lltok::APSInt, llvm::APInt::getMaxValue(), and llvm::APInt::getSignedMaxValue().

◆ getMinValue()

static APSInt llvm::APSInt::getMinValue ( uint32_t  numBits,
bool  Unsigned 
)
inlinestatic

getMinValue - Return the APSInt representing the minimum integer value with the given bit width and signedness.

Definition at line 277 of file APSInt.h.

References llvm::lltok::APSInt, llvm::APInt::getMinValue(), and llvm::APInt::getSignedMinValue().

◆ getUnsigned()

static APSInt llvm::APSInt::getUnsigned ( uint64_t  X)
inlinestatic

Definition at line 315 of file APSInt.h.

References llvm::lltok::APSInt.

Referenced by getCommonClassOptions().

◆ isSameValue()

static bool llvm::APSInt::isSameValue ( const APSInt I1,
const APSInt I2 
)
inlinestatic

Determine if two APSInts have the same value, zero- or sign-extending as needed.

Definition at line 284 of file APSInt.h.

◆ isSigned()

bool llvm::APSInt::isSigned ( ) const
inline

◆ isUnsigned()

bool llvm::APSInt::isUnsigned ( ) const
inline

Definition at line 60 of file APSInt.h.

◆ operator &()

APSInt llvm::APSInt::operator& ( const APSInt RHS) const
inline

Definition at line 237 of file APSInt.h.

References llvm::lltok::APSInt, and assert().

◆ operator &=()

APSInt& llvm::APSInt::operator&= ( const APSInt RHS)
inline

Definition at line 221 of file APSInt.h.

References assert().

◆ operator!=() [1/2]

bool llvm::APSInt::operator!= ( const APSInt RHS) const
inline

Definition at line 155 of file APSInt.h.

◆ operator!=() [2/2]

bool llvm::APSInt::operator!= ( int64_t  RHS) const
inline

Definition at line 162 of file APSInt.h.

◆ operator%()

APSInt llvm::APSInt::operator% ( const APSInt RHS) const
inline

Definition at line 115 of file APSInt.h.

References llvm::lltok::APSInt, and assert().

◆ operator%=()

const APSInt& llvm::APSInt::operator%= ( const APSInt RHS)
inline

Definition at line 99 of file APSInt.h.

References assert().

◆ operator*()

APSInt llvm::APSInt::operator* ( const APSInt RHS) const
inline

Definition at line 252 of file APSInt.h.

References llvm::lltok::APSInt, and assert().

◆ operator*=()

APSInt& llvm::APSInt::operator*= ( const APSInt RHS)
inline

Definition at line 216 of file APSInt.h.

References assert().

◆ operator+()

APSInt llvm::APSInt::operator+ ( const APSInt RHS) const
inline

Definition at line 256 of file APSInt.h.

References llvm::lltok::APSInt, and assert().

◆ operator++() [1/2]

APSInt& llvm::APSInt::operator++ ( )
inline

Definition at line 189 of file APSInt.h.

◆ operator++() [2/2]

APSInt llvm::APSInt::operator++ ( int  )
inline

Definition at line 197 of file APSInt.h.

References llvm::lltok::APSInt.

◆ operator+=()

APSInt& llvm::APSInt::operator+= ( const APSInt RHS)
inline

Definition at line 206 of file APSInt.h.

References assert().

◆ operator-() [1/2]

APSInt llvm::APSInt::operator- ( ) const
inline

Definition at line 203 of file APSInt.h.

References llvm::lltok::APSInt.

◆ operator-() [2/2]

APSInt llvm::APSInt::operator- ( const APSInt RHS) const
inline

Definition at line 260 of file APSInt.h.

References llvm::lltok::APSInt, and assert().

◆ operator--() [1/2]

APSInt& llvm::APSInt::operator-- ( )
inline

Definition at line 193 of file APSInt.h.

◆ operator--() [2/2]

APSInt llvm::APSInt::operator-- ( int  )
inline

Definition at line 200 of file APSInt.h.

References llvm::lltok::APSInt.

◆ operator-=()

APSInt& llvm::APSInt::operator-= ( const APSInt RHS)
inline

Definition at line 211 of file APSInt.h.

References assert().

◆ operator/()

APSInt llvm::APSInt::operator/ ( const APSInt RHS) const
inline

Definition at line 119 of file APSInt.h.

References llvm::lltok::APSInt, and assert().

◆ operator/=()

const APSInt& llvm::APSInt::operator/= ( const APSInt RHS)
inline

Definition at line 107 of file APSInt.h.

References assert().

◆ operator<() [1/2]

bool llvm::APSInt::operator< ( const APSInt RHS) const
inline

Definition at line 135 of file APSInt.h.

References assert().

◆ operator<() [2/2]

bool llvm::APSInt::operator< ( int64_t  RHS) const
inline

Definition at line 171 of file APSInt.h.

◆ operator<<()

APSInt llvm::APSInt::operator<< ( unsigned  Bits) const
inline

Definition at line 181 of file APSInt.h.

References llvm::lltok::APSInt.

◆ operator<<=()

APSInt& llvm::APSInt::operator<<= ( unsigned  Amt)
inline

Definition at line 184 of file APSInt.h.

◆ operator<=() [1/2]

bool llvm::APSInt::operator<= ( const APSInt RHS) const
inline

Definition at line 143 of file APSInt.h.

References assert().

◆ operator<=() [2/2]

bool llvm::APSInt::operator<= ( int64_t  RHS) const
inline

Definition at line 165 of file APSInt.h.

◆ operator=() [1/2]

APSInt& llvm::APSInt::operator= ( APInt  RHS)
inline

Definition at line 46 of file APSInt.h.

References llvm::APInt::operator=().

◆ operator=() [2/2]

APSInt& llvm::APSInt::operator= ( uint64_t  RHS)
inline

Definition at line 52 of file APSInt.h.

References llvm::APInt::operator=().

◆ operator==() [1/2]

bool llvm::APSInt::operator== ( const APSInt RHS) const
inline

Definition at line 151 of file APSInt.h.

References assert().

◆ operator==() [2/2]

bool llvm::APSInt::operator== ( int64_t  RHS) const
inline

Definition at line 159 of file APSInt.h.

◆ operator>() [1/2]

bool llvm::APSInt::operator> ( const APSInt RHS) const
inline

Definition at line 139 of file APSInt.h.

References assert().

◆ operator>() [2/2]

bool llvm::APSInt::operator> ( int64_t  RHS) const
inline

Definition at line 174 of file APSInt.h.

◆ operator>=() [1/2]

bool llvm::APSInt::operator>= ( const APSInt RHS) const
inline

Definition at line 147 of file APSInt.h.

References assert().

◆ operator>=() [2/2]

bool llvm::APSInt::operator>= ( int64_t  RHS) const
inline

Definition at line 168 of file APSInt.h.

◆ operator>>()

APSInt llvm::APSInt::operator>> ( unsigned  Amt) const
inline

Definition at line 124 of file APSInt.h.

References llvm::lltok::APSInt.

◆ operator>>=()

APSInt& llvm::APSInt::operator>>= ( unsigned  Amt)
inline

Definition at line 127 of file APSInt.h.

◆ operator^()

APSInt llvm::APSInt::operator^ ( const APSInt RHS) const
inline

Definition at line 247 of file APSInt.h.

References llvm::lltok::APSInt, and assert().

◆ operator^=()

APSInt& llvm::APSInt::operator^= ( const APSInt RHS)
inline

Definition at line 231 of file APSInt.h.

References assert().

◆ operator|()

APSInt llvm::APSInt::operator| ( const APSInt RHS) const
inline

Definition at line 242 of file APSInt.h.

References llvm::lltok::APSInt, and assert().

◆ operator|=()

APSInt& llvm::APSInt::operator|= ( const APSInt RHS)
inline

Definition at line 226 of file APSInt.h.

References assert().

◆ operator~()

APSInt llvm::APSInt::operator~ ( ) const
inline

Definition at line 264 of file APSInt.h.

References llvm::lltok::APSInt.

◆ Profile()

void APSInt::Profile ( FoldingSetNodeID ID) const

Profile - Used to insert APSInt objects, or objects that contain APSInt objects, into FoldingSets.

Definition at line 40 of file APSInt.cpp.

References llvm::FoldingSetNodeID::AddInteger(), and llvm::APInt::Profile().

◆ setIsSigned()

void llvm::APSInt::setIsSigned ( bool  Val)
inline

Definition at line 62 of file APSInt.h.

◆ setIsUnsigned()

void llvm::APSInt::setIsUnsigned ( bool  Val)
inline

Definition at line 61 of file APSInt.h.

◆ toString() [1/2]

void llvm::APSInt::toString ( SmallVectorImpl< char > &  Str,
unsigned  Radix = 10 
) const
inline

toString - Append this APSInt to the specified SmallString.

Definition at line 65 of file APSInt.h.

References llvm::APInt::toString().

◆ toString() [2/2]

std::string llvm::APSInt::toString ( unsigned  Radix) const
inline

toString - Converts an APInt to a std::string.

This is an inefficient method; you should prefer passing in a SmallString instead.

Definition at line 70 of file APSInt.h.

References llvm::APInt::toString().

◆ trunc()

APSInt llvm::APSInt::trunc ( uint32_t  width) const
inline

Definition at line 81 of file APSInt.h.

References llvm::lltok::APSInt, and llvm::APInt::trunc().


The documentation for this class was generated from the following files: