diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-18 01:17:26 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-18 01:17:26 +0000 |
commit | 4a2f95f60ee386dc87d29d5f763fa4fb046550ff (patch) | |
tree | 4dc2f624e58e405c9fb6e133613d6d1ee8000a27 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | cf9e671f5c909334ae5f6e0402e33162282c82fd (diff) | |
download | bcm5719-llvm-4a2f95f60ee386dc87d29d5f763fa4fb046550ff.tar.gz bcm5719-llvm-4a2f95f60ee386dc87d29d5f763fa4fb046550ff.zip |
DebugInfo: Implement debug_line.dwo for file names used in type units during -gsplit-dwarf
This removes an attribute (and more importantly, a relocation) from
skeleton type units and removes some unnecessary file names from the
debug_line section that remains in the .o (and linked executable) file.
There's still a few places we could shave off some more space here:
* use compilation dir of the underlying compilation unit (since all the
type units share that compilation dir - though this would be more
complicated in LTO cases where they don't (keep a map of compilation
dir->line table header?))
* Remove some of the unnecessary header fields from the line table since
they're not needed in this situation (about 12 bytes per table).
llvm-svn: 204099
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 77765e12f81..ab03753227d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1060,6 +1060,7 @@ void DwarfDebug::endModule() { emitDebugStrDWO(); emitDebugInfoDWO(); emitDebugAbbrevDWO(); + emitDebugLineDWO(); // Emit DWO addresses. InfoHolder.emitAddresses(Asm->getObjFileLowering().getDwarfAddrSection()); } @@ -2658,7 +2659,6 @@ DwarfTypeUnit *DwarfDebug::constructSkeletonTU(DwarfTypeUnit *TU) { NewTU->setType(NULL); NewTU->initSection( Asm->getObjFileLowering().getDwarfTypesSection(TU->getTypeSignature())); - CU.applyStmtList(*Die); initSkeletonUnit(TU, Die, NewTU); return NewTU; @@ -2680,6 +2680,13 @@ void DwarfDebug::emitDebugAbbrevDWO() { InfoHolder.emitAbbrevs(Asm->getObjFileLowering().getDwarfAbbrevDWOSection()); } +void DwarfDebug::emitDebugLineDWO() { + assert(useSplitDwarf() && "No split dwarf?"); + Asm->OutStreamer.SwitchSection( + Asm->getObjFileLowering().getDwarfLineDWOSection()); + Asm->OutStreamer.EmitLabel(SplitTypeUnitFileTable.Emit(&Asm->OutStreamer).second); +} + // Emit the .debug_str.dwo section for separated dwarf. This contains the // string section and is identical in format to traditional .debug_str // sections. @@ -2708,8 +2715,9 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU, } DIE *UnitDie = new DIE(dwarf::DW_TAG_type_unit); - DwarfTypeUnit *NewTU = new DwarfTypeUnit(InfoHolder.getUnits().size(), - UnitDie, CU, Asm, this, &InfoHolder); + DwarfTypeUnit *NewTU = new DwarfTypeUnit( + InfoHolder.getUnits().size(), UnitDie, CU, Asm, this, &InfoHolder, + useSplitDwarf() ? &SplitTypeUnitFileTable : nullptr); TU = NewTU; InfoHolder.addUnit(NewTU); |