class ASTRecordLayout
Declaration
class ASTRecordLayout { /* full declaration omitted */ };
Description
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/class. The decl represented must be a definition, not a forward declaration. This class is also used to contain layout information for one ObjCInterfaceDecl. FIXME - Find appropriate name. These objects are managed by ASTContext.
Declared at: clang/include/clang/AST/RecordLayout.h:38
Member Variables
- private clang::CharUnits Size
- Size - Size of record in characters.
- private clang::CharUnits DataSize
- DataSize - Size of record in characters without tail padding.
- private clang::CharUnits Alignment
- private clang::CharUnits PreferredAlignment
- private clang::CharUnits UnadjustedAlignment
- private clang::CharUnits RequiredAlignment
- RequiredAlignment - The required alignment of the object. In the MS-ABI the __declspec(align()) trumps #pramga pack and must always be obeyed.
- private ASTVector<uint64_t> FieldOffsets
- FieldOffsets - Array of field offsets in bits.
- private clang::ASTRecordLayout::CXXRecordLayoutInfo* CXXInfo = nullptr
- CXXInfo - If the record layout is for a C++ record, this will have C++ specific information about the record.
Method Overview
- private ASTRecordLayout(const clang::ASTContext & Ctx, clang::CharUnits size, clang::CharUnits alignment, clang::CharUnits preferredAlignment, clang::CharUnits unadjustedAlignment, clang::CharUnits requiredAlignment, bool hasOwnVFPtr, bool hasExtendableVFPtr, clang::CharUnits vbptroffset, clang::CharUnits datasize, ArrayRef<uint64_t> fieldoffsets, clang::CharUnits nonvirtualsize, clang::CharUnits nonvirtualalignment, clang::CharUnits preferrednvalignment, clang::CharUnits SizeOfLargestEmptySubobject, const clang::CXXRecordDecl * PrimaryBase, bool IsPrimaryBaseVirtual, const clang::CXXRecordDecl * BaseSharingVBPtr, bool EndsWithZeroSizedObject, bool LeadsWithZeroSizedBase, const clang::ASTRecordLayout::BaseOffsetsMapTy & BaseOffsets, const clang::ASTRecordLayout::VBaseOffsetsMapTy & VBaseOffsets)
- public ASTRecordLayout(const clang::ASTRecordLayout &)
- private ASTRecordLayout(const clang::ASTContext & Ctx, clang::CharUnits size, clang::CharUnits alignment, clang::CharUnits preferredAlignment, clang::CharUnits unadjustedAlignment, clang::CharUnits requiredAlignment, clang::CharUnits datasize, ArrayRef<uint64_t> fieldoffsets)
- private void Destroy(clang::ASTContext & Ctx)
- public bool endsWithZeroSizedObject() const
- public clang::CharUnits getAlignment() const
- public clang::CharUnits getBaseClassOffset(const clang::CXXRecordDecl * Base) const
- public const clang::CXXRecordDecl * getBaseSharingVBPtr() const
- public clang::CharUnits getDataSize() const
- public unsigned int getFieldCount() const
- public uint64_t getFieldOffset(unsigned int FieldNo) const
- public clang::CharUnits getNonVirtualAlignment() const
- public clang::CharUnits getNonVirtualSize() const
- public clang::CharUnits getPreferredAlignment() const
- public clang::CharUnits getPreferredNVAlignment() const
- public const clang::CXXRecordDecl * getPrimaryBase() const
- public clang::CharUnits getRequiredAlignment() const
- public clang::CharUnits getSize() const
- public clang::CharUnits getSizeOfLargestEmptySubobject() const
- public clang::CharUnits getUnadjustedAlignment() const
- public clang::CharUnits getVBPtrOffset() const
- public clang::CharUnits getVBaseClassOffset(const clang::CXXRecordDecl * VBase) const
- public const clang::ASTRecordLayout::VBaseOffsetsMapTy & getVBaseOffsetsMap() const
- public bool hasExtendableVFPtr() const
- public bool hasOwnVBPtr() const
- public bool hasOwnVFPtr() const
- public bool hasVBPtr() const
- public bool isPrimaryBaseVirtual() const
- public bool leadsWithZeroSizedBase() const
- private ~ASTRecordLayout()
Methods
¶ASTRecordLayout(
const clang::ASTContext& Ctx,
clang::CharUnits size,
clang::CharUnits alignment,
clang::CharUnits preferredAlignment,
clang::CharUnits unadjustedAlignment,
clang::CharUnits requiredAlignment,
bool hasOwnVFPtr,
bool hasExtendableVFPtr,
clang::CharUnits vbptroffset,
clang::CharUnits datasize,
ArrayRef<uint64_t> fieldoffsets,
clang::CharUnits nonvirtualsize,
clang::CharUnits nonvirtualalignment,
clang::CharUnits preferrednvalignment,
clang::CharUnits SizeOfLargestEmptySubobject,
const clang::CXXRecordDecl* PrimaryBase,
bool IsPrimaryBaseVirtual,
const clang::CXXRecordDecl* BaseSharingVBPtr,
bool EndsWithZeroSizedObject,
bool LeadsWithZeroSizedBase,
const clang::ASTRecordLayout::
BaseOffsetsMapTy& BaseOffsets,
const clang::ASTRecordLayout::
VBaseOffsetsMapTy& VBaseOffsets)
ASTRecordLayout(
const clang::ASTContext& Ctx,
clang::CharUnits size,
clang::CharUnits alignment,
clang::CharUnits preferredAlignment,
clang::CharUnits unadjustedAlignment,
clang::CharUnits requiredAlignment,
bool hasOwnVFPtr,
bool hasExtendableVFPtr,
clang::CharUnits vbptroffset,
clang::CharUnits datasize,
ArrayRef<uint64_t> fieldoffsets,
clang::CharUnits nonvirtualsize,
clang::CharUnits nonvirtualalignment,
clang::CharUnits preferrednvalignment,
clang::CharUnits SizeOfLargestEmptySubobject,
const clang::CXXRecordDecl* PrimaryBase,
bool IsPrimaryBaseVirtual,
const clang::CXXRecordDecl* BaseSharingVBPtr,
bool EndsWithZeroSizedObject,
bool LeadsWithZeroSizedBase,
const clang::ASTRecordLayout::
BaseOffsetsMapTy& BaseOffsets,
const clang::ASTRecordLayout::
VBaseOffsetsMapTy& VBaseOffsets)
Declared at: clang/include/clang/AST/RecordLayout.h:159
Parameters
- const clang::ASTContext& Ctx
- clang::CharUnits size
- clang::CharUnits alignment
- clang::CharUnits preferredAlignment
- clang::CharUnits unadjustedAlignment
- clang::CharUnits requiredAlignment
- bool hasOwnVFPtr
- bool hasExtendableVFPtr
- clang::CharUnits vbptroffset
- clang::CharUnits datasize
- ArrayRef<uint64_t> fieldoffsets
- clang::CharUnits nonvirtualsize
- clang::CharUnits nonvirtualalignment
- clang::CharUnits preferrednvalignment
- clang::CharUnits SizeOfLargestEmptySubobject
- const clang::CXXRecordDecl* PrimaryBase
- bool IsPrimaryBaseVirtual
- const clang::CXXRecordDecl* BaseSharingVBPtr
- bool EndsWithZeroSizedObject
- bool LeadsWithZeroSizedBase
- const clang::ASTRecordLayout::BaseOffsetsMapTy& BaseOffsets
- const clang::ASTRecordLayout::VBaseOffsetsMapTy& VBaseOffsets
¶ASTRecordLayout(const clang::ASTRecordLayout&)
ASTRecordLayout(const clang::ASTRecordLayout&)
Declared at: clang/include/clang/AST/RecordLayout.h:178
Parameters
- const clang::ASTRecordLayout&
¶ASTRecordLayout(
const clang::ASTContext& Ctx,
clang::CharUnits size,
clang::CharUnits alignment,
clang::CharUnits preferredAlignment,
clang::CharUnits unadjustedAlignment,
clang::CharUnits requiredAlignment,
clang::CharUnits datasize,
ArrayRef<uint64_t> fieldoffsets)
ASTRecordLayout(
const clang::ASTContext& Ctx,
clang::CharUnits size,
clang::CharUnits alignment,
clang::CharUnits preferredAlignment,
clang::CharUnits unadjustedAlignment,
clang::CharUnits requiredAlignment,
clang::CharUnits datasize,
ArrayRef<uint64_t> fieldoffsets)
Declared at: clang/include/clang/AST/RecordLayout.h:151
Parameters
- const clang::ASTContext& Ctx
- clang::CharUnits size
- clang::CharUnits alignment
- clang::CharUnits preferredAlignment
- clang::CharUnits unadjustedAlignment
- clang::CharUnits requiredAlignment
- clang::CharUnits datasize
- ArrayRef<uint64_t> fieldoffsets
¶void Destroy(clang::ASTContext& Ctx)
void Destroy(clang::ASTContext& Ctx)
Declared at: clang/include/clang/AST/RecordLayout.h:175
Parameters
- clang::ASTContext& Ctx
¶bool endsWithZeroSizedObject() const
bool endsWithZeroSizedObject() const
Declared at: clang/include/clang/AST/RecordLayout.h:313
¶clang::CharUnits getAlignment() const
clang::CharUnits getAlignment() const
Description
getAlignment - Get the record alignment in characters.
Declared at: clang/include/clang/AST/RecordLayout.h:182
¶clang::CharUnits getBaseClassOffset(
const clang::CXXRecordDecl* Base) const
clang::CharUnits getBaseClassOffset(
const clang::CXXRecordDecl* Base) const
Description
getBaseClassOffset - Get the offset, in chars, for the given base class.
Declared at: clang/include/clang/AST/RecordLayout.h:249
Parameters
- const clang::CXXRecordDecl* Base
¶const clang::CXXRecordDecl* getBaseSharingVBPtr()
const
const clang::CXXRecordDecl* getBaseSharingVBPtr()
const
Declared at: clang/include/clang/AST/RecordLayout.h:329
¶clang::CharUnits getDataSize() const
clang::CharUnits getDataSize() const
Description
getDataSize() - Get the record data size, which is the record size without tail padding, in characters.
Declared at: clang/include/clang/AST/RecordLayout.h:206
¶unsigned int getFieldCount() const
unsigned int getFieldCount() const
Description
getFieldCount - Get the number of fields in the layout.
Declared at: clang/include/clang/AST/RecordLayout.h:196
¶uint64_t getFieldOffset(
unsigned int FieldNo) const
uint64_t getFieldOffset(
unsigned int FieldNo) const
Description
getFieldOffset - Get the offset of the given field index, in bits.
Declared at: clang/include/clang/AST/RecordLayout.h:200
Parameters
- unsigned int FieldNo
¶clang::CharUnits getNonVirtualAlignment() const
clang::CharUnits getNonVirtualAlignment() const
Description
getNonVirtualAlignment - Get the non-virtual alignment (in chars) of an object, which is the alignment of the object without virtual bases.
Declared at: clang/include/clang/AST/RecordLayout.h:218
¶clang::CharUnits getNonVirtualSize() const
clang::CharUnits getNonVirtualSize() const
Description
getNonVirtualSize - Get the non-virtual size (in chars) of an object, which is the size of the object without virtual bases.
Declared at: clang/include/clang/AST/RecordLayout.h:210
¶clang::CharUnits getPreferredAlignment() const
clang::CharUnits getPreferredAlignment() const
Description
getPreferredFieldAlignment - Get the record preferred alignment in characters.
Declared at: clang/include/clang/AST/RecordLayout.h:186
¶clang::CharUnits getPreferredNVAlignment() const
clang::CharUnits getPreferredNVAlignment() const
Description
getPreferredNVAlignment - Get the preferred non-virtual alignment (in chars) of an object, which is the preferred alignment of the object without virtual bases.
Declared at: clang/include/clang/AST/RecordLayout.h:227
¶const clang::CXXRecordDecl* getPrimaryBase() const
const clang::CXXRecordDecl* getPrimaryBase() const
Description
getPrimaryBase - Get the primary base for this record.
Declared at: clang/include/clang/AST/RecordLayout.h:234
¶clang::CharUnits getRequiredAlignment() const
clang::CharUnits getRequiredAlignment() const
Declared at: clang/include/clang/AST/RecordLayout.h:311
¶clang::CharUnits getSize() const
clang::CharUnits getSize() const
Description
getSize - Get the record size in characters.
Declared at: clang/include/clang/AST/RecordLayout.h:193
¶clang::CharUnits getSizeOfLargestEmptySubobject()
const
clang::CharUnits getSizeOfLargestEmptySubobject()
const
Declared at: clang/include/clang/AST/RecordLayout.h:268
¶clang::CharUnits getUnadjustedAlignment() const
clang::CharUnits getUnadjustedAlignment() const
Description
getUnadjustedAlignment - Get the record alignment in characters, before alignment adjustement.
Declared at: clang/include/clang/AST/RecordLayout.h:190
¶clang::CharUnits getVBPtrOffset() const
clang::CharUnits getVBPtrOffset() const
Description
getVBPtrOffset - Get the offset for virtual base table pointer. This is only meaningful with the Microsoft ABI.
Declared at: clang/include/clang/AST/RecordLayout.h:324
¶clang::CharUnits getVBaseClassOffset(
const clang::CXXRecordDecl* VBase) const
clang::CharUnits getVBaseClassOffset(
const clang::CXXRecordDecl* VBase) const
Description
getVBaseClassOffset - Get the offset, in chars, for the given base class.
Declared at: clang/include/clang/AST/RecordLayout.h:259
Parameters
- const clang::CXXRecordDecl* VBase
¶const clang::ASTRecordLayout::VBaseOffsetsMapTy&
getVBaseOffsetsMap() const
const clang::ASTRecordLayout::VBaseOffsetsMapTy&
getVBaseOffsetsMap() const
Declared at: clang/include/clang/AST/RecordLayout.h:334
¶bool hasExtendableVFPtr() const
bool hasExtendableVFPtr() const
Description
hasVFPtr - Does this class have a virtual function table pointer that can be extended by a derived class? This is synonymous with this class having a VFPtr at offset zero.
Declared at: clang/include/clang/AST/RecordLayout.h:288
¶bool hasOwnVBPtr() const
bool hasOwnVBPtr() const
Description
hasOwnVBPtr - Does this class provide its own virtual-base table pointer, rather than inheriting one from a primary base class? This implies that the ABI has no primary base class, meaning that it has no base classes that are suitable under the conditions of the ABI.
Declared at: clang/include/clang/AST/RecordLayout.h:300
¶bool hasOwnVFPtr() const
bool hasOwnVFPtr() const
Description
hasOwnVFPtr - Does this class provide its own virtual-function table pointer, rather than inheriting one from a primary base class? If so, it is at offset zero. This implies that the ABI has no primary base class, meaning that it has no base classes that are suitable under the conditions of the ABI.
Declared at: clang/include/clang/AST/RecordLayout.h:280
¶bool hasVBPtr() const
bool hasVBPtr() const
Description
hasVBPtr - Does this class have a virtual function table pointer.
Declared at: clang/include/clang/AST/RecordLayout.h:306
¶bool isPrimaryBaseVirtual() const
bool isPrimaryBaseVirtual() const
Description
isPrimaryBaseVirtual - Get whether the primary base for this record is virtual or not.
Declared at: clang/include/clang/AST/RecordLayout.h:242
¶bool leadsWithZeroSizedBase() const
bool leadsWithZeroSizedBase() const
Declared at: clang/include/clang/AST/RecordLayout.h:317
¶~ASTRecordLayout()
~ASTRecordLayout()
Declared at: clang/include/clang/AST/RecordLayout.h:173