clang 19.0.0git
Classes | Public Types | Public Member Functions | Friends | List of all members
clang::ASTRecordLayout Class Reference

ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/class. More...

#include "clang/AST/RecordLayout.h"

Classes

struct  VBaseInfo
 

Public Types

using VBaseOffsetsMapTy = llvm::DenseMap< const CXXRecordDecl *, VBaseInfo >
 

Public Member Functions

 ASTRecordLayout (const ASTRecordLayout &)=delete
 
ASTRecordLayoutoperator= (const ASTRecordLayout &)=delete
 
CharUnits getAlignment () const
 getAlignment - Get the record alignment in characters.
 
CharUnits getPreferredAlignment () const
 getPreferredFieldAlignment - Get the record preferred alignment in characters.
 
CharUnits getUnadjustedAlignment () const
 getUnadjustedAlignment - Get the record alignment in characters, before alignment adjustement.
 
CharUnits getSize () const
 getSize - Get the record size in characters.
 
unsigned getFieldCount () const
 getFieldCount - Get the number of fields in the layout.
 
uint64_t getFieldOffset (unsigned FieldNo) const
 getFieldOffset - Get the offset of the given field index, in bits.
 
CharUnits getDataSize () const
 getDataSize() - Get the record data size, which is the record size without tail padding, in characters.
 
CharUnits getNonVirtualSize () const
 getNonVirtualSize - Get the non-virtual size (in chars) of an object, which is the size of the object without virtual bases.
 
CharUnits getNonVirtualAlignment () const
 getNonVirtualAlignment - Get the non-virtual alignment (in chars) of an object, which is the alignment of the object without virtual bases.
 
CharUnits getPreferredNVAlignment () const
 getPreferredNVAlignment - Get the preferred non-virtual alignment (in chars) of an object, which is the preferred alignment of the object without virtual bases.
 
const CXXRecordDeclgetPrimaryBase () const
 getPrimaryBase - Get the primary base for this record.
 
bool isPrimaryBaseVirtual () const
 isPrimaryBaseVirtual - Get whether the primary base for this record is virtual or not.
 
CharUnits getBaseClassOffset (const CXXRecordDecl *Base) const
 getBaseClassOffset - Get the offset, in chars, for the given base class.
 
CharUnits getVBaseClassOffset (const CXXRecordDecl *VBase) const
 getVBaseClassOffset - Get the offset, in chars, for the given base class.
 
CharUnits getSizeOfLargestEmptySubobject () const
 
bool hasOwnVFPtr () const
 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.
 
bool hasExtendableVFPtr () const
 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.
 
bool hasOwnVBPtr () const
 hasOwnVBPtr - Does this class provide its own virtual-base table pointer, rather than inheriting one from a primary base class?
 
bool hasVBPtr () const
 hasVBPtr - Does this class have a virtual function table pointer.
 
CharUnits getRequiredAlignment () const
 
bool endsWithZeroSizedObject () const
 
bool leadsWithZeroSizedBase () const
 
CharUnits getVBPtrOffset () const
 getVBPtrOffset - Get the offset for virtual base table pointer.
 
const CXXRecordDeclgetBaseSharingVBPtr () const
 
const VBaseOffsetsMapTygetVBaseOffsetsMap () const
 

Friends

class ASTContext
 

Detailed 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.

Definition at line 38 of file RecordLayout.h.

Member Typedef Documentation

◆ VBaseOffsetsMapTy

Definition at line 59 of file RecordLayout.h.

Constructor & Destructor Documentation

◆ ASTRecordLayout()

clang::ASTRecordLayout::ASTRecordLayout ( const ASTRecordLayout )
delete

Member Function Documentation

◆ endsWithZeroSizedObject()

bool clang::ASTRecordLayout::endsWithZeroSizedObject ( ) const
inline

Definition at line 313 of file RecordLayout.h.

◆ getAlignment()

CharUnits clang::ASTRecordLayout::getAlignment ( ) const
inline

getAlignment - Get the record alignment in characters.

Definition at line 182 of file RecordLayout.h.

Referenced by clang::ASTContext::DumpRecordLayout(), DumpRecordLayout(), clang::CodeGen::CodeGenModule::getClassPointerAlignment(), and clang::ASTContext::getDeclAlign().

◆ getBaseClassOffset()

CharUnits clang::ASTRecordLayout::getBaseClassOffset ( const CXXRecordDecl Base) const
inline

◆ getBaseSharingVBPtr()

const CXXRecordDecl * clang::ASTRecordLayout::getBaseSharingVBPtr ( ) const
inline

Definition at line 329 of file RecordLayout.h.

Referenced by clang::ASTContext::getOffsetOfBaseWithVBPtr().

◆ getDataSize()

CharUnits clang::ASTRecordLayout::getDataSize ( ) const
inline

getDataSize() - Get the record data size, which is the record size without tail padding, in characters.

Definition at line 206 of file RecordLayout.h.

Referenced by clang::ASTContext::DumpRecordLayout(), DumpRecordLayout(), and clang::ASTContext::getTypeInfoDataSizeInChars().

◆ getFieldCount()

unsigned clang::ASTRecordLayout::getFieldCount ( ) const
inline

◆ getFieldOffset()

