LLVM API Documentation

Public Member Functions | Static Public Member Functions
llvm::APSInt Class Reference

#include <APSInt.h>

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

List of all members.

Public Member Functions

 APSInt ()
 Default constructor that creates an uninitialized APInt.
 APSInt (uint32_t BitWidth, bool isUnsigned=true)
 APSInt (APInt I, bool isUnsigned=true)
APSIntoperator= (APInt RHS)
APSIntoperator= (uint64_t RHS)
 Assignment operator.
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.
std::string toString (unsigned Radix) const
APSInt LLVM_ATTRIBUTE_UNUSED_RESULT trunc (uint32_t width) const
APSInt LLVM_ATTRIBUTE_UNUSED_RESULT extend (uint32_t width) const
APSInt LLVM_ATTRIBUTE_UNUSED_RESULT 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== (int64_t RHS) const
bool operator!= (const APSInt &RHS) const
bool operator!= (int64_t RHS) const
APSInt operator<< (unsigned Bits) const
 Left logical shift operator.
APSIntoperator<<= (unsigned Amt)
 Left-shift assignment function.
APSIntoperator++ ()
 Prefix increment operator.
APSIntoperator-- ()
 Prefix decrement operator.
APSInt operator++ (int)
 Postfix increment operator.
APSInt operator-- (int)
 Postfix decrement operator.
