clang  6.0.0svn
Public Member Functions | Friends | List of all members
clang::CodeGen::CGRecordLayout Class Reference

CGRecordLayout - This class handles struct and union layout info while lowering AST types to LLVM types. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/CodeGen/CGRecordLayout.h"

Public Member Functions

 CGRecordLayout (llvm::StructType *CompleteObjectType, llvm::StructType *BaseSubobjectType, bool IsZeroInitializable, bool IsZeroInitializableAsBase)
 
llvm::StructType * getLLVMType () const
 Return the "complete object" LLVM type associated with this record. More...
 
llvm::StructType * getBaseSubobjectLLVMType () const
 Return the "base subobject" LLVM type associated with this record. More...
 
bool isZeroInitializable () const
 Check whether this struct can be C++ zero-initialized with a zeroinitializer. More...
 
bool isZeroInitializableAsBase () const
 Check whether this struct can be C++ zero-initialized with a zeroinitializer when considered as a base subobject. More...
 
unsigned getLLVMFieldNo (const FieldDecl *FD) const
 Return llvm::StructType element number that corresponds to the field FD. More...
 
unsigned getNonVirtualBaseLLVMFieldNo (const CXXRecordDecl *RD) const
 
unsigned getVirtualBaseIndex (const CXXRecordDecl *base) const
 Return the LLVM field index corresponding to the given virtual base. More...
 
const CGBitFieldInfogetBitFieldInfo (const FieldDecl *FD) const
 Return the BitFieldInfo that corresponds to the field FD. More...
 
void print (raw_ostream &OS) const
 
void dump () const
 

Friends

class CodeGenTypes
 

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

Definition at line 109 of file CGRecordLayout.h.

Constructor & Destructor Documentation

◆ CGRecordLayout()

clang::CodeGen::CGRecordLayout::CGRecordLayout ( llvm::StructType *  CompleteObjectType,
llvm::StructType *  BaseSubobjectType,
bool  IsZeroInitializable,
bool  IsZeroInitializableAsBase 
)
inline

Definition at line 150 of file CGRecordLayout.h.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void CGRecordLayout::dump ( ) const

Definition at line 878 of file CGRecordLayoutBuilder.cpp.

References print().

◆ getBaseSubobjectLLVMType()

llvm::StructType* clang::CodeGen::CGRecordLayout::getBaseSubobjectLLVMType ( ) const
inline

Return the "base subobject" LLVM type associated with this record.

Definition at line 167 of file CGRecordLayout.h.

Referenced by EmitNullConstant().

◆ getBitFieldInfo()

const CGBitFieldInfo& clang::CodeGen::CGRecordLayout::getBitFieldInfo ( const FieldDecl FD) const
inline

Return the BitFieldInfo that corresponds to the field FD.

Definition at line 204 of file CGRecordLayout.h.

References dump(), clang::FieldDecl::getCanonicalDecl(), and clang::FieldDecl::isBitField().

Referenced by clang::CodeGen::CodeGenFunction::EmitConstructorBody(), and clang::CodeGen::CodeGenFunction::EmitLValueForField().

◆ getLLVMFieldNo()

unsigned clang::CodeGen::CGRecordLayout::getLLVMFieldNo ( const FieldDecl FD) const
inline

Return llvm::StructType element number that corresponds to the field FD.

Definition at line 185 of file CGRecordLayout.h.

References clang::FieldDecl::getCanonicalDecl().

Referenced by emitAddrOfFieldStorage(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), and clang::CodeGen::getLLVMFieldNumber().

◆ getLLVMType()

llvm::StructType* clang::CodeGen::CGRecordLayout::getLLVMType ( ) const
inline

Return the "complete object" LLVM type associated with this record.

Definition at line 161 of file CGRecordLayout.h.

Referenced by EmitNullConstant().

◆ getNonVirtualBaseLLVMFieldNo()

unsigned clang::CodeGen::CGRecordLayout::getNonVirtualBaseLLVMFieldNo ( const CXXRecordDecl RD) const
inline

Definition at line 191 of file CGRecordLayout.h.

◆ getVirtualBaseIndex()

unsigned clang::CodeGen::CGRecordLayout::getVirtualBaseIndex ( const CXXRecordDecl base) const
inline

Return the LLVM field index corresponding to the given virtual base.

Only valid when operating on the complete object.

Definition at line 198 of file CGRecordLayout.h.

◆ isZeroInitializable()

bool clang::CodeGen::CGRecordLayout::isZeroInitializable ( ) const
inline

Check whether this struct can be C++ zero-initialized with a zeroinitializer.

Definition at line 173 of file CGRecordLayout.h.

Referenced by clang::CodeGen::CodeGenTypes::isZeroInitializable().

◆ isZeroInitializableAsBase()

bool clang::CodeGen::CGRecordLayout::isZeroInitializableAsBase ( ) const
inline

Check whether this struct can be C++ zero-initialized with a zeroinitializer when considered as a base subobject.

Definition at line 179 of file CGRecordLayout.h.

Referenced by EmitNullConstantForBase().

◆ print()

void CGRecordLayout::print ( raw_ostream &  OS) const

Friends And Related Function Documentation

◆ CodeGenTypes

friend class CodeGenTypes
friend

Definition at line 110 of file CGRecordLayout.h.


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