clang 22.0.0git
clang::interp::IntegralAP< Signed > Class Template Reference

If an IntegralAP is constructed from Memory, it DOES NOT OWN THAT MEMORY. More...

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

Inheritance diagram for clang::interp::IntegralAP< Signed >:
[legend]

Public Types

using AsUnsigned = IntegralAP<false>

Public Member Functions

APInt getValue () const
void take (uint64_t *NewMemory)
void copy (const APInt &V)
 IntegralAP ()=default
 IntegralAP (unsigned BitWidth)
 Zeroed, single-word IntegralAP of the given bitwidth.
 IntegralAP (uint64_t *Memory, unsigned BitWidth)
 IntegralAP (const APInt &V)
IntegralAP operator- () const
bool operator> (const IntegralAP &RHS) const
bool operator>= (unsigned RHS) const
bool operator< (IntegralAP RHS) const
template<typename Ty, typename = std::enable_if_t<std::is_integral_v<Ty>>>
 operator Ty () const
constexpr uint32_t bitWidth () const
constexpr unsigned numWords () const
constexpr bool singleWord () const
APSInt toAPSInt (unsigned Bits=0) const
APValue toAPValue (const ASTContext &) 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
void bitcastToMemory (std::byte *Dest) const
ComparisonCategoryResult compare (const IntegralAP &RHS) const
size_t bytesToSerialize () const
void serialize (std::byte *Buff) const

Static Public Member Functions

template<typename T, bool InputSigned>
static T truncateCast (const APInt &V)
template<typename T>
static IntegralAP from (T Value, unsigned NumBits=0)
static constexpr bool isSigned ()
static void bitcastFromMemory (const std::byte *Src, unsigned BitWidth, IntegralAP *Result)
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 uint32_t deserializeSize (const std::byte *Buff)
static void deserialize (const std::byte *Buff, IntegralAP< Signed > *Result)

Public Attributes

union { 
   uint64_t *   Memory = nullptr 
   uint64_t   Val 
}; 
uint32_t BitWidth = 0
friend IntegralAP<!Signed >

Detailed Description

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

If an IntegralAP is constructed from Memory, it DOES NOT OWN THAT MEMORY.

It will NOT copy the memory (unless, of course, copy() is called) and it won't alllocate anything. The allocation should happen via InterpState or Program.

Definition at line 36 of file IntegralAP.h.

Member Typedef Documentation

◆ AsUnsigned

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

Definition at line 70 of file IntegralAP.h.

Constructor & Destructor Documentation

◆ IntegralAP() [1/4]

◆ IntegralAP() [2/4]

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

Zeroed, single-word IntegralAP of the given bitwidth.

Definition at line 95 of file IntegralAP.h.

◆ IntegralAP() [3/4]

template<bool Signed>
clang::interp::IntegralAP< Signed >::IntegralAP ( uint64_t * Memory,
unsigned BitWidth )
inline

Definition at line 98 of file IntegralAP.h.

◆ IntegralAP() [4/4]

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

Definition at line 100 of file IntegralAP.h.

Member Function Documentation

◆ add()

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

Definition at line 244 of file IntegralAP.h.

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

◆ bitAnd()

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

Definition at line 272 of file IntegralAP.h.

◆ bitcastFromMemory()

template<bool Signed>
void clang::interp::IntegralAP< Signed >::bitcastFromMemory ( const std::byte * Src,
unsigned BitWidth,
IntegralAP< Signed > * Result )
inlinestatic

Definition at line 206 of file IntegralAP.h.

Referenced by clang::interp::DoBitCastPtr().

◆ bitcastToMemory()

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

Definition at line 202 of file IntegralAP.h.

◆ bitOr()

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

Definition at line 278 of file IntegralAP.h.

◆ bitWidth()

◆ bitXor()

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

Definition at line 284 of file IntegralAP.h.

◆ bytesToSerialize()

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

