clang 23.0.0git
clang::interp::MemberPointer Class Referencefinal

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

Public Member Functions

 MemberPointer ()=default
 MemberPointer (Pointer Base, const ValueDecl *Dcl)
 MemberPointer (uint32_t Address, const Descriptor *D)
 MemberPointer (const ValueDecl *D)
uint64_t getIntegerRepresentation () const
bool hasDecl () const
 Does this member pointer have a base declaration?
bool isDerivedMember () const
const ValueDeclgetDecl () const
 Return the base declaration. Might be null.
bool hasPath () const
 Does this member pointer have a path (i.e. path length is > 0)?
unsigned getPathLength () const
 Return the length of the cast path.
const CXXRecordDeclgetPathEntry (unsigned Index) const
 Return the cast path entry at the given position.
const CXXRecordDecl ** path () const
 Return the cast path. Might return null.
bool isZero () const
bool hasBase () const
bool isWeak () const
void takePath (const CXXRecordDecl **NewPath)
 Sets the path of this member pointer.
bool singleWord () const
ComparisonCategoryResult compare (const MemberPointer &RHS) const
std::optional< PointertoPointer (const Context &Ctx) const
FunctionPointer toFunctionPointer (const Context &Ctx) const
bool isBaseCastPossible () const
Pointer getBase () const
bool isMemberFunctionPointer () const
 Is the base declaration a member function?
const CXXMethodDeclgetMemberFunction () const
 Return the base declaration as a CXXMethodDecl. Might return null.
const FieldDeclgetField () const
 Return the base declaration as a FieldDecl. Might return null.
const CXXRecordDeclgetRecordDecl () const
 Returns the record decl this member pointer points into.
MemberPointer atInstanceBase (unsigned Offset, uint8_t PathLength=0, const CXXRecordDecl **Path=nullptr, bool NewIsDerived=false) const
MemberPointer takeInstance (Pointer Instance) const
APValue toAPValue (const ASTContext &) const
void print (llvm::raw_ostream &OS) const
std::string toDiagnosticString (const ASTContext &Ctx) const

Detailed Description

Definition at line 24 of file MemberPointer.h.

Constructor & Destructor Documentation

◆ MemberPointer() [1/4]

clang::interp::MemberPointer::MemberPointer ( )
default

Referenced by atInstanceBase(), and takeInstance().

◆ MemberPointer() [2/4]

clang::interp::MemberPointer::MemberPointer ( Pointer Base,
const ValueDecl * Dcl )
inline

Definition at line 46 of file MemberPointer.h.

◆ MemberPointer() [3/4]

clang::interp::MemberPointer::MemberPointer ( uint32_t Address,
const Descriptor * D )
inline

Definition at line 48 of file MemberPointer.h.

◆ MemberPointer() [4/4]

clang::interp::MemberPointer::MemberPointer ( const ValueDecl * D)
inline

Definition at line 53 of file MemberPointer.h.

References clang::isa().

Member Function Documentation

◆ atInstanceBase()

MemberPointer clang::interp::MemberPointer::atInstanceBase ( unsigned Offset,
uint8_t PathLength = 0,
const CXXRecordDecl ** Path = nullptr,
bool NewIsDerived = false ) const
inline

Definition at line 139 of file MemberPointer.h.

References MemberPointer().

◆ compare()

ComparisonCategoryResult clang::interp::MemberPointer::compare ( const MemberPointer & RHS) const

Definition at line 97 of file MemberPointer.cpp.

References clang::Equal, getDecl(), and clang::Unordered.

Referenced by clang::interp::CmpHelperEQ< MemberPointer >().

◆ getBase()

Pointer clang::interp::MemberPointer::getBase ( ) const
inline

◆ getDecl()

const ValueDecl * clang::interp::MemberPointer::getDecl ( ) const
inline

Return the base declaration. Might be null.

Definition at line 68 of file MemberPointer.h.

Referenced by compare(), print(), toAPValue(), toDiagnosticString(), toFunctionPointer(), and toPointer().

◆ getField()

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

Return the base declaration as a FieldDecl. Might return null.

Definition at line 126 of file MemberPointer.h.

Referenced by getRecordDecl().

◆ getIntegerRepresentation()

uint64_t clang::interp::MemberPointer::getIntegerRepresentation ( ) const
inline

Definition at line 57 of file MemberPointer.h.

◆ getMemberFunction()

