diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-01-09 05:08:28 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-01-09 05:08:28 +0000 |
commit | a588365df6c59f80d2f9361e9af1795f1b2c5c08 (patch) | |
tree | f15f40241bfaafbab5e9c139a6fef3256dc747de /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 92d9d627af8608173705d922a208ad9b12245c55 (diff) | |
download | bcm5719-llvm-a588365df6c59f80d2f9361e9af1795f1b2c5c08.tar.gz bcm5719-llvm-a588365df6c59f80d2f9361e9af1795f1b2c5c08.zip |
Prototype of skeleton type units for fission
llvm-svn: 198851
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 247cd04eac7..690ae37674c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2976,6 +2976,21 @@ DwarfCompileUnit *DwarfDebug::constructSkeletonCU(const DwarfCompileUnit *CU) { return NewCU; } +// This DIE has the following attributes: DW_AT_comp_dir, DW_AT_dwo_name, +// DW_AT_addr_base. +DwarfTypeUnit *DwarfDebug::constructSkeletonTU(const DwarfTypeUnit *TU) { + + DIE *Die = new DIE(dwarf::DW_TAG_type_unit); + DwarfTypeUnit *NewTU = new DwarfTypeUnit( + TU->getUniqueID(), Die, TU->getCUNode(), Asm, this, &SkeletonHolder); + NewTU->setTypeSignature(TU->getTypeSignature()); + NewTU->initSection( + Asm->getObjFileLowering().getDwarfTypesSection(TU->getTypeSignature())); + + initSkeletonUnit(TU, Die, NewTU); + return NewTU; +} + // Emit the .debug_info.dwo section for separated dwarf. This contains the // compile units that would normally be in debug_info. void DwarfDebug::emitDebugInfoDWO() { @@ -3018,8 +3033,6 @@ void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode, NewTU->addUInt(UnitDie, dwarf::DW_AT_language, dwarf::DW_FORM_data2, CUNode.getLanguage()); - DIE *Die = NewTU->createTypeDIE(CTy); - MD5 Hash; Hash.update(Identifier); // ... take the least significant 8 bytes and return those. Our MD5 @@ -3029,7 +3042,10 @@ void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode, Hash.final(Result); uint64_t Signature = *reinterpret_cast<support::ulittle64_t *>(Result + 8); NewTU->setTypeSignature(Signature); - NewTU->setType(Die); + if (useSplitDwarf()) + NewTU->setSkeleton(constructSkeletonTU(NewTU)); + + NewTU->setType(NewTU->createTypeDIE(CTy)); NewTU->initSection( useSplitDwarf() |