summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CGVTables.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-09-08 01:14:39 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-09-08 01:14:39 +0000
commit0d892e5f8350252108762c66e0d30fa6bad22b6f (patch)
treeddc986e6499c5638ac6e1b4e61086652c3ffc20d /lib/CodeGen/CGVTables.h
parentdd34fc94f9ec374d72ae81918e61c83224841217 (diff)
CodeGen: Clean up implementation of vtable initializer builder. NFC.
- Simplify signature of CreateVTableInitializer function. - Move vtable component builder to a separate function. - Remove unnecessary accessors from VTableLayout class. This is in preparation for a future change that will alter the type of the vtable initializer. Differential Revision: https://reviews.llvm.org/D22642 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280897 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTables.h')
-rw-r--r--lib/CodeGen/CGVTables.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/CodeGen/CGVTables.h b/lib/CodeGen/CGVTables.h
index c27e54af25..be58446dbe 100644
--- a/lib/CodeGen/CGVTables.h
+++ b/lib/CodeGen/CGVTables.h
@@ -49,6 +49,12 @@ class CodeGenVTables {
/// indices.
SecondaryVirtualPointerIndicesMapTy SecondaryVirtualPointerIndices;
+ /// Cache for the pure virtual member call function.
+ llvm::Constant *PureVirtualFn = nullptr;
+
+ /// Cache for the deleted virtual member call function.
+ llvm::Constant *DeletedVirtualFn = nullptr;
+
/// emitThunk - Emit a single thunk.
void emitThunk(GlobalDecl GD, const ThunkInfo &Thunk, bool ForVTable);
@@ -56,15 +62,16 @@ class CodeGenVTables {
/// the ABI.
void maybeEmitThunkForVTable(GlobalDecl GD, const ThunkInfo &Thunk);
+ llvm::Constant *CreateVTableComponent(unsigned Idx,
+ const VTableLayout &VTLayout,
+ llvm::Constant *RTTI,
+ unsigned &NextVTableThunkIndex);
+
public:
- /// CreateVTableInitializer - Create a vtable initializer for the given record
- /// 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 *RTTI);
+ /// CreateVTableInitializer - Create a vtable initializer with the given
+ /// layout.
+ llvm::Constant *CreateVTableInitializer(const VTableLayout &VTLayout,
+ llvm::Constant *RTTI);
CodeGenVTables(CodeGenModule &CGM);