clang API Documentation

Public Member Functions | Static Public Member Functions
clang::CodeGen::CodeGenVTables Class Reference

#include <CGVTables.h>

List of all members.

Public Member Functions

 CodeGenVTables (CodeGenModule &CGM)
VTableContextgetVTableContext ()
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)

Detailed Description

Definition at line 31 of file CGVTables.h.


Constructor & Destructor Documentation

CodeGenVTables::CodeGenVTables ( CodeGenModule CGM)

Definition at line 31 of file CGVTables.cpp.


Member Function Documentation

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 
)
void CodeGenVTables::EmitVTTDefinition ( llvm::GlobalVariable *  VTT,
llvm::GlobalVariable::LinkageTypes  Linkage,
const CXXRecordDecl RD 
)
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.

Parameters:
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 
)
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)
llvm::GlobalVariable * CodeGenVTables::GetAddrOfVTT ( const CXXRecordDecl RD)
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)

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