Definition at line 317 of file IntegralAP.h.

◆ comp()

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

Definition at line 297 of file IntegralAP.h.

◆ compare()

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

Definition at line 213 of file IntegralAP.h.

◆ copy()

◆ countLeadingZeros()

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

Definition at line 179 of file IntegralAP.h.

◆ decrement()

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

Definition at line 239 of file IntegralAP.h.

◆ deserialize()

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

Definition at line 336 of file IntegralAP.h.

◆ deserializeSize()

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

Definition at line 332 of file IntegralAP.h.

◆ div()

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

Definition at line 264 of file IntegralAP.h.

◆ from()

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

Definition at line 130 of file IntegralAP.h.

◆ getValue()

◆ increment()

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

Definition at line 234 of file IntegralAP.h.

◆ isMax()

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

Definition at line 171 of file IntegralAP.h.

◆ isMin()

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

Definition at line 166 of file IntegralAP.h.

◆ isMinusOne()

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

Definition at line 177 of file IntegralAP.h.

◆ isNegative()

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

Definition at line 161 of file IntegralAP.h.

◆ isPositive()

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

Definition at line 156 of file IntegralAP.h.

◆ isSigned()

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

Definition at line 176 of file IntegralAP.h.

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

◆ isZero()

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

Definition at line 155 of file IntegralAP.h.

◆ mul()

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

Definition at line 252 of file IntegralAP.h.

◆ neg()

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

Definition at line 290 of file IntegralAP.h.

◆ numWords()

◆ 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 126 of file IntegralAP.h.

◆ operator-()

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

Definition at line 108 of file IntegralAP.h.

◆ operator<()

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

Definition at line 119 of file IntegralAP.h.

◆ operator>()

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

Definition at line 109 of file IntegralAP.h.

◆ operator>=()

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

Definition at line 114 of file IntegralAP.h.

◆ print()

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

◆ rem()

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

Definition at line 256 of file IntegralAP.h.

◆ serialize()

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

Definition at line 322 of file IntegralAP.h.

◆ shiftLeft()

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

Definition at line 302 of file IntegralAP.h.

◆ shiftRight()

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

Definition at line 307 of file IntegralAP.h.

◆ singleWord()

◆ sub()

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

Definition at line 248 of file IntegralAP.h.

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

◆ take()

template<bool Signed>
void clang::interp::IntegralAP< Signed >::take ( uint64_t * NewMemory)
inline

Definition at line 72 of file IntegralAP.h.

◆ toAPSInt()

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

Definition at line 143 of file IntegralAP.h.

Referenced by clang::interp::IntegralAP< false >::toAPValue().

◆ toAPValue()

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

Definition at line 153 of file IntegralAP.h.

◆ toDiagnosticString()

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

Definition at line 182 of file IntegralAP.h.

◆ toUnsigned()

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

Definition at line 198 of file IntegralAP.h.

◆ truncate()

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

Definition at line 189 of file IntegralAP.h.

◆ truncateCast()

template<bool Signed>
template<typename T, bool InputSigned>
T clang::interp::IntegralAP< Signed >::truncateCast ( const APInt & V)
inlinestatic

Definition at line 46 of file IntegralAP.h.

Referenced by clang::interp::IntegralAP< false >::operator Ty().

Member Data Documentation

◆ [union]

◆ BitWidth

template<bool Signed>
uint32_t clang::interp::IntegralAP< Signed >::BitWidth = 0

Definition at line 42 of file IntegralAP.h.

◆ IntegralAP<!Signed >

Definition at line 43 of file IntegralAP.h.

◆ Memory

template<bool Signed>
uint64_t* clang::interp::IntegralAP< Signed >::Memory = nullptr

Definition at line 39 of file IntegralAP.h.

◆ Val

template<bool Signed>
uint64_t clang::interp::IntegralAP< Signed >::Val

Definition at line 40 of file IntegralAP.h.


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