summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/ItaniumCXXABI.cpp
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
commite53683f97b13e0ca6b98f0e45d646585dfd483ba (patch)
tree6d26782237265811760c436a91e638c022402603 /clang/lib/CodeGen/ItaniumCXXABI.cpp
parent0053c0b679b516af48086346e38f6c87017a7ca5 (diff)
downloadbcm5719-llvm-e53683f97b13e0ca6b98f0e45d646585dfd483ba.tar.gz
bcm5719-llvm-e53683f97b13e0ca6b98f0e45d646585dfd483ba.zip
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 llvm-svn: 280897
Diffstat (limited to 'clang/lib/CodeGen/ItaniumCXXABI.cpp')
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index ecf4d0411f5..bd9e882dac4 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -1462,9 +1462,7 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables &CGVT,
CGM.GetAddrOfRTTIDescriptor(CGM.getContext().getTagDeclType(RD));
// Create and set the initializer.
- llvm::Constant *Init = CGVT.CreateVTableInitializer(
- RD, VTLayout.vtable_component_begin(), VTLayout.getNumVTableComponents(),
- VTLayout.vtable_thunk_begin(), VTLayout.getNumVTableThunks(), RTTI);
+ llvm::Constant *Init = CGVT.CreateVTableInitializer(VTLayout, RTTI);
VTable->setInitializer(Init);
// Set the correct linkage.
@@ -1575,7 +1573,7 @@ llvm::GlobalVariable *ItaniumCXXABI::getAddrOfVTable(const CXXRecordDecl *RD,
ItaniumVTableContext &VTContext = CGM.getItaniumVTableContext();
llvm::ArrayType *ArrayType = llvm::ArrayType::get(
- CGM.Int8PtrTy, VTContext.getVTableLayout(RD).getNumVTableComponents());
+ CGM.Int8PtrTy, VTContext.getVTableLayout(RD).vtable_components().size());
VTable = CGM.CreateOrReplaceCXXRuntimeVariable(
Name, ArrayType, llvm::GlobalValue::ExternalLinkage);
OpenPOWER on IntegriCloud