uint64_t clang::ASTRecordLayout::getFieldOffset ( unsigned  FieldNo) const
inline

◆ getNonVirtualAlignment()

CharUnits clang::ASTRecordLayout::getNonVirtualAlignment ( ) const
inline

getNonVirtualAlignment - Get the non-virtual alignment (in chars) of an object, which is the alignment of the object without virtual bases.

Definition at line 218 of file RecordLayout.h.

Referenced by DumpRecordLayout(), EmitNullBaseClassInitialization(), getBaseAlignmentAndOffsetFromPtr(), and getDerivedToBaseAlignmentAndOffset().

◆ getNonVirtualSize()

CharUnits clang::ASTRecordLayout::getNonVirtualSize ( ) const
inline

getNonVirtualSize - Get the non-virtual size (in chars) of an object, which is the size of the object without virtual bases.

Definition at line 210 of file RecordLayout.h.

Referenced by clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), DumpRecordLayout(), EmitNullBaseClassInitialization(), and EmitNullConstant().

◆ getPreferredAlignment()

CharUnits clang::ASTRecordLayout::getPreferredAlignment ( ) const
inline

getPreferredFieldAlignment - Get the record preferred alignment in characters.

Definition at line 186 of file RecordLayout.h.

Referenced by clang::ASTContext::DumpRecordLayout(), and DumpRecordLayout().

◆ getPreferredNVAlignment()

CharUnits clang::ASTRecordLayout::getPreferredNVAlignment ( ) const
inline

getPreferredNVAlignment - Get the preferred non-virtual alignment (in chars) of an object, which is the preferred alignment of the object without virtual bases.

Definition at line 227 of file RecordLayout.h.

Referenced by DumpRecordLayout().

◆ getPrimaryBase()

const CXXRecordDecl * clang::ASTRecordLayout::getPrimaryBase ( ) const
inline

getPrimaryBase - Get the primary base for this record.

Definition at line 234 of file RecordLayout.h.

Referenced by AddIndirectPrimaryBases(), and DumpRecordLayout().

◆ getRequiredAlignment()

CharUnits clang::ASTRecordLayout::getRequiredAlignment ( ) const
inline

Definition at line 311 of file RecordLayout.h.

◆ getSize()

CharUnits clang::ASTRecordLayout::getSize ( ) const
inline

◆ getSizeOfLargestEmptySubobject()

CharUnits clang::ASTRecordLayout::getSizeOfLargestEmptySubobject ( ) const
inline

Definition at line 268 of file RecordLayout.h.

◆ getUnadjustedAlignment()

CharUnits clang::ASTRecordLayout::getUnadjustedAlignment ( ) const
inline

getUnadjustedAlignment - Get the record alignment in characters, before alignment adjustement.

Definition at line 190 of file RecordLayout.h.

Referenced by clang::ASTContext::getTypeUnadjustedAlign().

◆ getVBaseClassOffset()

CharUnits clang::ASTRecordLayout::getVBaseClassOffset ( const CXXRecordDecl VBase) const
inline

◆ getVBaseOffsetsMap()

const VBaseOffsetsMapTy & clang::ASTRecordLayout::getVBaseOffsetsMap ( ) const
inline

Definition at line 334 of file RecordLayout.h.

Referenced by DumpRecordLayout().

◆ getVBPtrOffset()

CharUnits clang::ASTRecordLayout::getVBPtrOffset ( ) const
inline

getVBPtrOffset - Get the offset for virtual base table pointer.

This is only meaningful with the Microsoft ABI.

Definition at line 324 of file RecordLayout.h.

Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), and DumpRecordLayout().

◆ hasExtendableVFPtr()

bool clang::ASTRecordLayout::hasExtendableVFPtr ( ) const
inline

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.

Definition at line 288 of file RecordLayout.h.

◆ hasOwnVBPtr()

bool clang::ASTRecordLayout::hasOwnVBPtr ( ) const
inline

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.

Definition at line 300 of file RecordLayout.h.

References hasVBPtr().

Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), and DumpRecordLayout().

◆ hasOwnVFPtr()

bool clang::ASTRecordLayout::hasOwnVFPtr ( ) const
inline

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.

Definition at line 280 of file RecordLayout.h.

Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), and DumpRecordLayout().

◆ hasVBPtr()

bool clang::ASTRecordLayout::hasVBPtr ( ) const
inline

hasVBPtr - Does this class have a virtual function table pointer.

Definition at line 306 of file RecordLayout.h.

Referenced by hasOwnVBPtr().

◆ isPrimaryBaseVirtual()

bool clang::ASTRecordLayout::isPrimaryBaseVirtual ( ) const
inline

isPrimaryBaseVirtual - Get whether the primary base for this record is virtual or not.

Definition at line 242 of file RecordLayout.h.

Referenced by AddIndirectPrimaryBases().

◆ leadsWithZeroSizedBase()

bool clang::ASTRecordLayout::leadsWithZeroSizedBase ( ) const
inline

Definition at line 317 of file RecordLayout.h.

◆ operator=()

ASTRecordLayout & clang::ASTRecordLayout::operator= ( const ASTRecordLayout )
delete

Friends And Related Function Documentation

◆ ASTContext

friend class ASTContext
friend

Definition at line 62 of file RecordLayout.h.


The documentation for this class was generated from the following files: