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:

Methods

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)

Declared at: llvm/include/llvm/ADT/APSInt.h:34

Parameters

llvm::APInt I
bool isUnsigned = true

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()

Description

Default constructor that creates an uninitialized APInt.

Declared at: llvm/include/llvm/ADT/APSInt.h:28

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

llvm::FoldingSetNodeID& ID

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

Declared at: llvm/include/llvm/ADT/APSInt.h:105

Parameters

uint32_t width

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)

Declared at: llvm/include/llvm/ADT/APSInt.h:327

Parameters

int64_t X

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)

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)

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)

Declared at: llvm/include/llvm/ADT/APSInt.h:328

Parameters

uint64_t X

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

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)

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

Declared at: llvm/include/llvm/ADT/APSInt.h:77

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

Declared at: llvm/include/llvm/ADT/APSInt.h:78

void setIsSigned(bool Val)

Declared at: llvm/include/llvm/ADT/APSInt.h:80

Parameters

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

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

Declared at: llvm/include/llvm/ADT/APSInt.h:94

Parameters

uint32_t width