clang 22.0.0git
|
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/CodeGen/CIRGenVTables.h"
Public Member Functions | |
CIRGenVTables (CIRGenModule &cgm) | |
void | createVTableInitializer (cir::GlobalOp &vtable, const clang::VTableLayout &layout, mlir::Attribute rtti, bool vtableHasLocalLinkage) |
Add vtable components for the given vtable layout to the given global initializer. | |
clang::ItaniumVTableContext & | getItaniumVTableContext () |
const clang::ItaniumVTableContext & | getItaniumVTableContext () const |
cir::GlobalOp | generateConstructionVTable (const CXXRecordDecl *rd, const BaseSubobject &base, bool baseIsVirtual, cir::GlobalLinkageKind linkage, VTableAddressPointsMapTy &addressPoints) |
Generate a construction vtable for the given base subobject. | |
cir::GlobalOp | getAddrOfVTT (const CXXRecordDecl *rd) |
Get the address of the VTT for the given record decl. | |
void | emitVTTDefinition (cir::GlobalOp vttOp, cir::GlobalLinkageKind linkage, const CXXRecordDecl *rd) |
Emit the definition of the given vtable. | |
void | emitThunks (GlobalDecl gd) |
Emit the associated thunks for the given global decl. | |
void | generateClassData (const CXXRecordDecl *rd) |
Generate all the class data required to be generated upon definition of a KeyFunction. | |
cir::RecordType | getVTableType (const clang::VTableLayout &layout) |
Returns the type of a vtable with the given layout. | |
Definition at line 28 of file CIRGenVTables.h.
CIRGenVTables::CIRGenVTables | ( | CIRGenModule & | cgm | ) |
Definition at line 26 of file CIRGenVTables.cpp.
void CIRGenVTables::createVTableInitializer | ( | cir::GlobalOp & | vtable, |
const clang::VTableLayout & | layout, | ||
mlir::Attribute | rtti, | ||
bool | vtableHasLocalLinkage | ||
) |
Add vtable components for the given vtable layout to the given global initializer.
Definition at line 140 of file CIRGenVTables.cpp.
References clang::VTableLayout::getAddressPointIndices(), clang::CIRGen::CIRGenBuilderTy::getAnonConstRecord(), clang::CIRGen::CIRGenModule::getBuilder(), clang::CIRGen::CIRGenModule::getMLIRContext(), clang::VTableLayout::getVTableOffset(), clang::VTableLayout::getVTableSize(), and clang::CIRGen::CIRGenModule::setInitializer().
Referenced by generateConstructionVTable().
void CIRGenVTables::emitThunks | ( | GlobalDecl | gd | ) |
Emit the associated thunks for the given global decl.
Definition at line 395 of file CIRGenVTables.cpp.
References clang::Dtor_Base, clang::CIRGen::CIRGenModule::errorNYI(), clang::CXXMethodDecl::getCanonicalDecl(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::FunctionDecl::getSourceRange(), and clang::VTableContextBase::getThunkInfo().
Referenced by clang::CIRGen::CIRGenModule::emitGlobalDefinition().
void CIRGenVTables::emitVTTDefinition | ( | cir::GlobalOp | vttOp, |
cir::GlobalLinkageKind | linkage, | ||
const CXXRecordDecl * | rd | ||
) |
Emit the definition of the given vtable.
Definition at line 334 of file CIRGenVTables.cpp.
References clang::VTableLayout::AddressPointLocation::AddressPointIndex, clang::ast_matchers::arrayType, clang::VTableLayout::getAddressPoint(), getAddrOfVTTVTable(), clang::CIRGen::CIRGenModule::getASTContext(), clang::VTTVTable::getBase(), clang::CIRGen::CIRGenModule::getBuilder(), cir::CIRBaseBuilderTy::getGlobalViewAttr(), getItaniumVTableContext(), clang::CIRGen::CIRGenModule::getMLIRContext(), clang::CIRGen::CIRGenModule::getMLIRVisibility(), clang::CIRGen::CIRGenBuilderTy::getUInt8PtrTy(), clang::ItaniumVTableContext::getVTableLayout(), clang::VTTBuilder::getVTTComponents(), clang::VTTBuilder::getVTTVTables(), clang::CIRGen::CIRGenModule::supportsCOMDAT(), and clang::VTableLayout::AddressPointLocation::VTableIndex.
void CIRGenVTables::generateClassData | ( | const CXXRecordDecl * | rd | ) |
Generate all the class data required to be generated upon definition of a KeyFunction.
This includes the vtable, the RTTI data structure (if RTTI is enabled) and the VTT (if the class has virtual bases).
Definition at line 60 of file CIRGenVTables.cpp.
References clang::CIRGen::CIRGenCXXABI::emitVirtualInheritanceTables(), clang::CIRGen::CIRGenCXXABI::emitVTableDefinitions(), cir::MissingFeatures::generateDebugInfo(), clang::CIRGen::CIRGenModule::getCXXABI(), and clang::CXXRecordDecl::getNumVBases().
Referenced by clang::CIRGen::CIRGenModule::emitVTable().
cir::GlobalOp CIRGenVTables::generateConstructionVTable | ( | const CXXRecordDecl * | rd, |
const BaseSubobject & | base, | ||
bool | baseIsVirtual, | ||
cir::GlobalLinkageKind | linkage, | ||
VTableAddressPointsMapTy & | addressPoints | ||
) |
Generate a construction vtable for the given base subobject.
Definition at line 181 of file CIRGenVTables.cpp.
References clang::CIRGen::CIRGenModule::createOrReplaceCXXRuntimeVariable(), createVTableInitializer(), clang::CharUnits::fromQuantity(), cir::MissingFeatures::generateDebugInfo(), cir::CIRDataLayout::getABITypeAlign(), clang::CIRGen::CIRGenModule::getAddrOfRTTIDescriptor(), clang::CIRGen::CIRGenModule::getASTContext(), clang::BaseSubobject::getBase(), clang::BaseSubobject::getBaseOffset(), clang::ASTContext::getCanonicalTagType(), clang::CIRGen::CIRGenModule::getCXXABI(), clang::CIRGen::CIRGenModule::getDataLayout(), getItaniumVTableContext(), clang::CIRGen::CIRGenModule::getLoc(), clang::CIRGen::CIRGenCXXABI::getMangleContext(), clang::CharUnits::getQuantity(), clang::TagDecl::getSourceRange(), getVTableType(), cir::isLocalLinkage(), cir::MissingFeatures::opGlobalUnnamedAddr(), clang::out, clang::CIRGen::CIRGenModule::setGVProperties(), cir::MissingFeatures::vtableEmitMetadata(), and cir::MissingFeatures::vtableRelativeLayout().
Referenced by getAddrOfVTTVTable().
cir::GlobalOp CIRGenVTables::getAddrOfVTT | ( | const CXXRecordDecl * | rd | ) |
Get the address of the VTT for the given record decl.
Definition at line 292 of file CIRGenVTables.cpp.
References clang::ast_matchers::arrayType, clang::CIRGen::CIRGenModule::createOrReplaceCXXRuntimeVariable(), clang::CharUnits::fromQuantity(), cir::CIRDataLayout::getABITypeAlign(), clang::CIRGen::CIRGenCXXABI::getAddrOfVTable(), clang::CIRGen::CIRGenModule::getASTContext(), clang::CIRGen::CIRGenModule::getBuilder(), clang::CIRGen::CIRGenModule::getCXXABI(), clang::CIRGen::CIRGenModule::getDataLayout(), clang::CIRGen::CIRGenModule::getLoc(), clang::CIRGen::CIRGenCXXABI::getMangleContext(), clang::CXXRecordDecl::getNumVBases(), clang::TagDecl::getSourceRange(), clang::CIRGen::CIRGenBuilderTy::getUInt8PtrTy(), clang::VTTBuilder::getVTTComponents(), clang::out, and clang::CIRGen::CIRGenModule::setGVProperties().
|
inline |
Definition at line 53 of file CIRGenVTables.h.
Referenced by emitVTTDefinition(), generateConstructionVTable(), and clang::CIRGen::CIRGenModule::getItaniumVTableContext().
|
inline |
Definition at line 57 of file CIRGenVTables.h.
cir::RecordType CIRGenVTables::getVTableType | ( | const clang::VTableLayout & | layout | ) |
Returns the type of a vtable with the given layout.
Normally a struct of arrays of pointers, with one struct element for each vtable in the vtable group.
Definition at line 39 of file CIRGenVTables.cpp.
References clang::CIRGen::CIRGenBuilderTy::getAnonRecordTy(), clang::CIRGen::CIRGenModule::getBuilder(), clang::VTableLayout::getNumVTables(), and clang::VTableLayout::getVTableSize().
Referenced by generateConstructionVTable().