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 | c3d9e9e55ffea2b04e254cd9ce45136e76ed5cbb (patch) | |
tree | 995bea70eca7f21d808f9201678808bcc671f71c /llvm/lib/CodeGen | |
parent | 57a98509616eb5c17821c84de64a9995509bb636 (diff) | |
download | bcm5719-llvm-c3d9e9e55ffea2b04e254cd9ce45136e76ed5cbb.tar.gz bcm5719-llvm-c3d9e9e55ffea2b04e254cd9ce45136e76ed5cbb.zip |
DebugInfo: Shrink pubnames/pubtypes in the presence of type units by only emitting pub sections for compile units
llvm-svn: 203057
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a59b40d90bf..6404e4b5229 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/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/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index d2ac2897239..ddc1c2f4bc0 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/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; } |