clang API Documentation
#include <CGVTables.h>
Public Member Functions | |
| CodeGenVTables (CodeGenModule &CGM) | |
| VTableContext & | getVTableContext () |
| bool | ShouldEmitVTableInThisTU (const CXXRecordDecl *RD) |
| True if the VTable of this record must be emitted in the translation unit. | |
| uint64_t | getSubVTTIndex (const CXXRecordDecl *RD, BaseSubobject Base) |
| uint64_t | getSecondaryVirtualPointerIndex (const CXXRecordDecl *RD, BaseSubobject Base) |
| uint64_t | getAddressPoint (BaseSubobject Base, const CXXRecordDecl *RD) |
| llvm::GlobalVariable * | GetAddrOfVTable (const CXXRecordDecl *RD) |
| GetAddrOfVTable - Get the address of the vtable for the given record decl. | |
| void | EmitVTableDefinition (llvm::GlobalVariable *VTable, llvm::GlobalVariable::LinkageTypes Linkage, const CXXRecordDecl *RD) |
| EmitVTableDefinition - Emit the definition of the given vtable. | |
| llvm::GlobalVariable * | GenerateConstructionVTable (const CXXRecordDecl *RD, const BaseSubobject &Base, bool BaseIsVirtual, llvm::GlobalVariable::LinkageTypes Linkage, VTableAddressPointsMapTy &AddressPoints) |
| llvm::GlobalVariable * | GetAddrOfVTT (const CXXRecordDecl *RD) |
| GetAddrOfVTable - Get the address of the VTT for the given record decl. | |
| void | EmitVTTDefinition (llvm::GlobalVariable *VTT, llvm::GlobalVariable::LinkageTypes Linkage, const CXXRecordDecl *RD) |
| EmitVTTDefinition - Emit the definition of the given vtable. | |
| void | EmitThunks (GlobalDecl GD) |
| EmitThunks - Emit the associated thunks for the given global decl. | |
| void | GenerateClassData (llvm::GlobalVariable::LinkageTypes Linkage, const CXXRecordDecl *RD) |
Static Public Member Functions | |
| static bool | needsVTTParameter (GlobalDecl GD) |
Definition at line 31 of file CGVTables.h.
| CodeGenVTables::CodeGenVTables | ( | CodeGenModule & | CGM | ) |
Definition at line 31 of file CGVTables.cpp.
| void CodeGenVTables::EmitThunks | ( | GlobalDecl | GD | ) |
EmitThunks - Emit the associated thunks for the given global decl.
Definition at line 485 of file CGVTables.cpp.
References clang::Dtor_Base, clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), and clang::VTableContext::getThunkInfo().
| void CodeGenVTables::EmitVTableDefinition | ( | llvm::GlobalVariable * | VTable, |
| llvm::GlobalVariable::LinkageTypes | Linkage, | ||
| const CXXRecordDecl * | RD | ||
| ) |
EmitVTableDefinition - Emit the definition of the given vtable.
Definition at line 640 of file CGVTables.cpp.
References clang::VTableLayout::getNumVTableComponents(), clang::VTableLayout::getNumVTableThunks(), clang::VTableContext::getVTableLayout(), clang::CodeGen::CodeGenModule::setTypeVisibility(), clang::CodeGen::CodeGenModule::TVK_ForVTable, clang::VTableLayout::vtable_component_begin(), and clang::VTableLayout::vtable_thunk_begin().
Referenced by GenerateClassData().
| void CodeGenVTables::EmitVTTDefinition | ( | llvm::GlobalVariable * | VTT, |
| llvm::GlobalVariable::LinkageTypes | Linkage, | ||
| const CXXRecordDecl * | RD | ||
| ) |
EmitVTTDefinition - Emit the definition of the given vtable.
Definition at line 41 of file CGVTT.cpp.
References clang::VTableLayout::getAddressPoint(), GetAddrOfVTTVTable(), clang::VTTVTable::getBase(), clang::CodeGen::CodeGenModule::getContext(), clang::VTableContext::getVTableLayout(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenModule::setTypeVisibility(), and clang::CodeGen::CodeGenModule::TVK_ForVTT.
Referenced by GenerateClassData().
| void CodeGenVTables::GenerateClassData | ( | llvm::GlobalVariable::LinkageTypes | Linkage, |
| const CXXRecordDecl * | RD | ||
| ) |
GenerateClassData - Generate all the class data required to be generated upon definition of a KeyFunction. This includes the vtable, the rtti data structure and the VTT.
| Linkage | - The desired linkage of the vtable, the RTTI and the VTT. |
Definition at line 708 of file CGVTables.cpp.
References EmitVTableDefinition(), EmitVTTDefinition(), GetAddrOfVTable(), GetAddrOfVTT(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::CXXRecordDecl::getNumVBases(), clang::DeclContext::getParent(), clang::IdentifierInfo::isStr(), and clang::DeclContext::isTranslationUnit().
Referenced by clang::CodeGen::CodeGenModule::EmitVTable().
| llvm::GlobalVariable * CodeGenVTables::GenerateConstructionVTable | ( | const CXXRecordDecl * | RD, |
| const BaseSubobject & | Base, | ||
| bool | BaseIsVirtual, | ||
| llvm::GlobalVariable::LinkageTypes | Linkage, | ||
| VTableAddressPointsMapTy & | AddressPoints | ||
| ) |
GenerateConstructionVTable - Generate a construction vtable for the given base subobject.
Definition at line 662 of file CGVTables.cpp.
References clang::VTableContext::createConstructionVTableLayout(), clang::CodeGen::CodeGenModule::CreateOrReplaceCXXRuntimeVariable(), clang::BaseSubobject::getBase(), clang::BaseSubobject::getBaseOffset(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenModule::setTypeVisibility(), and clang::CodeGen::CodeGenModule::TVK_ForConstructionVTable.
Referenced by GetAddrOfVTTVTable().
| uint64_t clang::CodeGen::CodeGenVTables::getAddressPoint | ( | BaseSubobject | Base, |
| const CXXRecordDecl * | RD | ||
| ) |
getAddressPoint - Get the address point of the given subobject in the class decl.
| llvm::GlobalVariable * CodeGenVTables::GetAddrOfVTable | ( | const CXXRecordDecl * | RD | ) |
GetAddrOfVTable - Get the address of the vtable for the given record decl.
Definition at line 613 of file CGVTables.cpp.
References clang::CodeGen::CodeGenModule::CreateOrReplaceCXXRuntimeVariable(), clang::CodeGen::CodeGenModule::DeferredVTables, clang::ExternalLinkage, clang::CodeGen::CodeGenModule::getCXXABI(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::VTableLayout::getNumVTableComponents(), clang::VTableContext::getVTableLayout(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::MangleContext::mangleCXXVTable(), and ShouldEmitVTableInThisTU().
Referenced by clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualCall(), clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), GenerateClassData(), GetAddrOfVTT(), GetAddrOfVTTVTable(), and clang::CodeGen::CodeGenFunction::InitializeVTablePointers().
| llvm::GlobalVariable * CodeGenVTables::GetAddrOfVTT | ( | const CXXRecordDecl * | RD | ) |
GetAddrOfVTable - Get the address of the VTT for the given record decl.
Definition at line 99 of file CGVTT.cpp.
References clang::CodeGen::CodeGenModule::CreateOrReplaceCXXRuntimeVariable(), clang::ExternalLinkage, GetAddrOfVTable(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::CXXRecordDecl::getNumVBases(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, and clang::MangleContext::mangleCXXVTT().
Referenced by GenerateClassData(), and GetVTTParameter().
| uint64_t CodeGenVTables::getSecondaryVirtualPointerIndex | ( | const CXXRecordDecl * | RD, |
| BaseSubobject | Base | ||
| ) |
getSecondaryVirtualPointerIndex - Return the index in the VTT where the virtual pointer for the given subobject is located.
Definition at line 167 of file CGVTT.cpp.
References clang::CodeGen::CodeGenModule::getContext().
Referenced by clang::CodeGen::CodeGenFunction::InitializeVTablePointer().
| uint64_t CodeGenVTables::getSubVTTIndex | ( | const CXXRecordDecl * | RD, |
| BaseSubobject | Base | ||
| ) |
getSubVTTIndex - Return the index of the sub-VTT for the base class of the given record decl.
Definition at line 141 of file CGVTT.cpp.
References clang::CodeGen::CodeGenModule::getContext().
Referenced by GetVTTParameter().
| VTableContext& clang::CodeGen::CodeGenVTables::getVTableContext | ( | ) | [inline] |
Definition at line 78 of file CGVTables.h.
Referenced by clang::CodeGen::CodeGenModule::getVTableContext().
| bool CodeGenVTables::needsVTTParameter | ( | GlobalDecl | GD | ) | [static] |
needsVTTParameter - Return whether the given global decl needs a VTT parameter, which it does if it's a base constructor or destructor with virtual bases.
Definition at line 123 of file CGVTT.cpp.
References clang::Ctor_Base, clang::Dtor_Base, clang::GlobalDecl::getCtorType(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CXXRecordDecl::getNumVBases(), and clang::CXXMethodDecl::getParent().
Referenced by clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), GetVTTParameter(), and clang::CodeGen::CodeGenFunction::InitializeVTablePointer().
| bool CodeGenVTables::ShouldEmitVTableInThisTU | ( | const CXXRecordDecl * | RD | ) |
True if the VTable of this record must be emitted in the translation unit.
Definition at line 34 of file CGVTables.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getKeyFunction(), clang::CodeGen::CodeGenModule::getLangOptions(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::FunctionDecl::hasBody(), clang::CXXRecordDecl::isDynamicClass(), clang::CodeGenOptions::OptimizationLevel, clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, and clang::TSK_ImplicitInstantiation.
Referenced by GetAddrOfVTable(), and ShouldUseExternalRTTIDescriptor().