diff options
author | Paul Robinson <paul.robinson@sony.com> | 2018-11-09 19:06:09 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2018-11-09 19:06:09 +0000 |
commit | ddbde9a4add367c12b4ff8bda5e7a6b351b645c6 (patch) | |
tree | 29081d6179b75582c07b6cd5eb4e00fc3bd592a2 /llvm/lib | |
parent | 731ea7dbc1da611beed2e492446df3408c85e638 (diff) | |
download | bcm5719-llvm-ddbde9a4add367c12b4ff8bda5e7a6b351b645c6.tar.gz bcm5719-llvm-ddbde9a4add367c12b4ff8bda5e7a6b351b645c6.zip |
[DWARFv5] Emit normal type units in .debug_info comdats.
Differential Revision: https://reviews.llvm.org/D54282
llvm-svn: 346540
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 9 |
2 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 070b8fe4ec1..5d50f34d77d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2610,9 +2610,14 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU, Ins.first->second = Signature; if (useSplitDwarf()) + // FIXME: v5 split type units belong in .debug_info.dwo. NewTU.setSection(Asm->getObjFileLowering().getDwarfTypesDWOSection()); else { - NewTU.setSection(Asm->getObjFileLowering().getDwarfTypesSection(Signature)); + MCSection *Section = + getDwarfVersion() <= 4 + ? Asm->getObjFileLowering().getDwarfTypesSection(Signature) + : Asm->getObjFileLowering().getDwarfInfoSection(Signature); + NewTU.setSection(Section); // Non-split type units reuse the compile unit's line table. CU.applyStmtList(UnitDie); } diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index ab8e0f31db9..0513ba5a82a 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -812,16 +812,17 @@ void MCObjectFileInfo::InitMCObjectFileInfo(const Triple &TheTriple, bool PIC, } } -MCSection *MCObjectFileInfo::getDwarfTypesSection(uint64_t Hash) const { +MCSection *MCObjectFileInfo::getDwarfComdatSection(const char *Name, + uint64_t Hash) const { switch (TT.getObjectFormat()) { case Triple::ELF: - return Ctx->getELFSection(".debug_types", ELF::SHT_PROGBITS, ELF::SHF_GROUP, - 0, utostr(Hash)); + return Ctx->getELFSection(Name, ELF::SHT_PROGBITS, ELF::SHF_GROUP, 0, + utostr(Hash)); case Triple::MachO: case Triple::COFF: case Triple::Wasm: case Triple::UnknownObjectFormat: - report_fatal_error("Cannot get DWARF types section for this object file " + report_fatal_error("Cannot get DWARF comdat section for this object file " "format: not implemented."); break; } |