From ddbde9a4add367c12b4ff8bda5e7a6b351b645c6 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Fri, 9 Nov 2018 19:06:09 +0000 Subject: [DWARFv5] Emit normal type units in .debug_info comdats. Differential Revision: https://reviews.llvm.org/D54282 llvm-svn: 346540 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter') 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); } -- cgit v1.2.3