diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-06 01:42:00 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-06 01:42:00 +0000 |
commit | 4b2ab80c3ebd3bd8214ee0ca6d991d6c691c63a8 (patch) | |
tree | e16cc6f16be9a9f6b81fb7d5c4235dc1cb253ff1 /lib | |
parent | b29a86a832d9994138873674662bdce1ffa557de (diff) | |
download | llvm-4b2ab80c3ebd3bd8214ee0ca6d991d6c691c63a8.tar.gz llvm-4b2ab80c3ebd3bd8214ee0ca6d991d6c691c63a8.tar.bz2 llvm-4b2ab80c3ebd3bd8214ee0ca6d991d6c691c63a8.tar.xz |
DebugInfo: Shrink pubnames/pubtypes in the presence of type units by only emitting pub sections for compile units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 16 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a59b40d90b..6404e4b522 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2310,10 +2310,10 @@ void DwarfDebug::emitDebugPubNames(bool GnuStyle) { GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubNamesSection() : Asm->getObjFileLowering().getDwarfPubNamesSection(); - DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder; - const SmallVectorImpl<DwarfUnit *> &Units = Holder.getUnits(); - for (unsigned i = 0; i != Units.size(); ++i) { - DwarfUnit *TheU = Units[i]; + for (const auto &NU : CUMap) { + DwarfCompileUnit *TheU = NU.second; + if (auto Skeleton = static_cast<DwarfCompileUnit *>(TheU->getSkeleton())) + TheU = Skeleton; unsigned ID = TheU->getUniqueID(); // Start the dwarf pubnames section. @@ -2374,10 +2374,10 @@ void DwarfDebug::emitDebugPubTypes(bool GnuStyle) { GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubTypesSection() : Asm->getObjFileLowering().getDwarfPubTypesSection(); - DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder; - const SmallVectorImpl<DwarfUnit *> &Units = Holder.getUnits(); - for (unsigned i = 0; i != Units.size(); ++i) { - DwarfUnit *TheU = Units[i]; + for (const auto &NU : CUMap) { + DwarfCompileUnit *TheU = NU.second; + if (auto Skeleton = static_cast<DwarfCompileUnit *>(TheU->getSkeleton())) + TheU = Skeleton; unsigned ID = TheU->getUniqueID(); // Start the dwarf pubtypes section. diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index d2ac289723..ddc1c2f4bc 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -958,6 +958,8 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) { // Create new type. TyDIE = createAndAddDIE(Ty.getTag(), *ContextDIE, Ty); + updateAcceleratorTables(Context, Ty, TyDIE); + if (Ty.isBasicType()) constructTypeDIE(*TyDIE, DIBasicType(Ty)); else if (Ty.isCompositeType()) { @@ -974,8 +976,6 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) { constructTypeDIE(*TyDIE, DIDerivedType(Ty)); } - updateAcceleratorTables(Context, Ty, TyDIE); - return TyDIE; } |