diff options
| author | David Blaikie <dblaikie@gmail.com> | 2014-02-14 23:58:13 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2014-02-14 23:58:13 +0000 |
| commit | 60e6386b876c6cffc7dcf1db173cb9feeca9cded (patch) | |
| tree | 126fbfd32da1540ad88bcb977b320cb158530615 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
| parent | dfade747f00d67766c24cb7ba7bcea31f403c4f9 (diff) | |
| download | bcm5719-llvm-60e6386b876c6cffc7dcf1db173cb9feeca9cded.tar.gz bcm5719-llvm-60e6386b876c6cffc7dcf1db173cb9feeca9cded.zip | |
DebugInfo: Implement DW_AT_stmt_list for type units
Type units will share the statement list of their defining compile unit.
This is a tradeoff that reduces .o debug info size at the cost of some
linked debug info size (since the contents of those string tables won't
be deduplicated along with the type unit) which seems right for now.
llvm-svn: 201445
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 4c5fe2ecb99..7ffc0b66068 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2944,14 +2944,17 @@ DwarfCompileUnit *DwarfDebug::constructSkeletonCU(const DwarfCompileUnit *CU) { // This DIE has the following attributes: DW_AT_comp_dir, DW_AT_dwo_name, // DW_AT_addr_base. DwarfTypeUnit *DwarfDebug::constructSkeletonTU(DwarfTypeUnit *TU) { + DwarfCompileUnit &CU = static_cast<DwarfCompileUnit &>( + *SkeletonHolder.getUnits()[TU->getCU().getUniqueID()]); DIE *Die = new DIE(dwarf::DW_TAG_type_unit); - DwarfTypeUnit *NewTU = new DwarfTypeUnit(TU->getUniqueID(), Die, TU->getCU(), - Asm, this, &SkeletonHolder); + DwarfTypeUnit *NewTU = + new DwarfTypeUnit(TU->getUniqueID(), Die, CU, Asm, this, &SkeletonHolder); NewTU->setTypeSignature(TU->getTypeSignature()); NewTU->setType(NULL); NewTU->initSection( Asm->getObjFileLowering().getDwarfTypesSection(TU->getTypeSignature())); + CU.applyStmtList(*Die); initSkeletonUnit(TU, Die, NewTU); return NewTU; @@ -3020,6 +3023,8 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU, NewTU->setTypeSignature(Signature); if (useSplitDwarf()) NewTU->setSkeleton(constructSkeletonTU(NewTU)); + else + CU.applyStmtList(*UnitDie); NewTU->setType(NewTU->createTypeDIE(CTy)); |

