aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVTables.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGVTables.h')
-rw-r--r--lib/CodeGen/CGVTables.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/CodeGen/CGVTables.h b/lib/CodeGen/CGVTables.h
index e8cd55eed80a..69cf079567e3 100644
--- a/lib/CodeGen/CGVTables.h
+++ b/lib/CodeGen/CGVTables.h
@@ -31,11 +31,8 @@ namespace CodeGen {
class CodeGenVTables {
CodeGenModule &CGM;
- // FIXME: Consider moving ItaniumVTContext and MicrosoftVTContext into
- // respective CXXABI classes?
- ItaniumVTableContext ItaniumVTContext;
- OwningPtr<MicrosoftVTableContext> MicrosoftVTContext;
-
+ VTableContextBase *VTContext;
+
/// VTableAddressPointsMapTy - Address points for a single vtable.
typedef llvm::DenseMap<BaseSubobject, uint64_t> VTableAddressPointsMapTy;
@@ -64,18 +61,19 @@ public:
/// decl.
/// \param Components - The vtable components; this is really an array of
/// VTableComponents.
- llvm::Constant *CreateVTableInitializer(const CXXRecordDecl *RD,
- const VTableComponent *Components,
- unsigned NumComponents,
- const VTableLayout::VTableThunkTy *VTableThunks,
- unsigned NumVTableThunks);
+ llvm::Constant *CreateVTableInitializer(
+ const CXXRecordDecl *RD, const VTableComponent *Components,
+ unsigned NumComponents, const VTableLayout::VTableThunkTy *VTableThunks,
+ unsigned NumVTableThunks, llvm::Constant *RTTI);
CodeGenVTables(CodeGenModule &CGM);
- ItaniumVTableContext &getItaniumVTableContext() { return ItaniumVTContext; }
+ ItaniumVTableContext &getItaniumVTableContext() {
+ return *cast<ItaniumVTableContext>(VTContext);
+ }
MicrosoftVTableContext &getMicrosoftVTableContext() {
- return *MicrosoftVTContext.get();
+ return *cast<MicrosoftVTableContext>(VTContext);
}
/// getSubVTTIndex - Return the index of the sub-VTT for the base class of the
@@ -100,7 +98,7 @@ public:
VTableAddressPointsMapTy& AddressPoints);
- /// GetAddrOfVTable - Get the address of the VTT for the given record decl.
+ /// GetAddrOfVTT - Get the address of the VTT for the given record decl.
llvm::GlobalVariable *GetAddrOfVTT(const CXXRecordDecl *RD);
/// EmitVTTDefinition - Emit the definition of the given vtable.