clang 22.0.0git
clang::interp::Pointer Class Reference

A pointer to a memory block, live or dead. More...

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

Public Member Functions

 Pointer ()
 Pointer (IntPointer &&IntPtr)
 Pointer (Block *B)
 Pointer (Block *B, uint64_t BaseAndOffset)
 Pointer (const Pointer &P)
 Pointer (Pointer &&P)
 Pointer (uint64_t Address, const Descriptor *Desc, uint64_t Offset=0)
 Pointer (const Function *F, uint64_t Offset=0)
 Pointer (const Type *TypePtr, const Type *TypeInfoType, uint64_t Offset=0)
 Pointer (Block *Pointee, unsigned Base, uint64_t Offset)
 ~Pointer ()
Pointeroperator= (const Pointer &P)
Pointeroperator= (Pointer &&P)
bool operator== (const Pointer &P) const
 Equality operators are just for tests.
bool operator!= (const Pointer &P) const
APValue toAPValue (const ASTContext &ASTCtx) const
 Converts the pointer to an APValue.
std::string toDiagnosticString (const ASTContext &Ctx) const
 Converts the pointer to a string usable in diagnostics.
uint64_t getIntegerRepresentation () const
std::optional< APValuetoRValue (const Context &Ctx, QualType ResultType) const
 Converts the pointer to an APValue that is an rvalue.
Pointer atIndex (uint64_t Idx) const
 Offsets a pointer inside an array.
Pointer atField (unsigned Off) const
 Creates a pointer to a field.
Pointer atFieldSub (unsigned Off) const
 Subtract the given offset from the current Base and Offset of the pointer.
Pointer narrow () const
 Restricts the scope of an array element pointer.
Pointer expand () const
 Expands a pointer to the containing array, undoing narrowing.
bool isZero () const
 Checks if the pointer is null.
bool isLive () const
 Checks if the pointer is live.
bool isField () const
 Checks if the item is a field in an object.
const DescriptorgetDeclDesc () const
 Accessor for information about the declaration site.
SourceLocation getDeclLoc () const
DeclTy getSource () const
 Returns the expression or declaration the pointer has been created for.
Pointer getBase () const
 Returns a pointer to the object of which this pointer is a field.
Pointer getArray () const
 Returns the parent array.
const DescriptorgetFieldDesc () const
 Accessors for information about the innermost field.
QualType getType () const
 Returns the type of the innermost field.
Pointer getDeclPtr () const
size_t elemSize () const
 Returns the element size of the innermost field.
size_t getSize () const
 Returns the total size of the innermost field.
unsigned getOffset () const
 Returns the offset into an array.
bool isArrayRoot () const
 Whether this array refers to an array, but not to the first element.
bool inArray () const
 Checks if the innermost field is an array.
bool inUnion () const
bool inPrimitiveArray () const
 Checks if the structure is a primitive array.
bool isUnknownSizeArray () const
 Checks if the structure is an array of unknown size.
bool isArrayElement () const
 Checks if the pointer points to an array.
bool isRoot () const
 Pointer points directly to a block.
bool canBeInitialized () const
 If this pointer has an InlineDescriptor we can use to initialize.
const BlockPointerasBlockPointer () const
const IntPointerasIntPointer () const
const FunctionPointerasFunctionPointer () const
const TypeidPointerasTypeidPointer () const
bool isBlockPointer () const
bool isIntegralPointer () const
bool isFunctionPointer () const
bool isTypeidPointer () const
const RecordgetRecord () const
 Returns the record descriptor of a class.
const RecordgetElemRecord () const
 Returns the element record type, if this is a non-primive array.
const FieldDeclgetField () const
 Returns the field information.
bool isExtern () const
 Checks if the storage is extern.
bool isStatic () const
 Checks if the storage is static.
bool isTemporary () const
 Checks if the storage is temporary.
bool isDynamic () const
 Checks if the storage has been dynamically allocated.
bool isStaticTemporary () const
 Checks if the storage is a static temporary.
bool isMutable () const
 Checks if the field is mutable.
bool isWeak () const
bool isActive () const
 Checks if the object is active.
bool isBaseClass () const
 Checks if a structure is a base class.
bool isVirtualBaseClass () const
bool isDummy () const
 Checks if the pointer points to a dummy value.
bool isConst () const
 Checks if an object or a subfield is mutable.
bool isConstInMutable () const
bool isVolatile () const
 Checks if an object or a subfield is volatile.
