diff options
author | Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> | 2019-12-04 18:32:39 +0530 |
---|---|---|
committer | Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> | 2019-12-18 02:12:59 +0530 |
commit | 399273e5ebac04f85257ed37934bb27f521d0617 (patch) | |
tree | 7f0fb1e6c69b2d927aeb32a71d6bf89624b45125 /llvm/lib/CodeGen/AsmPrinter | |
parent | b3f789e037cbfdb1439c01a4eefc9ab9bb0d2c64 (diff) | |
download | bcm5719-llvm-399273e5ebac04f85257ed37934bb27f521d0617.tar.gz bcm5719-llvm-399273e5ebac04f85257ed37934bb27f521d0617.zip |
Recommit "[DebugInfo] Refactored macro related generation,
added a test case for macinfo.dwo emission."
This was reverted in caa412090666c10f854322cdc701c1cbf8ed726e,
since it was causing an assertion failure on Windows bots.
This revision is revised to fix that.
Original commit message -
[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo emission.
Reviewers: dblaikie, aprantl, jini.susan.george
Tags: #debug-info #llvm
Differential Revision: https://reviews.llvm.org/D71008
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 27 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 1 |
2 files changed, 9 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index aa33659cd06..b8905ce5c9d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2769,8 +2769,7 @@ void DwarfDebug::emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U) { Asm->EmitULEB128(dwarf::DW_MACINFO_end_file); } -/// Emit macros into a debug macinfo section. -void DwarfDebug::emitDebugMacinfo() { +void DwarfDebug::emitDebugMacinfoImpl(MCSection *Section) { for (const auto &P : CUMap) { auto &TheCU = *P.second; auto *SkCU = TheCU.getSkeleton(); @@ -2779,8 +2778,7 @@ void DwarfDebug::emitDebugMacinfo() { DIMacroNodeArray Macros = CUNode->getMacros(); if (Macros.empty()) continue; - Asm->OutStreamer->SwitchSection( - Asm->getObjFileLowering().getDwarfMacinfoSection()); + Asm->OutStreamer->SwitchSection(Section); Asm->OutStreamer->EmitLabel(U.getMacroLabelBegin()); handleMacroNodes(Macros, U); Asm->OutStreamer->AddComment("End Of Macro List Mark"); @@ -2788,22 +2786,13 @@ void DwarfDebug::emitDebugMacinfo() { } } +/// Emit macros into a debug macinfo section. +void DwarfDebug::emitDebugMacinfo() { + emitDebugMacinfoImpl(Asm->getObjFileLowering().getDwarfMacinfoSection()); +} + void DwarfDebug::emitDebugMacinfoDWO() { - for (const auto &P : CUMap) { - auto &TheCU = *P.second; - auto *SkCU = TheCU.getSkeleton(); - DwarfCompileUnit &U = SkCU ? *SkCU : TheCU; - auto *CUNode = cast<DICompileUnit>(P.first); - DIMacroNodeArray Macros = CUNode->getMacros(); - if (Macros.empty()) - continue; - Asm->OutStreamer->SwitchSection( - Asm->getObjFileLowering().getDwarfMacinfoDWOSection()); - Asm->OutStreamer->EmitLabel(U.getMacroLabelBegin()); - handleMacroNodes(Macros, U); - Asm->OutStreamer->AddComment("End Of Macro List Mark"); - Asm->emitInt8(0); - } + emitDebugMacinfoImpl(Asm->getObjFileLowering().getDwarfMacinfoDWOSection()); } // DWARF5 Experimental Separate Dwarf emitters. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index 8fc0ac82ff0..f90dd48458e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -517,6 +517,7 @@ class DwarfDebug : public DebugHandlerBase { void emitDebugMacinfo(); /// Emit macros into a debug macinfo.dwo section. void emitDebugMacinfoDWO(); + void emitDebugMacinfoImpl(MCSection *Section); void emitMacro(DIMacro &M); void emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U); void handleMacroNodes(DIMacroNodeArray Nodes, DwarfCompileUnit &U); |