diff options
author | Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> | 2019-11-29 11:26:00 +0530 |
---|---|---|
committer | Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> | 2019-12-11 01:18:02 +0530 |
commit | 6ef01588f4d75ef43da4ed2a37ba7a8b8daab259 (patch) | |
tree | 735ace101f8cc71ed4eb2dafb08acfad15ee6f20 /llvm/lib/CodeGen | |
parent | 7d0e8930ed08b5f938a317f13d8fc994dd8c551c (diff) | |
download | bcm5719-llvm-6ef01588f4d75ef43da4ed2a37ba7a8b8daab259.tar.gz bcm5719-llvm-6ef01588f4d75ef43da4ed2a37ba7a8b8daab259.zip |
[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified.
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 89a0e350f8f..f6039cc5bc0 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -856,10 +856,13 @@ void DwarfDebug::finishUnitAttributes(const DICompileUnit *DIUnit, // This CU is either a clang module DWO or a skeleton CU. NewCU.addUInt(Die, dwarf::DW_AT_GNU_dwo_id, dwarf::DW_FORM_data8, DIUnit->getDWOId()); - if (!DIUnit->getSplitDebugFilename().empty()) + if (!DIUnit->getSplitDebugFilename().empty()) { // This is a prefabricated skeleton CU. - NewCU.addString(Die, dwarf::DW_AT_GNU_dwo_name, - DIUnit->getSplitDebugFilename()); + dwarf::Attribute attrDWOName = getDwarfVersion() >= 5 + ? dwarf::DW_AT_dwo_name + : dwarf::DW_AT_GNU_dwo_name; + NewCU.addString(Die, attrDWOName, DIUnit->getSplitDebugFilename()); + } } } // Create new DwarfCompileUnit for the given metadata node with tag @@ -1101,10 +1104,13 @@ void DwarfDebug::finalizeModuleInfo() { bool HasSplitUnit = SkCU && !TheCU.getUnitDie().children().empty(); if (HasSplitUnit) { + dwarf::Attribute attrDWOName = getDwarfVersion() >= 5 + ? dwarf::DW_AT_dwo_name + : dwarf::DW_AT_GNU_dwo_name; finishUnitAttributes(TheCU.getCUNode(), TheCU); - TheCU.addString(TheCU.getUnitDie(), dwarf::DW_AT_GNU_dwo_name, + TheCU.addString(TheCU.getUnitDie(), attrDWOName, Asm->TM.Options.MCOptions.SplitDwarfFile); - SkCU->addString(SkCU->getUnitDie(), dwarf::DW_AT_GNU_dwo_name, + SkCU->addString(SkCU->getUnitDie(), attrDWOName, Asm->TM.Options.MCOptions.SplitDwarfFile); // Emit a unique identifier for this CU. uint64_t ID = |