class CGRecordLayout
Declaration
class CGRecordLayout { /* full declaration omitted */ };
Description
CGRecordLayout - This class handles struct and union layout info while lowering AST types to LLVM types. These layout objects are only created on demand as IR generation requires.
Declared at: clang/lib/CodeGen/CGRecordLayout.h:121
Member Variables
- private llvm::StructType* CompleteObjectType
- The LLVM type corresponding to this record layout; used when laying it out as a complete object.
- private llvm::StructType* BaseSubobjectType
- The LLVM type for the non-virtual part of this record layout; used when laying it out as a base subobject.
- private llvm::DenseMap<const FieldDecl*, unsigned int> FieldInfo
- Map from (non-bit-field) struct field to the corresponding llvm struct type field no. This info is populated by record builder.
- private llvm::DenseMap<const FieldDecl*, CGBitFieldInfo> BitFields
- Map from (bit-field) struct field to the corresponding llvm struct type field no. This info is populated by record builder.
- private llvm::DenseMap<const CXXRecordDecl*, unsigned int> NonVirtualBases
- private llvm::DenseMap<const CXXRecordDecl*, unsigned int> CompleteObjectVirtualBases
- Map from virtual bases to their field index in the complete object.
- private bool IsZeroInitializable
- False if any direct or indirect subobject of this class, when considered as a complete object, requires a non-zero bitpattern when zero-initialized.
- private bool IsZeroInitializableAsBase
- False if any direct or indirect subobject of this class, when considered as a base subobject, requires a non-zero bitpattern when zero-initialized.
Method Overview
- private CGRecordLayout(const clang::CodeGen::CGRecordLayout &)
- public CGRecordLayout(llvm::StructType * CompleteObjectType, llvm::StructType * BaseSubobjectType, bool IsZeroInitializable, bool IsZeroInitializableAsBase)
- public void dump() const
- public llvm::StructType * getBaseSubobjectLLVMType() const
- public const clang::CodeGen::CGBitFieldInfo & getBitFieldInfo(const clang::FieldDecl * FD) const
- public unsigned int getLLVMFieldNo(const clang::FieldDecl * FD) const
- public llvm::StructType * getLLVMType() const
- public unsigned int getNonVirtualBaseLLVMFieldNo(const clang::CXXRecordDecl * RD) const
- public unsigned int getVirtualBaseIndex(const clang::CXXRecordDecl * base) const
- public bool hasNonVirtualBaseLLVMField(const clang::CXXRecordDecl * RD) const
- public bool isZeroInitializable() const
- public bool isZeroInitializableAsBase() const
- public void print(llvm::raw_ostream & OS) const
Methods
¶CGRecordLayout(
const clang::CodeGen::CGRecordLayout&)
CGRecordLayout(
const clang::CodeGen::CGRecordLayout&)
Declared at: clang/lib/CodeGen/CGRecordLayout.h:124
Parameters
¶CGRecordLayout(
llvm::StructType* CompleteObjectType,
llvm::StructType* BaseSubobjectType,
bool IsZeroInitializable,
bool IsZeroInitializableAsBase)
CGRecordLayout(
llvm::StructType* CompleteObjectType,
llvm::StructType* BaseSubobjectType,
bool IsZeroInitializable,
bool IsZeroInitializableAsBase)
Declared at: clang/lib/CodeGen/CGRecordLayout.h:162
Parameters
- llvm::StructType* CompleteObjectType
- llvm::StructType* BaseSubobjectType
- bool IsZeroInitializable
- bool IsZeroInitializableAsBase
¶void dump() const
void dump() const
Declared at: clang/lib/CodeGen/CGRecordLayout.h:232
¶llvm::StructType* getBaseSubobjectLLVMType() const
llvm::StructType* getBaseSubobjectLLVMType() const
Description
Return the "base subobject" LLVM type associated with this record.
Declared at: clang/lib/CodeGen/CGRecordLayout.h:179
¶const clang::CodeGen::CGBitFieldInfo&
getBitFieldInfo(const clang::FieldDecl* FD) const
const clang::CodeGen::CGBitFieldInfo&
getBitFieldInfo(const clang::FieldDecl* FD) const
Description
Return the BitFieldInfo that corresponds to the field FD.
Declared at: clang/lib/CodeGen/CGRecordLayout.h:222
Parameters
- const clang::FieldDecl* FD
¶unsigned int getLLVMFieldNo(
const clang::FieldDecl* FD) const
unsigned int getLLVMFieldNo(
const clang::FieldDecl* FD) const
Description
Return llvm::StructType element number that corresponds to the field FD.
Declared at: clang/lib/CodeGen/CGRecordLayout.h:197
Parameters
- const clang::FieldDecl* FD
¶llvm::StructType* getLLVMType() const
llvm::StructType* getLLVMType() const
Description
Return the "complete object" LLVM type associated with this record.
Declared at: clang/lib/CodeGen/CGRecordLayout.h:173
¶unsigned int getNonVirtualBaseLLVMFieldNo(
const clang::CXXRecordDecl* RD) const
unsigned int getNonVirtualBaseLLVMFieldNo(
const clang::CXXRecordDecl* RD) const
Declared at: clang/lib/CodeGen/CGRecordLayout.h:209
Parameters
- const clang::CXXRecordDecl* RD
¶unsigned int getVirtualBaseIndex(
const clang::CXXRecordDecl* base) const
unsigned int getVirtualBaseIndex(
const clang::CXXRecordDecl* base) const
Description
Return the LLVM field index corresponding to the given virtual base. Only valid when operating on the complete object.
Declared at: clang/lib/CodeGen/CGRecordLayout.h:216
Parameters
- const clang::CXXRecordDecl* base
¶bool hasNonVirtualBaseLLVMField(
const clang::CXXRecordDecl* RD) const
bool hasNonVirtualBaseLLVMField(
const clang::CXXRecordDecl* RD) const
Declared at: clang/lib/CodeGen/CGRecordLayout.h:205
Parameters
- const clang::CXXRecordDecl* RD
¶bool isZeroInitializable() const
bool isZeroInitializable() const
Description
Check whether this struct can be C++ zero-initialized with a zeroinitializer.
Declared at: clang/lib/CodeGen/CGRecordLayout.h:185
¶bool isZeroInitializableAsBase() const
bool isZeroInitializableAsBase() const
Description
Check whether this struct can be C++ zero-initialized with a zeroinitializer when considered as a base subobject.
Declared at: clang/lib/CodeGen/CGRecordLayout.h:191
¶void print(llvm::raw_ostream& OS) const
void print(llvm::raw_ostream& OS) const
Declared at: clang/lib/CodeGen/CGRecordLayout.h:231