clang 19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::interp::IntegralAP< Signed > Class Template Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/IntegralAP.h"

Public Types

using AsUnsigned = IntegralAP< false >
 

Public Member Functions

template<typename T >
 IntegralAP (T Value, unsigned BitWidth)
 
 IntegralAP (APInt V)
 
 IntegralAP ()
 Arbitrary value for uninitialized variables.
 
IntegralAP operator- () const
 
IntegralAP operator- (const IntegralAP &Other) const
 
bool operator> (const IntegralAP &RHS) const
 
bool operator>= (IntegralAP RHS) const
 
bool operator< (IntegralAP RHS) const
 
bool operator<= (IntegralAP RHS) const
 
template<typename Ty , typename = std::enable_if_t<std::is_integral_v<Ty>>>
 operator Ty () const
 
constexpr unsigned bitWidth () const
 
APSInt toAPSInt (unsigned Bits=0) const
 
APValue toAPValue () const
 
bool isZero () const
 
bool isPositive () const
 
bool isNegative () const
 
bool isMin () const
 
bool isMax () const
 
bool isMinusOne () const
 
unsigned countLeadingZeros () const
 
void print (llvm::raw_ostream &OS) const
 
std::string toDiagnosticString (const ASTContext &Ctx) const
 
IntegralAP truncate (unsigned BitWidth) const
 
IntegralAP< falsetoUnsigned () const
 
ComparisonCategoryResult compare (const IntegralAP &RHS) const
 
size_t bytesToSerialize () const
 
void serialize (std::byte *Buff) const
 

Static Public Member Functions

template<typename T >
static IntegralAP from (T Value, unsigned NumBits=0)
 
template<bool InputSigned>
static IntegralAP from (IntegralAP< InputSigned > V, unsigned NumBits=0)
 
template<unsigned Bits, bool InputSigned>
static IntegralAP from (Integral< Bits, InputSigned > I, unsigned BitWidth)
 
static IntegralAP zero (int32_t BitWidth)
 
static constexpr bool isSigned ()
 
static bool increment (IntegralAP A, IntegralAP *R)
 
static bool decrement (IntegralAP A, IntegralAP *R)
 
static bool add (IntegralAP A, IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static bool sub (IntegralAP A, IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static bool mul (IntegralAP A, IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static bool rem (IntegralAP A, IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static bool div (IntegralAP A, IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static bool bitAnd (IntegralAP A, IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static bool bitOr (IntegralAP A, IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static bool bitXor (IntegralAP A, IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static bool neg (const IntegralAP &A, IntegralAP *R)
 
static bool comp (IntegralAP A, IntegralAP *R)
 
static void shiftLeft (const IntegralAP A, const IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static void shiftRight (const IntegralAP A, const IntegralAP B, unsigned OpBits, IntegralAP *R)
 
static IntegralAP< Signeddeserialize (const std::byte *Buff)
 

Detailed Description

template<bool Signed>
class clang::interp::IntegralAP< Signed >

Definition at line 33 of file IntegralAP.h.

Member Typedef Documentation

◆ AsUnsigned

template<bool Signed>
using clang::interp::IntegralAP< Signed >::AsUnsigned = IntegralAP<false>

Definition at line 56 of file IntegralAP.h.

Constructor & Destructor Documentation

◆ IntegralAP() [1/3]

template<bool Signed>
template<typename T >
clang::interp::IntegralAP< Signed >::IntegralAP ( T  Value,
unsigned  BitWidth 
)
inline

Definition at line 59 of file IntegralAP.h.

References V.

◆ IntegralAP() [2/3]

template<bool Signed>
clang::interp::IntegralAP< Signed >::IntegralAP ( APInt  V)
inline

Definition at line 62 of file IntegralAP.h.

References V.

◆ IntegralAP() [3/3]

template<bool Signed>
clang::interp::IntegralAP< Signed >::IntegralAP ( )
inline

Member Function Documentation

◆ add()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::add ( IntegralAP< Signed A,
IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 197 of file IntegralAP.h.

Referenced by clang::interp::IntegralAP< Signed >::increment().

◆ bitAnd()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::bitAnd ( IntegralAP< Signed A,
IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 225 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::IntegralAP().

◆ bitOr()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::bitOr ( IntegralAP< Signed A,
IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 231 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::IntegralAP().

◆ bitWidth()

template<bool Signed>
constexpr unsigned clang::interp::IntegralAP< Signed >::bitWidth ( ) const
inlineconstexpr

◆ bitXor()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::bitXor ( IntegralAP< Signed A,
IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 237 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::IntegralAP().

◆ bytesToSerialize()

template<bool Signed>
size_t clang::interp::IntegralAP< Signed >::bytesToSerialize ( ) const
inline

Definition at line 270 of file IntegralAP.h.

References CHAR_BIT, and V.

◆ comp()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::comp ( IntegralAP< Signed A,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 250 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::IntegralAP().

◆ compare()

template<bool Signed>
ComparisonCategoryResult clang::interp::IntegralAP< Signed >::compare ( const IntegralAP< Signed > &  RHS) const
inline

◆ countLeadingZeros()

template<bool Signed>
unsigned clang::interp::IntegralAP< Signed >::countLeadingZeros ( ) const
inline

Definition at line 146 of file IntegralAP.h.

References V.

◆ decrement()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::decrement ( IntegralAP< Signed A,
IntegralAP< Signed > *  R 
)
inlinestatic

◆ deserialize()

template<bool Signed>
static IntegralAP< Signed > clang::interp::IntegralAP< Signed >::deserialize ( const std::byte *  Buff)
inlinestatic

Definition at line 284 of file IntegralAP.h.

References CHAR_BIT, and clang::Signed.

◆ div()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::div ( IntegralAP< Signed A,
IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

◆ from() [1/3]

template<bool Signed>
template<unsigned Bits, bool InputSigned>
static IntegralAP clang::interp::IntegralAP< Signed >::from ( Integral< Bits, InputSigned >  I,
unsigned  BitWidth 
)
inlinestatic

Definition at line 114 of file IntegralAP.h.

References clang::Copy.

◆ from() [2/3]

template<bool Signed>
template<bool InputSigned>
static IntegralAP clang::interp::IntegralAP< Signed >::from ( IntegralAP< InputSigned >  V,
unsigned  NumBits = 0 
)
inlinestatic

Definition at line 104 of file IntegralAP.h.

References V.

◆ from() [3/3]

template<bool Signed>
template<typename T >
static IntegralAP clang::interp::IntegralAP< Signed >::from ( T  Value,
unsigned  NumBits = 0 
)
inlinestatic

◆ increment()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::increment ( IntegralAP< Signed A,
IntegralAP< Signed > *  R 
)
inlinestatic

◆ isMax()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::isMax ( ) const
inline

Definition at line 142 of file IntegralAP.h.

References V.

◆ isMin()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::isMin ( ) const
inline

Definition at line 141 of file IntegralAP.h.

References V.

◆ isMinusOne()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::isMinusOne ( ) const
inline

Definition at line 144 of file IntegralAP.h.

References clang::Signed, and V.

◆ isNegative()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::isNegative ( ) const
inline

Definition at line 140 of file IntegralAP.h.

References V.

◆ isPositive()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::isPositive ( ) const
inline

Definition at line 139 of file IntegralAP.h.

References V.

◆ isSigned()

template<bool Signed>
static constexpr bool clang::interp::IntegralAP< Signed >::isSigned ( )
inlinestaticconstexpr

Definition at line 143 of file IntegralAP.h.

References clang::Signed.

Referenced by clang::interp::IntegralAP< Signed >::compare().

◆ isZero()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::isZero ( ) const
inline

Definition at line 138 of file IntegralAP.h.

References V.

◆ mul()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::mul ( IntegralAP< Signed A,
IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 205 of file IntegralAP.h.

◆ neg()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::neg ( const IntegralAP< Signed > &  A,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 243 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::IntegralAP().

◆ operator Ty()

template<bool Signed>
template<typename Ty , typename = std::enable_if_t<std::is_integral_v<Ty>>>
clang::interp::IntegralAP< Signed >::operator Ty ( ) const
inlineexplicit

Definition at line 92 of file IntegralAP.h.

References V.

◆ operator-() [1/2]

template<bool Signed>
IntegralAP clang::interp::IntegralAP< Signed >::operator- ( ) const
inline

Definition at line 66 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::IntegralAP(), and V.

◆ operator-() [2/2]

template<bool Signed>
IntegralAP clang::interp::IntegralAP< Signed >::operator- ( const IntegralAP< Signed > &  Other) const
inline

Definition at line 67 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::IntegralAP(), clang::Other, and V.

◆ operator<()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::operator< ( IntegralAP< Signed RHS) const
inline

Definition at line 80 of file IntegralAP.h.

References clang::Signed, and V.

◆ operator<=()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::operator<= ( IntegralAP< Signed RHS) const
inline

Definition at line 85 of file IntegralAP.h.

References clang::Signed, and V.

◆ operator>()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::operator> ( const IntegralAP< Signed > &  RHS) const
inline

Definition at line 70 of file IntegralAP.h.

References clang::Signed, and V.

◆ operator>=()

template<bool Signed>
bool clang::interp::IntegralAP< Signed >::operator>= ( IntegralAP< Signed RHS) const
inline

Definition at line 75 of file IntegralAP.h.

References clang::Signed, and V.

◆ print()

template<bool Signed>
void clang::interp::IntegralAP< Signed >::print ( llvm::raw_ostream &  OS) const
inline

◆ rem()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::rem ( IntegralAP< Signed A,
IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

◆ serialize()

template<bool Signed>
void clang::interp::IntegralAP< Signed >::serialize ( std::byte *  Buff) const
inline

Definition at line 275 of file IntegralAP.h.

References CHAR_BIT, and V.

◆ shiftLeft()

template<bool Signed>
static void clang::interp::IntegralAP< Signed >::shiftLeft ( const IntegralAP< Signed A,
const IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 255 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::IntegralAP().

◆ shiftRight()

template<bool Signed>
static void clang::interp::IntegralAP< Signed >::shiftRight ( const IntegralAP< Signed A,
const IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

◆ sub()

template<bool Signed>
static bool clang::interp::IntegralAP< Signed >::sub ( IntegralAP< Signed A,
IntegralAP< Signed B,
unsigned  OpBits,
IntegralAP< Signed > *  R 
)
inlinestatic

Definition at line 201 of file IntegralAP.h.

Referenced by clang::interp::IntegralAP< Signed >::decrement().

◆ toAPSInt()

template<bool Signed>
APSInt clang::interp::IntegralAP< Signed >::toAPSInt ( unsigned  Bits = 0) const
inline

◆ toAPValue()

template<bool Signed>
APValue clang::interp::IntegralAP< Signed >::toAPValue ( ) const
inline

Definition at line 136 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::toAPSInt().

◆ toDiagnosticString()

template<bool Signed>
std::string clang::interp::IntegralAP< Signed >::toDiagnosticString ( const ASTContext Ctx) const
inline

Definition at line 149 of file IntegralAP.h.

References clang::interp::IntegralAP< Signed >::print().

◆ toUnsigned()

template<bool Signed>
IntegralAP< false > clang::interp::IntegralAP< Signed >::toUnsigned ( ) const
inline

Definition at line 163 of file IntegralAP.h.

References clang::Copy, and V.

◆ truncate()

template<bool Signed>
IntegralAP clang::interp::IntegralAP< Signed >::truncate ( unsigned  BitWidth) const
inline

◆ zero()

template<bool Signed>
static IntegralAP clang::interp::IntegralAP< Signed >::zero ( int32_t  BitWidth)
inlinestatic

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