9#ifndef LLVM_CLANG_AST_INTERP_MEMBER_POINTER_H
10#define LLVM_CLANG_AST_INTERP_MEMBER_POINTER_H
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());
93 void print(llvm::raw_ostream &OS)
const {
94 OS <<
"MemberPtr(" <<
Base <<
" " << (
const void *)Dcl <<
" + " << PtrOffset
103 if (this->Dcl == RHS.Dcl)
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
std::string getAsString(const ASTContext &Ctx, QualType Ty) const
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.
Represents a member of a struct/union/class.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Holds all information required to evaluate constexpr code in a module.
const ValueDecl * getDecl() const
APValue toAPValue(const ASTContext &) const
uint64_t getIntegerRepresentation() const
MemberPointer takeInstance(Pointer Instance) const
std::string toDiagnosticString(const ASTContext &Ctx) const
MemberPointer(uint32_t Address, const Descriptor *D)
bool isMemberFunctionPointer() const
MemberPointer(const ValueDecl *D)
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(Pointer Base, const ValueDecl *Dcl)
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.