diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-25 00:35:49 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-25 00:35:49 +0000 |
commit | ff143f8f78f6f2417d4b46d41c83f287485f0aec (patch) | |
tree | 7c3b5df643570034e50f6187618b0b3e1907b563 /lib/CodeGen/CGVTT.cpp | |
parent | f0e0b17d0504d25b4673de015cf7401e2296323c (diff) |
Shuffle some code around; this will make it easier to use the new layout code for address points.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTT.cpp')
-rw-r--r-- | lib/CodeGen/CGVTT.cpp | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/lib/CodeGen/CGVTT.cpp b/lib/CodeGen/CGVTT.cpp index 66a96967de..863eac30d4 100644 --- a/lib/CodeGen/CGVTT.cpp +++ b/lib/CodeGen/CGVTT.cpp @@ -53,26 +53,10 @@ class VTTBuilder { llvm::Constant *&CtorVtable = CtorVtables[Base]; if (!CtorVtable) { - // Build the vtable. - CodeGenVTables::CtorVtableInfo Info - = CGM.getVTables().getCtorVtable(Class, Base, BaseIsVirtual); - - CtorVtable = Info.Vtable; - - // Add the address points for this base. - for (CodeGenVTables::AddressPointsMapTy::const_iterator I = - Info.AddressPoints.begin(), E = Info.AddressPoints.end(); - I != E; ++I) { - uint64_t &AddressPoint = - CtorVtableAddressPoints[std::make_pair(Base.getBase(), I->first)]; - - // Check if we already have the address points for this base. - if (AddressPoint) - break; - - // Otherwise, insert it. - AddressPoint = I->second; - } + // Get the vtable. + CtorVtable = + CGM.getVTables().GenerateConstructionVTable(Class, Base, BaseIsVirtual, + CtorVtableAddressPoints); } return CtorVtable; @@ -336,18 +320,6 @@ CodeGenVTables::GenerateVTT(llvm::GlobalVariable::LinkageTypes Linkage, return GV; } -CodeGenVTables::CtorVtableInfo -CodeGenVTables::getCtorVtable(const CXXRecordDecl *RD, - const BaseSubobject &Base, bool BaseIsVirtual) { - CtorVtableInfo Info; - - Info.Vtable = GenerateVtable(llvm::GlobalValue::InternalLinkage, - /*GenerateDefinition=*/true, - RD, Base.getBase(), Base.getBaseOffset(), - BaseIsVirtual, Info.AddressPoints); - return Info; -} - llvm::GlobalVariable *CodeGenVTables::getVTT(const CXXRecordDecl *RD) { return GenerateVTT(llvm::GlobalValue::ExternalLinkage, /*GenerateDefinition=*/false, RD); |