13#ifndef LLVM_CLANG_AST_INTERP_RECORD_H
14#define LLVM_CLANG_AST_INTERP_RECORD_H
19#include "llvm/ADT/ArrayRef.h"
42 return Decl->getBitWidthValue();
75 unsigned getSize()
const {
return BaseSize; }
77 unsigned getFullSize()
const {
return BaseSize + VirtualSize; }
80 if (
const auto *CXXDecl = dyn_cast<CXXRecordDecl>(Decl))
81 return CXXDecl->getDestructor();
92 llvm::iterator_range<const_field_iter>
fields()
const {
93 return llvm::make_range(Fields.begin(), Fields.end());
100 const Field *
findField(
unsigned Offset)
const;
107 llvm::iterator_range<const_base_iter>
bases()
const {
108 return llvm::make_range(Bases.begin(), Bases.end());
124 return llvm::make_range(VirtualBases.begin(), VirtualBases.end());
132 void dump(llvm::raw_ostream &OS,
unsigned Indentation = 0,
133 unsigned Offset = 0)
const;
139 ArrayRef<Base> VirtualBases,
unsigned VirtualSize,
unsigned BaseSize,
140 bool HasPtrField =
true);
155 llvm::DenseMap<const RecordDecl *, const Base *> BaseMap;
159 unsigned VirtualSize;
163 bool IsAnonymousUnion;
165 bool HasPtrField =
false;
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
llvm::MachO::Record Record
Represents a C++ destructor within a class.
Represents a member of a struct/union/class.
unsigned getFieldIndex() const
Returns the index of this field within its record, as appropriate for passing to ASTRecordLayout::get...
A (possibly-)qualified type.
Represents a struct/union/class.
The program contains and links the bytecode for all functions.
const RecordDecl * getDecl() const
Returns the underlying declaration.
const Base * findBase(unsigned Offset) const
ArrayRef< Field >::const_iterator const_field_iter
bool isUnion() const
Checks if the record is a union.
ArrayRef< Base >::const_iterator const_base_iter
std::string getName() const
Returns the name of the underlying declaration.
const Field * getField(unsigned I) const
bool hasPtrField() const
If this record (or any of its bases) contains a field of type PT_Ptr.
unsigned getNumBases() const
const Base * getBaseOrNull(const RecordDecl *RD) const
const CXXDestructorDecl * getDestructor() const
Returns the destructor of the record, if any.
const Base * getBase(unsigned I) const
const Field * getField(const FieldDecl *FD) const
Returns a field.
bool hasTrivialDtor() const
Returns true for anonymous unions and records with no destructor or for those with a trivial destruct...
const Field * findField(unsigned Offset) const
Find a field with the given offset.
const Base * getVirtualBase(unsigned I) const
unsigned getSize() const
Returns the size of the record.
llvm::iterator_range< const_base_iter > bases() const
llvm::iterator_range< const_base_iter > virtual_bases() const
unsigned getFullSize() const
Returns the full size of the record, including records.
unsigned getNumFields() const
unsigned getNumVirtualBases() const
bool isAnonymousUnion() const
Checks if the record is an anonymous union.
llvm::iterator_range< const_field_iter > fields() const
const Base * findVirtualBase(const RecordDecl *RD) const
Returns a virtual base descriptor.
Top level wrappers for InstallAPI frontend operations.
const FunctionProtoType * T
Describes a memory block created by an allocation site.
Base(const RecordDecl *D, const Descriptor *Desc, const Record *R, unsigned Offset)
Describes a record field.
Field(const FieldDecl *D, const Descriptor *Desc, unsigned Offset, OptPrimType T)
unsigned bitWidth() const
bool isUnnamedBitField() const