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 (const APInt &I, bool isUnsigned=true)
APSIntoperator= (const APSInt &RHS)
APSIntoperator= (const 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 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== (int64_t RHS) const
bool operator!= (const APSInt &RHS) const
bool operator!= (int64_t RHS) const
APSInt operator<< (unsigned Bits) const
APSIntoperator<<= (unsigned Amt)
 Left-shift assignment function.
APSIntoperator++ ()
 Prefix increment operator.
APSIntoperator-- ()
 Prefix decrement operator.
APSInt operator++ (int)
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 And (const APSInt &RHS) const
APSInt operator| (const APSInt &RHS) const
APSInt Or (const APSInt &RHS) const
APSInt operator^ (const APSInt &RHS) const
APSInt 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 ( const APInt I,
bool  isUnsigned = true 
) [inline, explicit]

Definition at line 33 of file APSInt.h.


Member Function Documentation

APSInt llvm::APSInt::And ( const APSInt RHS) const [inline]

Definition at line 215 of file APSInt.h.

References operator&().

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

Definition at line 75 of file APSInt.h.

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

Referenced by isSameValue().

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

Definition at line 82 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 254 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 261 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 268 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 55 of file APSInt.h.

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

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

Definition at line 56 of file APSInt.h.

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

Definition at line 145 of file APSInt.h.

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

Definition at line 148 of file APSInt.h.

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

Definition at line 105 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 89 of file APSInt.h.

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

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

Definition at line 211 of file APSInt.h.

References APSInt().

Referenced by And().

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

Definition at line 195 of file APSInt.h.

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

Definition at line 236 of file APSInt.h.

References APSInt().

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

Definition at line 190 of file APSInt.h.

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

Definition at line 240 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 163 of file APSInt.h.

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

Reimplemented from llvm::APInt.

Definition at line 171 of file APSInt.h.

References APSInt().

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

Definition at line 180 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 177 of file APSInt.h.

References APSInt().

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

Definition at line 244 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 167 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 174 of file APSInt.h.

References APSInt().

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

Definition at line 185 of file APSInt.h.

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

Definition at line 109 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 97 of file APSInt.h.

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

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

Definition at line 122 of file APSInt.h.

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

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

Reimplemented from llvm::APInt.

Definition at line 155 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 158 of file APSInt.h.

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

Definition at line 130 of file APSInt.h.

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

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

Definition at line 36 of file APSInt.h.

Referenced by operator=().

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

Reimplemented from llvm::APInt.

Definition at line 42 of file APSInt.h.

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

References operator=().

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

Definition at line 138 of file APSInt.h.

References llvm::APInt::eq().

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

Definition at line 142 of file APSInt.h.

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

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

Definition at line 126 of file APSInt.h.

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

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

Definition at line 134 of file APSInt.h.

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

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

Definition at line 114 of file APSInt.h.

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

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

Definition at line 117 of file APSInt.h.

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

Definition at line 228 of file APSInt.h.

References APSInt().

Referenced by Xor().

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

Definition at line 205 of file APSInt.h.

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

Definition at line 219 of file APSInt.h.

References APSInt().

Referenced by Or().

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

Definition at line 200 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 248 of file APSInt.h.

References APSInt().

APSInt llvm::APSInt::Or ( const APSInt RHS) const [inline]

Definition at line 223 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 58 of file APSInt.h.

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

Definition at line 57 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 61 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, your should prefer passing in a SmallString instead.

Definition at line 66 of file APSInt.h.

References isSigned(), and toString().

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

Definition at line 71 of file APSInt.h.

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

APSInt llvm::APSInt::Xor ( const APSInt RHS) const [inline]

Definition at line 232 of file APSInt.h.

References operator^().


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