14 #ifndef LLVM_CLANG_LIB_CODEGEN_CGVTABLES_H 15 #define LLVM_CLANG_LIB_CODEGEN_CGVTABLES_H 22 #include "llvm/ADT/DenseMap.h" 23 #include "llvm/IR/GlobalVariable.h" 30 class ConstantArrayBuilder;
31 class ConstantStructBuilder;
41 typedef std::pair<const CXXRecordDecl *, BaseSubobject> BaseSubobjectPairTy;
42 typedef llvm::DenseMap<BaseSubobjectPairTy, uint64_t> SubVTTIndiciesMapTy;
45 SubVTTIndiciesMapTy SubVTTIndicies;
47 typedef llvm::DenseMap<BaseSubobjectPairTy, uint64_t>
48 SecondaryVirtualPointerIndicesMapTy;
52 SecondaryVirtualPointerIndicesMapTy SecondaryVirtualPointerIndices;
55 llvm::Constant *PureVirtualFn =
nullptr;
58 llvm::Constant *DeletedVirtualFn =
nullptr;
70 unsigned &nextVTableThunkIndex);
77 llvm::Constant *rtti);
82 return *cast<ItaniumVTableContext>(VTContext);
86 return *cast<MicrosoftVTableContext>(VTContext);
100 llvm::GlobalVariable *
103 llvm::GlobalVariable::LinkageTypes
Linkage,
104 VTableAddressPointsMapTy& AddressPoints);
112 llvm::GlobalVariable::LinkageTypes Linkage,
void EmitVTTDefinition(llvm::GlobalVariable *VTT, llvm::GlobalVariable::LinkageTypes Linkage, const CXXRecordDecl *RD)
EmitVTTDefinition - Emit the definition of the given vtable.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
uint64_t getSubVTTIndex(const CXXRecordDecl *RD, BaseSubobject Base)
getSubVTTIndex - Return the index of the sub-VTT for the base class of the given record decl...
llvm::Type * getVTableType(const VTableLayout &layout)
Returns the type of a vtable with the given layout.
The this pointer adjustment as well as an optional return adjustment for a thunk. ...
Enums/classes describing ABI related information about constructors, destructors and thunks...
ItaniumVTableContext & getItaniumVTableContext()
bool isVTableExternal(const CXXRecordDecl *RD)
At this point in the translation unit, does it appear that can we rely on the vtable being defined el...
GlobalDecl - represents a global declaration.
The l-value was considered opaque, so the alignment was determined from a type.
llvm::GlobalVariable * GetAddrOfVTT(const CXXRecordDecl *RD)
GetAddrOfVTT - Get the address of the VTT for the given record decl.
CodeGenVTables(CodeGenModule &CGM)
void createVTableInitializer(ConstantStructBuilder &builder, const VTableLayout &layout, llvm::Constant *rtti)
Add vtable components for the given vtable layout to the given global initializer.
llvm::GlobalVariable * 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.
This class organizes the cross-function state that is used while generating LLVM code.
Dataflow Directional Tag Classes.
void EmitThunks(GlobalDecl GD)
EmitThunks - Emit the associated thunks for the given global decl.
uint64_t getSecondaryVirtualPointerIndex(const CXXRecordDecl *RD, BaseSubobject Base)
getSecondaryVirtualPointerIndex - Return the index in the VTT where the virtual pointer for the given...
void GenerateClassData(const CXXRecordDecl *RD)
GenerateClassData - Generate all the class data required to be generated upon definition of a KeyFunc...
MicrosoftVTableContext & getMicrosoftVTableContext()
llvm::DenseMap< BaseSubobject, AddressPointLocation > AddressPointsMapTy
Represents a C++ struct/union/class.
A helper class of ConstantInitBuilder, used for building constant struct initializers.
A helper class of ConstantInitBuilder, used for building constant array initializers.