const CXXMethodDecl * clang::interp::MemberPointer::getMemberFunction ( ) const
inline

Return the base declaration as a CXXMethodDecl. Might return null.

Definition at line 121 of file MemberPointer.h.

Referenced by getRecordDecl(), and isWeak().

◆ getPathEntry()

const CXXRecordDecl * clang::interp::MemberPointer::getPathEntry ( unsigned Index) const
inline

Return the cast path entry at the given position.

Definition at line 76 of file MemberPointer.h.

◆ getPathLength()

unsigned clang::interp::MemberPointer::getPathLength ( ) const
inline

Return the length of the cast path.

Definition at line 74 of file MemberPointer.h.

Referenced by clang::interp::copyPrimitiveMemory(), clang::interp::copyPrimitiveMemory(), clang::interp::InitGlobal(), and print().

◆ getRecordDecl()

const CXXRecordDecl * clang::interp::MemberPointer::getRecordDecl ( ) const
inline

Returns the record decl this member pointer points into.

Definition at line 130 of file MemberPointer.h.

References clang::cast(), getField(), and getMemberFunction().

◆ hasBase()

bool clang::interp::MemberPointer::hasBase ( ) const
inline

Definition at line 83 of file MemberPointer.h.

Referenced by toAPValue().

◆ hasDecl()

bool clang::interp::MemberPointer::hasDecl ( ) const
inline

Does this member pointer have a base declaration?

Definition at line 65 of file MemberPointer.h.

Referenced by isZero().

◆ hasPath()

bool clang::interp::MemberPointer::hasPath ( ) const
inline

Does this member pointer have a path (i.e. path length is > 0)?

Definition at line 72 of file MemberPointer.h.

◆ isBaseCastPossible()

bool clang::interp::MemberPointer::isBaseCastPossible ( ) const
inline

Definition at line 105 of file MemberPointer.h.

◆ isDerivedMember()

bool clang::interp::MemberPointer::isDerivedMember ( ) const
inline

Definition at line 66 of file MemberPointer.h.

Referenced by print(), and toAPValue().

◆ isMemberFunctionPointer()

bool clang::interp::MemberPointer::isMemberFunctionPointer ( ) const
inline

Is the base declaration a member function?

Definition at line 117 of file MemberPointer.h.

◆ isWeak()

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

Definition at line 84 of file MemberPointer.h.

References getMemberFunction().

◆ isZero()

bool clang::interp::MemberPointer::isZero ( ) const
inline

Definition at line 82 of file MemberPointer.h.

References hasDecl().

Referenced by clang::interp::CmpHelperEQ< MemberPointer >(), and toAPValue().

◆ path()

const CXXRecordDecl ** clang::interp::MemberPointer::path ( ) const
inline

Return the cast path. Might return null.

Definition at line 81 of file MemberPointer.h.

◆ print()

void clang::interp::MemberPointer::print ( llvm::raw_ostream & OS) const
inline

Definition at line 157 of file MemberPointer.h.

References getDecl(), getPathLength(), and isDerivedMember().

Referenced by clang::interp::operator<<().

◆ singleWord()

bool clang::interp::MemberPointer::singleWord ( ) const
inline

Definition at line 99 of file MemberPointer.h.

◆ takeInstance()

MemberPointer clang::interp::MemberPointer::takeInstance ( Pointer Instance) const
inline

Definition at line 149 of file MemberPointer.h.

References clang::interp::Pointer::isZero(), and MemberPointer().

◆ takePath()

void clang::interp::MemberPointer::takePath ( const CXXRecordDecl ** NewPath)
inline

Sets the path of this member pointer.

After this call, the memory pointed to by NewPath is assumed to be owned by this member pointer.

Definition at line 93 of file MemberPointer.h.

◆ toAPValue()

APValue clang::interp::MemberPointer::toAPValue ( const ASTContext & ASTCtx) const

Definition at line 84 of file MemberPointer.cpp.

References clang::APValue, getDecl(), hasBase(), isDerivedMember(), and isZero().

Referenced by toDiagnosticString().

◆ toDiagnosticString()

std::string clang::interp::MemberPointer::toDiagnosticString ( const ASTContext & Ctx) const
inline

Definition at line 163 of file MemberPointer.h.

References clang::APValue::getAsString(), getDecl(), getType(), and toAPValue().

◆ toFunctionPointer()

FunctionPointer clang::interp::MemberPointer::toFunctionPointer ( const Context & Ctx) const

◆ toPointer()


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