diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-26 03:56:54 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-26 03:56:54 +0000 |
commit | 2c822f1cecf6e89a129c3e5ad969564b56326140 (patch) | |
tree | d75e9a09535dc16fab454fc6639fb93ad0961eb0 /lib/CodeGen/CGVtable.cpp | |
parent | a7bc8559b40a78d664d6c7faf4b42ff21184c146 (diff) |
Way more VTT builder cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index efad6289c0..77748a6e78 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -4183,31 +4183,15 @@ llvm::Constant *CodeGenVTables::GetAddrOfVTable(const CXXRecordDecl *RD) { llvm::GlobalVariable * CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD, - const BaseSubobject &Base, - bool BaseIsVirtual, - AddressPointsMapTy& AddressPoints) { + const BaseSubobject &Base, + bool BaseIsVirtual, + VTableAddressPointsMapTy& AddressPoints) { if (!CGM.getLangOptions().DumpVtableLayouts) { - llvm::DenseMap<BaseSubobject, uint64_t> VTableAddressPoints; - llvm::GlobalVariable *VTable = GenerateVtable(llvm::GlobalValue::InternalLinkage, /*GenerateDefinition=*/true, RD, Base.getBase(), Base.getBaseOffset(), - BaseIsVirtual, VTableAddressPoints); - - // Add the address points for this base. - for (llvm::DenseMap<BaseSubobject, uint64_t>::const_iterator I = - VTableAddressPoints.begin(), E = VTableAddressPoints.end(); - I != E; ++I) { - - uint64_t &AddressPoint = - AddressPoints[std::make_pair(Base.getBase(), I->first)]; - - // Check if we already have the address points for this base. - assert(!AddressPoint && "Address point already exists for this base!"); - - AddressPoint = I->second; - } + BaseIsVirtual, AddressPoints); return VTable; } @@ -4220,19 +4204,8 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD, Builder.dumpLayout(llvm::errs()); // Add the address points. - for (VtableBuilder::AddressPointsMapTy::const_iterator I = - Builder.address_points_begin(), E = Builder.address_points_end(); - I != E; ++I) { - uint64_t &AddressPoint = - AddressPoints[std::make_pair(Base.getBase(), I->first)]; - -#if 0 - // FIXME: Figure out why this assert fires. - // Check if we already have the address points for this base. - assert(!AddressPoint && "Address point already exists for this base!"); -#endif - AddressPoint = I->second; - } + AddressPoints.insert(Builder.address_points_begin(), + Builder.address_points_end()); // Get the mangled construction vtable name. llvm::SmallString<256> OutName; |