19 if (!Dcl || isa<FunctionDecl>(Dcl))
21 assert((isa<FieldDecl, IndirectFieldDecl>(Dcl)));
23 if (!
Base.isBlockPointer())
27 (PtrOffset < 0 ?
Base.atField(-PtrOffset) :
Base.atFieldSub(PtrOffset));
36 if (
const auto *FD = dyn_cast<FieldDecl>(Dcl)) {
37 if (FD->getParent() == BaseRecord->
getDecl())
47 if (
const RecordDecl *BaseDecl =
Base.getDeclPtr().getRecord()->getDecl();
48 BaseDecl != FieldParent)
52 const auto *IFD = cast<IndirectFieldDecl>(Dcl);
54 for (
const NamedDecl *ND : IFD->chain()) {
80 return Base.toAPValue(ASTCtx);
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 ...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Represents a member of a struct/union/class.
const RecordDecl * getParent() const
Returns the parent of this field declaration, which is the struct in which this field is defined.
This represents a decl that may have a name.
Represents a struct/union/class.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
A memory block, either on the stack or in the heap.
unsigned getSize() const
Returns the size of the block.
const Descriptor * getDescriptor() const
Returns the block's descriptor.
Holds all information required to evaluate constexpr code in a module.
Program & getProgram() const
Returns the program. This is only needed for unittests.
unsigned collectBaseOffset(const RecordDecl *BaseDecl, const RecordDecl *DerivedDecl) const
const Record * getRecord(const RecordDecl *D) const
APValue toAPValue(const ASTContext &) const
const Decl * getDecl() const
FunctionPointer toFunctionPointer(const Context &Ctx) const
std::optional< Pointer > toPointer(const Context &Ctx) const
A pointer to a memory block, live or dead.
Pointer atField(unsigned Off) const
Creates a pointer to a field.
const Block * block() const
const Record * getRecord() const
Returns the record descriptor of a class.
Function * getFunction(const FunctionDecl *F)
Returns a function.
Structure/Class descriptor.
const RecordDecl * getDecl() const
Returns the underlying declaration.
const Field * getField(const FieldDecl *FD) const
Returns a field.
The JSON file list parser is used to communicate input to InstallAPI.
unsigned getMetadataSize() const
Returns the size of the metadata.