UnsignedOrNone getDeclID () const
 Returns the declaration ID.
uint64_t getByteOffset () const
 Returns the byte offset from the start.
unsigned getNumElems () const
 Returns the number of elements.
const Blockblock () const
const std::byte * getRawAddress () const
 If backed by actual data (i.e.
int64_t getIndex () const
 Returns the index into an array.
bool isOnePastEnd () const
 Checks if the index is one past end.
bool isPastEnd () const
 Checks if the pointer points past the end of the object.
bool isElementPastEnd () const
 Checks if the pointer is an out-of-bounds element pointer.
bool isZeroSizeArray () const
 Checks if the pointer is pointing to a zero-size array.
template<typename T>
Tderef () const
 Dereferences the pointer, if it's live.
template<typename T>
Telem (unsigned I) const
 Dereferences the element at index I.
bool isDereferencable () const
 Whether this block can be read from at all.
void initialize () const
 Initializes a field.
void initializeAllElements () const
 Initialize all elements of a primitive array at once.
bool isInitialized () const
 Checks if an object was initialized.
bool isElementInitialized (unsigned Index) const
 Like isInitialized(), but for primitive arrays.
bool allElementsInitialized () const
void activate () const
 Activats a field.
void deactivate () const
 Deactivates an entire strurcutre.
Lifetime getLifetime () const
void endLifetime () const
void startLifetime () const
ComparisonCategoryResult compare (const Pointer &Other) const
 Compare two pointers.
bool pointsToLiteral () const
 Whether this points to a block that's been created for a "literal lvalue", i.e.
bool pointsToStringLiteral () const
void print (llvm::raw_ostream &OS) const
 Prints the pointer.
size_t computeOffsetForComparison () const
 Compute an integer that can be used to compare this pointer to another one.

Static Public Member Functions

static bool hasSameBase (const Pointer &A, const Pointer &B)
 Checks if two pointers are comparable.
static bool hasSameArray (const Pointer &A, const Pointer &B)
 Checks if two pointers can be subtracted.
static bool pointToSameBlock (const Pointer &A, const Pointer &B)
 Checks if both given pointers point to the same block.
static std::optional< std::pair< Pointer, Pointer > > computeSplitPoint (const Pointer &A, const Pointer &B)

Friends

class Block
class DeadBlock
class MemberPointer
class InterpState
struct InitMap
class DynamicAllocator
class Program

Detailed Description

A pointer to a memory block, live or dead.

This object can be allocated into interpreter stack frames. If pointing to a live block, it is a link in the chain of pointers pointing to the block.

In the simplest form, a Pointer has a Block* (the pointee) and both Base and Offset are 0, which means it will point to raw data.

The Base field is used to access metadata about the data. For primitive arrays, the Base is followed by an InitMap. In a variety of cases, the Base is preceded by an InlineDescriptor, which is used to track the initialization state, among other things.

The Offset field is used to access the actual data. In other words, the data the pointer decribes can be found at Pointee->rawData() + Pointer.Offset.

/// Pointee                      Offset
/// │                              │
/// │                              │
/// ▼                              ▼
/// ┌───────┬────────────┬─────────┬────────────────────────────┐
/// │ Block │ InlineDesc │ InitMap │ Actual Data                │
/// └───────┴────────────┴─────────┴────────────────────────────┘
///                      ▲
///                      │
///                      │
///                     Base
/// 

Definition at line 91 of file Pointer.h.

Constructor & Destructor Documentation

◆ Pointer() [1/10]

◆ Pointer() [2/10]

clang::interp::Pointer::Pointer ( IntPointer && IntPtr)
inline

Definition at line 98 of file Pointer.h.

References Int.

◆ Pointer() [3/10]

Pointer::Pointer ( Block * B)

Definition at line 26 of file Pointer.cpp.

References Block, and Pointer().

◆ Pointer() [4/10]

Pointer::Pointer ( Block * B,
uint64_t BaseAndOffset )

Definition at line 30 of file Pointer.cpp.

References Block, and Pointer().

◆ Pointer() [5/10]

Pointer::Pointer ( const Pointer & P)

◆ Pointer() [6/10]

Pointer::Pointer ( Pointer && P)

◆ Pointer() [7/10]

clang::interp::Pointer::Pointer ( uint64_t Address,
const Descriptor * Desc,
uint64_t Offset = 0 )
inline

Definition at line 104 of file Pointer.h.

References Int.

◆ Pointer() [8/10]

clang::interp::Pointer::Pointer ( const Function * F,
uint64_t Offset = 0 )
inline

Definition at line 106 of file Pointer.h.

References Fn.

◆ Pointer() [9/10]

clang::interp::Pointer::Pointer ( const Type * TypePtr,
const Type * TypeInfoType,
uint64_t Offset = 0 )
inline

Definition at line 108 of file Pointer.h.

References Typeid.

◆ Pointer() [10/10]

Pointer::Pointer ( Block * Pointee,
unsigned Base,
uint64_t Offset )

Definition at line 33 of file Pointer.cpp.

References Block, and BS.

◆ ~Pointer()

Pointer::~Pointer ( )

Definition at line 82 of file Pointer.cpp.

References Block, BS, and isBlockPointer().

Member Function Documentation

◆ activate()

◆ allElementsInitialized()

◆ asBlockPointer()

const BlockPointer & clang::interp::Pointer::asBlockPointer ( ) const
inlinenodiscard

◆ asFunctionPointer()

const FunctionPointer & clang::interp::Pointer::asFunctionPointer ( ) const
inlinenodiscard

◆ asIntPointer()

const IntPointer & clang::interp::Pointer::asIntPointer ( ) const
inlinenodiscard

◆ asTypeidPointer()

const TypeidPointer & clang::interp::Pointer::asTypeidPointer ( ) const
inlinenodiscard

Definition at line 460 of file Pointer.h.

References isTypeidPointer(), and Typeid.

Referenced by computeOffsetForComparison(), and print().

◆ atField()

◆ atFieldSub()

Pointer clang::interp::Pointer::atFieldSub ( unsigned Off) const
inlinenodiscard

Subtract the given offset from the current Base and Offset of the pointer.

Definition at line 181 of file Pointer.h.

References BS, and Pointer().

Referenced by clang::interp::MemberPointer::getBase(), and clang::interp::GetPtrDerivedPop().

◆ atIndex()

◆ block()

◆ canBeInitialized()

◆ compare()

ComparisonCategoryResult clang::interp::Pointer::compare ( const Pointer & Other) const
inline

Compare two pointers.

Definition at line 744 of file Pointer.h.

References clang::Equal, clang::Greater, hasSameBase(), clang::Less, clang::Other, Pointer(), and clang::Unordered.

◆ computeOffsetForComparison()

◆ computeSplitPoint()

std::optional< std::pair< Pointer, Pointer > > Pointer::computeSplitPoint ( const Pointer & A,
const Pointer & B )
static

◆ deactivate()

void Pointer::deactivate ( ) const

Deactivates an entire strurcutre.

Definition at line 614 of file Pointer.cpp.

Referenced by activate().

◆ deref()

◆ elem()

◆ elemSize()

◆ endLifetime()

void clang::interp::Pointer::endLifetime ( ) const
inline

Definition at line 727 of file Pointer.h.

References BS, clang::interp::Ended, and isBlockPointer().

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

◆ expand()

◆ getArray()

Pointer clang::interp::Pointer::getArray ( ) const
inlinenodiscard

Returns the parent array.

Definition at line 313 of file Pointer.h.

References BS, and Pointer().

Referenced by computeOffsetForComparison(), clang::interp::computePointerOffset(), clang::interp::pointsToLastObject(), and toAPValue().

◆ getBase()

◆ getByteOffset()

uint64_t clang::interp::Pointer::getByteOffset ( ) const
inline

◆ getDeclDesc()

◆ getDeclID()

UnsignedOrNone clang::interp::Pointer::getDeclID ( ) const
inline

Returns the declaration ID.

Definition at line 573 of file Pointer.h.

References BS, and isBlockPointer().

Referenced by clang::interp::CheckConstant(), and CheckGlobal().

◆ getDeclLoc()

SourceLocation clang::interp::Pointer::getDeclLoc ( ) const
inline

◆ getDeclPtr()

Pointer clang::interp::Pointer::getDeclPtr ( ) const
inlinenodiscard

Definition at line 352 of file Pointer.h.

References BS, and Pointer().

Referenced by clang::interp::CheckDowncast(), and toAPValue().

◆ getElemRecord()

const Record * clang::interp::Pointer::getElemRecord ( ) const
inline

Returns the element record type, if this is a non-primive array.

Definition at line 473 of file Pointer.h.

References clang::interp::Descriptor::ElemDesc, clang::interp::Descriptor::ElemRecord, and getFieldDesc().

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

◆ getField()

const FieldDecl * clang::interp::Pointer::getField ( ) const
inline

◆ getFieldDesc()

const Descriptor * clang::interp::Pointer::getFieldDesc ( ) const
inline

Accessors for information about the innermost field.

Definition at line 323 of file Pointer.h.

References getDeclDesc(), Int, isIntegralPointer(), and isRoot().

Referenced by allElementsInitialized(), clang::interp::ArrayElem(), clang::interp::ArrayElemPop(), atIndex(), clang::interp::CallVirt(), clang::interp::checkConstructor(), clang::interp::CheckNewTypeMismatch(), clang::interp::CheckVolatile(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::collectBlocks(), clang::interp::computePointerOffset(), clang::interp::convertBoolVectorToInt(), clang::interp::copyComposite(), clang::interp::copyRecord(), clang::interp::DoBitCast(), clang::interp::DoBitCastPtr(), elem(), elemSize(), clang::interp::endLifetimeRecurse(), enumerateData(), clang::interp::Context::evaluateStrlen(), clang::interp::finishGlobalRecurse(), getElemRecord(), clang::interp::getElemType(), getField(), getOffset(), getRecord(), getSize(), getType(), hasSameArray(), inArray(), initialize(), initializeAllElements(), inPrimitiveArray(), clang::interp::interp__builtin_elementwise_abs(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_elementwise_popcount(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_object_size(), clang::interp::interp__builtin_operator_delete(), clang::interp::interp__builtin_select(), clang::interp::interp__builtin_strcmp(), clang::interp::interp__builtin_strlen(), clang::interp::interp__builtin_vector_reduce(), isElementInitialized(), isField(), isInitialized(), isUnknownSizeArray(), clang::interp::isUserWritingOffTheEnd(), isZeroSizeArray(), clang::interp::OffsetHelper(), clang::interp::startLifetimeRecurse(), toAPValue(), toRValue(), and clang::interp::zeroAll().

◆ getIndex()

◆ getIntegerRepresentation()

◆ getLifetime()

◆ getNumElems()

◆ getOffset()

unsigned clang::interp::Pointer::getOffset ( ) const
inline

Returns the offset into an array.

Definition at line 373 of file Pointer.h.

References BS, getFieldDesc(), and isBlockPointer().

Referenced by clang::interp::CmpHelperEQ< Pointer >(), getIndex(), and isOnePastEnd().

◆ getRawAddress()

const std::byte * clang::interp::Pointer::getRawAddress ( ) const
inline

If backed by actual data (i.e.

a block pointer), return an address to that data.

Definition at line 603 of file Pointer.h.

References BS, and isBlockPointer().

Referenced by clang::interp::arePotentiallyOverlappingStringLiterals(), and clang::interp::Context::evaluateStrlen().

◆ getRecord()

◆ getSize()

size_t clang::interp::Pointer::getSize ( ) const
inline

Returns the total size of the innermost field.

Definition at line 367 of file Pointer.h.

References getFieldDesc(), clang::interp::Descriptor::getSize(), and isBlockPointer().

Referenced by atIndex(), expand(), getNumElems(), and isOnePastEnd().

◆ getSource()

DeclTy clang::interp::Pointer::getSource ( ) const
inline

Returns the expression or declaration the pointer has been created for.

Definition at line 292 of file Pointer.h.

References Fn, clang::interp::Function::getDecl(), getDeclDesc(), clang::interp::Descriptor::getSource(), Int, isBlockPointer(), isFunctionPointer(), and isIntegralPointer().

◆ getType()

◆ hasSameArray()

bool Pointer::hasSameArray ( const Pointer & A,
const Pointer & B )
static

Checks if two pointers can be subtracted.

Definition at line 642 of file Pointer.cpp.

References clang::interp::BlockPointer::Base, BS, getFieldDesc(), hasSameBase(), clang::interp::Descriptor::IsArray, and Pointer().

◆ hasSameBase()

◆ inArray()

bool clang::interp::Pointer::inArray ( ) const
inline

Checks if the innermost field is an array.

Definition at line 394 of file Pointer.h.

References getFieldDesc(), clang::interp::Descriptor::IsArray, and isBlockPointer().

Referenced by isArrayElement(), isArrayRoot(), and clang::interp::OffsetHelper().

◆ initialize()

◆ initializeAllElements()

void Pointer::initializeAllElements ( ) const

◆ inPrimitiveArray()

bool clang::interp::Pointer::inPrimitiveArray ( ) const
inline

Checks if the structure is a primitive array.

Definition at line 406 of file Pointer.h.

References getFieldDesc(), isBlockPointer(), and clang::interp::Descriptor::isPrimitiveArray().

Referenced by expand(), getType(), and narrow().

◆ inUnion()

bool clang::interp::Pointer::inUnion ( ) const
inline

Definition at line 399 of file Pointer.h.

References BS, and isBlockPointer().

Referenced by activate(), clang::interp::CheckActive(), and clang::interp::CheckNewTypeMismatch().

◆ isActive()

bool clang::interp::Pointer::isActive ( ) const
inline

◆ isArrayElement()

bool clang::interp::Pointer::isArrayElement ( ) const
inline

◆ isArrayRoot()

bool clang::interp::Pointer::isArrayRoot ( ) const
inline

Whether this array refers to an array, but not to the first element.

Definition at line 391 of file Pointer.h.

References BS, and inArray().

Referenced by allElementsInitialized(), deref(), initializeAllElements(), and toAPValue().

◆ isBaseClass()

◆ isBlockPointer()

bool clang::interp::Pointer::isBlockPointer ( ) const
inline

Definition at line 465 of file Pointer.h.

References clang::interp::Block.

Referenced by asBlockPointer(), atField(), canBeInitialized(), clang::interp::CheckConst(), clang::interp::CheckConstant(), clang::interp::CheckFinalLoad(), clang::interp::CheckLoad(), clang::interp::CheckNewTypeMismatch(), clang::interp::CheckPointerToIntegralCast(), clang::interp::CheckStore(), computeOffsetForComparison(), computeSplitPoint(), deref(), clang::interp::DoBitCast(), clang::interp::DoBitCastPtr(), clang::interp::DoMemcpy(), elem(), endLifetime(), expand(), clang::interp::ExpandPtr(), getDeclDesc(), getDeclID(), clang::interp::getField(), getIndex(), getLifetime(), getNumElems(), getOffset(), clang::interp::GetPtrBase(), clang::interp::GetPtrBasePop(), clang::interp::GetPtrDerivedPop(), getRawAddress(), getSize(), getSource(), inArray(), initialize(), inPrimitiveArray(), clang::interp::interp__builtin_assume_aligned(), clang::interp::interp__builtin_object_size(), clang::interp::interp__builtin_strcmp(), inUnion(), isActive(), isArrayElement(), clang::interp::isConstexprUnknown(), isConstInMutable(), isDereferencable(), isDummy(), isDynamic(), isElementInitialized(), isExtern(), isField(), isInitialized(), isLive(), isMutable(), isOnePastEnd(), isRoot(), isStatic(), isTemporary(), isUnknownSizeArray(), isVolatile(), isWeak(), isZero(), clang::interp::Load(), clang::interp::LoadPop(), narrow(), clang::interp::OffsetHelper(), operator=(), operator=(), operator==(), pointsToLiteral(), pointsToStringLiteral(), pointToSameBlock(), startLifetime(), clang::interp::SubPtr(), and ~Pointer().

◆ isConst()

bool clang::interp::Pointer::isConst ( ) const
inline

Checks if an object or a subfield is mutable.

Definition at line 554 of file Pointer.h.

References getDeclDesc(), clang::interp::Descriptor::IsConst, isIntegralPointer(), and isRoot().

Referenced by clang::interp::CheckConst(), and clang::interp::CheckExtern().

◆ isConstInMutable()

bool clang::interp::Pointer::isConstInMutable ( ) const
inline

Definition at line 559 of file Pointer.h.

References false, isBlockPointer(), and isRoot().

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

◆ isDereferencable()

bool clang::interp::Pointer::isDereferencable ( ) const
inline

Whether this block can be read from at all.

This is only true for block pointers that point to a valid location inside that block.

Definition at line 694 of file Pointer.h.

References isBlockPointer(), and isPastEnd().

Referenced by deref(), and elem().

◆ isDummy()

◆ isDynamic()

bool clang::interp::Pointer::isDynamic ( ) const
inline

Checks if the storage has been dynamically allocated.

Definition at line 506 of file Pointer.h.

References BS, and isBlockPointer().

Referenced by clang::interp::CheckLive(), pointsToLiteral(), pointsToStringLiteral(), and toAPValue().

◆ isElementInitialized()

◆ isElementPastEnd()

bool clang::interp::Pointer::isElementPastEnd ( ) const
inline

Checks if the pointer is an out-of-bounds element pointer.

Definition at line 648 of file Pointer.h.

Referenced by clang::interp::CheckRange(), expand(), print(), and clang::interp::SubPtr().

◆ isExtern()

bool clang::interp::Pointer::isExtern ( ) const
inline

Checks if the storage is extern.

Definition at line 485 of file Pointer.h.

References BS, and isBlockPointer().

Referenced by clang::interp::CheckExtern(), and clang::interp::DiagnoseUninitialized().

◆ isField()

bool clang::interp::Pointer::isField ( ) const
inline

◆ isFunctionPointer()

◆ isInitialized()

◆ isIntegralPointer()

◆ isLive()

◆ isMutable()

bool clang::interp::Pointer::isMutable ( ) const
inline

Checks if the field is mutable.

Definition at line 517 of file Pointer.h.

References isBlockPointer(), and isRoot().

Referenced by clang::interp::CheckConst(), and clang::interp::CheckMutable().

◆ isOnePastEnd()

◆ isPastEnd()

bool clang::interp::Pointer::isPastEnd ( ) const
inline

Checks if the pointer points past the end of the object.

Definition at line 640 of file Pointer.h.

References BS, isIntegralPointer(), and isZero().

Referenced by isDereferencable(), isOnePastEnd(), and toRValue().

◆ isRoot()

◆ isStatic()

bool clang::interp::Pointer::isStatic ( ) const
inline

Checks if the storage is static.

Definition at line 491 of file Pointer.h.

References BS, and isBlockPointer().

Referenced by allElementsInitialized(), clang::interp::CheckConstant(), CheckGlobal(), initialize(), isElementInitialized(), and isStaticTemporary().

◆ isStaticTemporary()

bool clang::interp::Pointer::isStaticTemporary ( ) const
inline

Checks if the storage is a static temporary.

Definition at line 514 of file Pointer.h.

References isStatic(), and isTemporary().

◆ isTemporary()

bool clang::interp::Pointer::isTemporary ( ) const
inline

Checks if the storage is temporary.

Definition at line 498 of file Pointer.h.

References BS, and isBlockPointer().

Referenced by clang::interp::CheckDeleteSource(), clang::interp::CheckLive(), and isStaticTemporary().

◆ isTypeidPointer()

◆ isUnknownSizeArray()

bool clang::interp::Pointer::isUnknownSizeArray ( ) const
inline

◆ isVirtualBaseClass()

bool clang::interp::Pointer::isVirtualBaseClass ( ) const
inline

Definition at line 540 of file Pointer.h.

References isField().

Referenced by computeOffsetForComparison(), clang::interp::computePointerOffset(), and toAPValue().

◆ isVolatile()

bool clang::interp::Pointer::isVolatile ( ) const
inline

Checks if an object or a subfield is volatile.

Definition at line 566 of file Pointer.h.

References getDeclDesc(), isBlockPointer(), isRoot(), and clang::interp::Descriptor::IsVolatile.

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

◆ isWeak()

bool clang::interp::Pointer::isWeak ( ) const
inline

Definition at line 523 of file Pointer.h.

References BS, Fn, isBlockPointer(), and isFunctionPointer().

◆ isZero()

◆ isZeroSizeArray()

bool clang::interp::Pointer::isZeroSizeArray ( ) const
inline

Checks if the pointer is pointing to a zero-size array.

Definition at line 651 of file Pointer.h.

References getFieldDesc(), and isFunctionPointer().

Referenced by clang::interp::ArrayDecay(), clang::interp::CheckRange(), clang::interp::CheckRange(), clang::interp::Free(), and toAPValue().

◆ narrow()

◆ operator!=()

bool clang::interp::Pointer::operator!= ( const Pointer & P) const
inline

Definition at line 135 of file Pointer.h.

References Pointer().

◆ operator=() [1/2]

◆ operator=() [2/2]

Pointer & Pointer::operator= ( Pointer && P)

Definition at line 130 of file Pointer.cpp.

References Block, BS, Fn, Int, isBlockPointer(), Pointer(), and Typeid.

◆ operator==()

◆ pointsToLiteral()

bool Pointer::pointsToLiteral ( ) const

Whether this points to a block that's been created for a "literal lvalue", i.e.

a non-MaterializeTemporaryExpr Expr.

Definition at line 647 of file Pointer.cpp.

References clang::interp::Descriptor::asExpr(), block(), clang::interp::Block::getDescriptor(), clang::isa(), isBlockPointer(), isDynamic(), and isZero().

◆ pointsToStringLiteral()

bool Pointer::pointsToStringLiteral ( ) const

◆ pointToSameBlock()

bool Pointer::pointToSameBlock ( const Pointer & A,
const Pointer & B )
static

Checks if both given pointers point to the same block.

Definition at line 636 of file Pointer.cpp.

References block(), isBlockPointer(), and Pointer().

Referenced by clang::interp::interp__builtin_memcpy(), and clang::interp::runRecordDestructor().

◆ print()

◆ startLifetime()

void clang::interp::Pointer::startLifetime ( ) const
inline

Definition at line 735 of file Pointer.h.

References BS, isBlockPointer(), and clang::interp::Started.

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

◆ toAPValue()

APValue Pointer::toAPValue ( const ASTContext & ASTCtx) const

Converts the pointer to an APValue.

Definition at line 167 of file Pointer.cpp.

References clang::APValue, clang::APValue::LValuePathEntry::ArrayIndex(), clang::interp::Descriptor::asDecl(), clang::interp::Descriptor::asExpr(), asFunctionPointer(), asIntPointer(), clang::interp::Descriptor::asValueDecl(), block(), clang::cast(), expand(), clang::CharUnits::fromQuantity(), getArray(), clang::Type::getAsRecordDecl(), clang::ASTContext::getASTRecordLayout(), getBase(), clang::ASTRecordLayout::getBaseClassOffset(), clang::interp::Descriptor::getDataType(), clang::interp::Function::getDecl(), clang::interp::Record::getDecl(), getDeclDesc(), getDeclPtr(), clang::RecordDecl::getDefinition(), clang::APValue::LValueBase::getDynamicAlloc(), clang::interp::Descriptor::getElemQualType(), clang::interp::Function::getExpr(), getFieldDesc(), clang::ASTRecordLayout::getFieldOffset(), getFieldOffset(), clang::interp::FunctionPointer::getFunction(), getIndex(), getNumElems(), getRecord(), clang::interp::Descriptor::getType(), getType(), clang::APValue::LValueBase::getTypeInfo(), clang::ASTContext::getTypeSizeInChars(), clang::ASTRecordLayout::getVBaseClassOffset(), isArrayElement(), isArrayRoot(), clang::Type::isArrayType(), isDynamic(), isField(), isFunctionPointer(), isIntegralPointer(), isOnePastEnd(), isTypeidPointer(), isUnknownSizeArray(), isVirtualBaseClass(), isZero(), isZeroSizeArray(), Pointer(), clang::ASTContext::toCharUnitsFromBits(), Typeid, and clang::CharUnits::Zero().

Referenced by clang::interp::interp__builtin_assume_aligned(), toDiagnosticString(), and toRValue().

◆ toDiagnosticString()

◆ toRValue()

◆ Block

friend class Block
friend

Definition at line 780 of file Pointer.h.

References Block.

Referenced by Block, block(), expand(), isDummy(), operator=(), operator=(), Pointer(), Pointer(), Pointer(), print(), and ~Pointer().

◆ DeadBlock

friend class DeadBlock
friend

Definition at line 781 of file Pointer.h.

References DeadBlock.

Referenced by DeadBlock.

◆ DynamicAllocator

friend class DynamicAllocator
friend

Definition at line 785 of file Pointer.h.

References DynamicAllocator.

Referenced by DynamicAllocator.

◆ InitMap

friend struct InitMap
friend

Definition at line 784 of file Pointer.h.

References InitMap.

Referenced by InitMap.

◆ InterpState

friend class InterpState
friend

Definition at line 783 of file Pointer.h.

References InterpState.

Referenced by InterpState.

◆ MemberPointer

friend class MemberPointer
friend

Definition at line 782 of file Pointer.h.

References MemberPointer.

Referenced by MemberPointer.

◆ Program

friend class Program
friend

Definition at line 786 of file Pointer.h.

References BS, and Program.

Referenced by Program.

Member Data Documentation

◆ BS

◆ Fn

◆ Int

◆ Typeid

TypeidPointer clang::interp::Pointer::Typeid

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