clang 24.0.0git
clang::interp::OpaquePointer Struct Reference

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

Public Member Functions

ArrayRef< PointerPathEntrypath () const
OpaquePointer withFieldType (const Type *FieldTy, std::optional< bool > PastEnd=std::nullopt) const
OpaquePointer withPath (const PointerPathEntry *Path, unsigned PathLength, const Type *FieldTy, std::optional< bool > PastEnd=std::nullopt) const
OpaquePointer withPastEnd (bool PastEnd) const
QualType getObjectType () const
QualType getFieldType () const
bool isArrayElement () const
std::optional< size_tcomputeLayoutOffset (const ASTContext &ASTCtx) const
QualType getSurroundingArray () const
 If this is pointing to an array element, return the array.
bool isOnePastEnd () const
bool isOnePastEndOrElementPastEnd () const
 This is used in Pointer::isOnePastEnd().
bool isConstexprUnknown () const
bool isUnknownSizeArray () const
bool isRoot () const
 Check if the pointer has offset 0.

Public Attributes

const ValueDeclBase = nullptr
llvm::PointerIntPair< const Type *, 2, unsignedFieldType = {}
const PointerPathEntryPath = nullptr
unsigned PathLength = 0

Detailed Description

Definition at line 432 of file Pointer.h.

Member Function Documentation

◆ computeLayoutOffset()

◆ getFieldType()

QualType clang::interp::OpaquePointer::getFieldType ( ) const
inline

◆ getObjectType()

QualType clang::interp::OpaquePointer::getObjectType ( ) const
inline

◆ getSurroundingArray()

◆ isArrayElement()

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

◆ isConstexprUnknown()

bool clang::interp::OpaquePointer::isConstexprUnknown ( ) const
inline

Definition at line 493 of file Pointer.h.

References FieldType.

Referenced by withFieldType(), and withPath().

◆ isOnePastEnd()

bool clang::interp::OpaquePointer::isOnePastEnd ( ) const
inline

Definition at line 491 of file Pointer.h.

References FieldType.

Referenced by isOnePastEndOrElementPastEnd().

◆ isOnePastEndOrElementPastEnd()

bool OpaquePointer::isOnePastEndOrElementPastEnd ( ) const

This is used in Pointer::isOnePastEnd().

We cannot read from such pointers. We can of course never read from opaque pointers anyway but we diagnose one-past-the-end pointers differently.

In contrast, OpaquePointer::isOnePastEnd() only uses the past-end bit. That is used for the APValue conversion.

Definition at line 1429 of file Pointer.cpp.

References clang::interp::PointerPathEntry::Array, clang::Type::getAsArrayTypeUnsafe(), getSurroundingArray(), clang::Type::isArrayType(), isOnePastEnd(), Path, and PathLength.

◆ isRoot()

◆ isUnknownSizeArray()

bool OpaquePointer::isUnknownSizeArray ( ) const

◆ path()

ArrayRef< PointerPathEntry > clang::interp::OpaquePointer::path ( ) const
inline

◆ withFieldType()

OpaquePointer clang::interp::OpaquePointer::withFieldType ( const Type * FieldTy,
std::optional< bool > PastEnd = std::nullopt ) const
inline

◆ withPastEnd()

OpaquePointer clang::interp::OpaquePointer::withPastEnd ( bool PastEnd) const
inline

Definition at line 461 of file Pointer.h.

References Base, FieldType, Path, and PathLength.

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

◆ withPath()

OpaquePointer clang::interp::OpaquePointer::withPath ( const PointerPathEntry * Path,
unsigned PathLength,
const Type * FieldTy,
std::optional< bool > PastEnd = std::nullopt ) const
inline

Member Data Documentation

◆ Base

◆ FieldType

llvm::PointerIntPair<const Type *, 2, unsigned> clang::interp::OpaquePointer::FieldType = {}

◆ Path

◆ PathLength


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