9#ifndef LLVM_CLANG_AST_INTERP_MEMBER_POINTER_H
10#define LLVM_CLANG_AST_INTERP_MEMBER_POINTER_H
25 const Decl *Dcl =
nullptr;
26 int32_t PtrOffset = 0;
29 :
Base(
Base), Dcl(Dcl), PtrOffset(PtrOffset) {}
40 assert((isa<FieldDecl, IndirectFieldDecl, CXXMethodDecl>(
D)));
46 "getIntegerRepresentation() shouldn't be reachable for MemberPointers");
56 return Base.atField(-PtrOffset);
57 return Base.atFieldSub(PtrOffset);
60 return isa_and_nonnull<CXXMethodDecl>(Dcl);
63 return dyn_cast_if_present<CXXMethodDecl>(Dcl);
66 return dyn_cast_if_present<FieldDecl>(Dcl);
79 assert(this->Base.
isZero());
88 void print(llvm::raw_ostream &OS)
const {
89 OS <<
"MemberPtr(" <<
Base <<
" " << (
const void *)Dcl <<
" + " << PtrOffset
98 if (this->Dcl == RHS.Dcl)
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a static or instance method of a struct/union/class.
Decl - This represents one declaration (or definition), e.g.
Represents a member of a struct/union/class.
Holds all information required to evaluate constexpr code in a module.
APValue toAPValue(const ASTContext &) const
uint64_t getIntegerRepresentation() const
MemberPointer takeInstance(Pointer Instance) const
MemberPointer(Pointer Base, const Decl *Dcl)
std::string toDiagnosticString(const ASTContext &Ctx) const
const Decl * getDecl() const
MemberPointer(uint32_t Address, const Descriptor *D)
bool isMemberFunctionPointer() const
const FieldDecl * getField() const
void print(llvm::raw_ostream &OS) const
MemberPointer atInstanceBase(unsigned Offset) const
ComparisonCategoryResult compare(const MemberPointer &RHS) const
FunctionPointer toFunctionPointer(const Context &Ctx) const
const CXXMethodDecl * getMemberFunction() const
std::optional< Pointer > toPointer(const Context &Ctx) const
MemberPointer(const Decl *D)
A pointer to a memory block, live or dead.
bool isZero() const
Checks if the pointer is null.
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const Boolean &B)
The JSON file list parser is used to communicate input to InstallAPI.
ComparisonCategoryResult
An enumeration representing the possible results of a three-way comparison.
Describes a memory block created by an allocation site.