From 39c308f6b8f06710b2b98d0b126c9175e4bafc20 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 8 Nov 2019 12:56:49 -0800 Subject: DebugInfo: Use separate macinfo contributions for each CU The macinfo support was broken for LTO situations, by terminating macinfo lists only once - multiple macinfo contributions were correctly labeled, but they all continued/flowed into later contributions until only one terminator appeared at the end of the section. Correctly terminate each contribution & fix the parsing to handle this situation too. The parsing fix is also necessary for dumping linked binaries - the previous code would stop at the end of the first contribution - missing all later contributions in a linked binary. It'd be nice to improve the dumping to print the offsets of each contribution so it'd be easier to know which CU AT_macro_info refers to which macinfo contribution. --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 97ef439b8a5..d17dd4dc3f7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2752,10 +2752,10 @@ void DwarfDebug::emitDebugMacinfo() { if (!Macros.empty()) { Asm->OutStreamer->EmitLabel(U.getMacroLabelBegin()); handleMacroNodes(Macros, U); + Asm->OutStreamer->AddComment("End Of Macro List Mark"); + Asm->emitInt8(0); } } - Asm->OutStreamer->AddComment("End Of Macro List Mark"); - Asm->emitInt8(0); } // DWARF5 Experimental Separate Dwarf emitters. -- cgit v1.2.3