APSInt operator- () const
 Unary negation operator.
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 LLVM_ATTRIBUTE_UNUSED_RESULT And (const APSInt &RHS) const
APSInt operator| (const APSInt &RHS) const
APSInt LLVM_ATTRIBUTE_UNUSED_RESULT Or (const APSInt &RHS) const
APSInt operator^ (const APSInt &RHS) const
APSInt LLVM_ATTRIBUTE_UNUSED_RESULT Xor (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
 Unary bitwise complement operator.
void Profile (FoldingSetNodeID &ID) const

Static Public Member Functions

static APSInt getMaxValue (uint32_t numBits, bool Unsigned)
static APSInt getMinValue (uint32_t numBits, bool Unsigned)
static bool isSameValue (const APSInt &I1, const APSInt &I2)
 Determine if two APSInts have the same value, zero- or sign-extending as needed.

Detailed Description

Definition at line 22 of file APSInt.h.


Constructor & Destructor Documentation

llvm::APSInt::APSInt ( ) [inline, explicit]
llvm::APSInt::APSInt ( uint32_t  BitWidth,
bool  isUnsigned = true 
) [inline, explicit]

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

Definition at line 30 of file APSInt.h.

llvm::APSInt::APSInt ( APInt  I,
bool  isUnsigned = true 
) [inline, explicit]

Definition at line 33 of file APSInt.h.


Member Function Documentation

Definition at line 209 of file APSInt.h.

References operator&().

APSInt LLVM_ATTRIBUTE_UNUSED_RESULT llvm::APSInt::extend ( uint32_t  width) const [inline]

Definition at line 69 of file APSInt.h.

References APSInt(), llvm::APInt::sext(), and llvm::APInt::zext().

Referenced by isSameValue().

APSInt LLVM_ATTRIBUTE_UNUSED_RESULT llvm::APSInt::extOrTrunc ( uint32_t  width) const [inline]

Definition at line 76 of file APSInt.h.

References APSInt(), llvm::APInt::sextOrTrunc(), and llvm::APInt::zextOrTrunc().

static APSInt llvm::APSInt::getMaxValue ( uint32_t  numBits,
bool  Unsigned 
) [inline, static]

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

Definition at line 248 of file APSInt.h.

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

static APSInt llvm::APSInt::getMinValue ( uint32_t  numBits,
bool  Unsigned 
) [inline, static]

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

Definition at line 255 of file APSInt.h.

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

static bool llvm::APSInt::isSameValue ( const APSInt I1,
const APSInt I2 
) [inline, static]

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

Definition at line 262 of file APSInt.h.

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

Referenced by operator==().

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

Definition at line 49 of file APSInt.h.

Referenced by llvm::APFloat::convertToInteger(), isSameValue(), llvm::operator<<(), and toString().

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

Definition at line 50 of file APSInt.h.

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

Definition at line 139 of file APSInt.h.

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

Definition at line 142 of file APSInt.h.

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

Definition at line 99 of file APSInt.h.

References APSInt(), llvm::APInt::srem(), and llvm::APInt::urem().

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

Definition at line 83 of file APSInt.h.

References llvm::APInt::srem(), and llvm::APInt::urem().

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

Definition at line 205 of file APSInt.h.

References APSInt().

Referenced by And().

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

Definition at line 189 of file APSInt.h.

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

Definition at line 230 of file APSInt.h.

References APSInt().

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

Definition at line 184 of file APSInt.h.

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

Definition at line 234 of file APSInt.h.

References APSInt().

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

Prefix increment operator.

Prefix increment operator. Increments the APInt by one.

Returns:
*this incremented by one

Reimplemented from llvm::APInt.

Definition at line 157 of file APSInt.h.

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

Postfix increment operator.

Returns:
a new APInt value representing *this incremented by one

Reimplemented from llvm::APInt.

Definition at line 165 of file APSInt.h.

References APSInt().

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

Definition at line 174 of file APSInt.h.

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

Unary negation operator.

Negates *this using two's complement logic.

Returns:
An APInt value representing the negation of *this.

Reimplemented from llvm::APInt.

Definition at line 171 of file APSInt.h.

References APSInt().

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

Definition at line 238 of file APSInt.h.

References APSInt().

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

Prefix decrement operator.

Prefix decrement operator. Decrements the APInt by one.

Returns:
*this decremented by one.

Reimplemented from llvm::APInt.

Definition at line 161 of file APSInt.h.

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

Postfix decrement operator.

Returns:
a new APInt representing *this decremented by one.

Reimplemented from llvm::APInt.

Definition at line 168 of file APSInt.h.

References APSInt().

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

Definition at line 179 of file APSInt.h.

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

Definition at line 103 of file APSInt.h.

References APSInt(), llvm::APInt::sdiv(), and llvm::APInt::udiv().

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

Definition at line 91 of file APSInt.h.

References llvm::APInt::sdiv(), and llvm::APInt::udiv().

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

Definition at line 116 of file APSInt.h.

References llvm::APInt::slt(), and llvm::APInt::ult().

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

Left logical shift operator.

Shifts this APInt left by Bits and returns the result.

Reimplemented from llvm::APInt.

Definition at line 149 of file APSInt.h.

References APSInt().

APSInt& llvm::APSInt::operator<<= ( unsigned  shiftAmt) [inline]

Left-shift assignment function.

Shifts *this left by shiftAmt and assigns the result to *this.

Returns:
*this after shifting left by shiftAmt

Reimplemented from llvm::APInt.

Definition at line 152 of file APSInt.h.

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

Definition at line 124 of file APSInt.h.

References llvm::APInt::sle(), and llvm::APInt::ule().

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

Definition at line 36 of file APSInt.h.

Referenced by operator=().

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

Assignment operator.

The RHS value is assigned to *this. If the significant bits in RHS exceed the bit width, the excess bits are truncated. If the bit width is larger than 64, the value is zero filled in the unspecified high order bits.

Returns:
*this after assignment of RHS value.

Reimplemented from llvm::APInt.

Definition at line 42 of file APSInt.h.

References operator=().

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

Definition at line 132 of file APSInt.h.

References llvm::APInt::eq().

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

Definition at line 136 of file APSInt.h.

References llvm::APInt::APInt(), APSInt(), and isSameValue().

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

Definition at line 120 of file APSInt.h.

References llvm::APInt::sgt(), and llvm::APInt::ugt().

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

Definition at line 128 of file APSInt.h.

References llvm::APInt::sge(), and llvm::APInt::uge().

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

Definition at line 108 of file APSInt.h.

References APSInt(), llvm::APInt::ashr(), and llvm::APInt::lshr().

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

Definition at line 111 of file APSInt.h.

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

Definition at line 222 of file APSInt.h.

References APSInt().

Referenced by Xor().

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

Definition at line 199 of file APSInt.h.

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

Definition at line 213 of file APSInt.h.

References APSInt().

Referenced by Or().

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

Definition at line 194 of file APSInt.h.

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

Unary bitwise complement operator.

Performs a bitwise complement operation on this APInt.

Returns:
an APInt that is the bitwise complement of *this

Reimplemented from llvm::APInt.

Definition at line 242 of file APSInt.h.

References APSInt().

Definition at line 217 of file APSInt.h.

References operator|().

void APSInt::Profile ( FoldingSetNodeID ID) const

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

Reimplemented from llvm::APInt.

Definition at line 20 of file APSInt.cpp.

References llvm::FoldingSetNodeID::AddInteger().

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

Definition at line 52 of file APSInt.h.

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

Definition at line 51 of file APSInt.h.

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

toString - Append this APSInt to the specified SmallString.

Definition at line 55 of file APSInt.h.

References isSigned().

Referenced by toString().

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 60 of file APSInt.h.

References isSigned(), and toString().

APSInt LLVM_ATTRIBUTE_UNUSED_RESULT llvm::APSInt::trunc ( uint32_t  width) const [inline]

Definition at line 65 of file APSInt.h.

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

Definition at line 226 of file APSInt.h.

References operator^().


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