summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2019-12-10 21:32:30 -0500
committerNico Weber <thakis@chromium.org>2019-12-10 21:32:30 -0500
commitcaa412090666c10f854322cdc701c1cbf8ed726e (patch)
tree0ec91337fe0d4d6df8668e09d1983ec9e15fd685 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent2e48be09b02e6d01b85d31704d768b6d0c751751 (diff)
downloadbcm5719-llvm-caa412090666c10f854322cdc701c1cbf8ed726e.tar.gz
bcm5719-llvm-caa412090666c10f854322cdc701c1cbf8ed726e.zip
Revert "[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo emission."
This reverts commit 307f60a1a3ff04313a75e2fc11bc14df4fc2ffb8. DebugInfo/X86/debug-macinfo-split-dwarf.ll fails on Windows: Command Output (stdout): -- $ ":" "RUN: at line 1" $ "c:\src\llvm-project\out\gn\bin\llc.exe" "-mtriple=x86_64-pc-windows-gnu" "-O0" "-split-dwarf-file=foo.dwo" "-filetype=obj" Assertion failed: Section && "Cannot switch to a null section!", file ../../llvm/lib/MC/MCStreamer.cpp, line 1103 Stack dump: 0. Program arguments: c:\src\llvm-project\out\gn\bin\llc.exe -mtriple=x86_64-pc-windows-gnu -O0 -split-dwarf-file=foo.dwo -filetype=obj
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 1e12b39a978..74133280bf2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2792,7 +2792,8 @@ void DwarfDebug::emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U) {
Asm->EmitULEB128(dwarf::DW_MACINFO_end_file);
}
-void DwarfDebug::emitDebugMacinfoImpl(MCSection *Section) {
+/// Emit macros into a debug macinfo section.
+void DwarfDebug::emitDebugMacinfo() {
for (const auto &P : CUMap) {
auto &TheCU = *P.second;
auto *SkCU = TheCU.getSkeleton();
@@ -2801,7 +2802,8 @@ void DwarfDebug::emitDebugMacinfoImpl(MCSection *Section) {
DIMacroNodeArray Macros = CUNode->getMacros();
if (Macros.empty())
continue;
- Asm->OutStreamer->SwitchSection(Section);
+ Asm->OutStreamer->SwitchSection(
+ Asm->getObjFileLowering().getDwarfMacinfoSection());
Asm->OutStreamer->EmitLabel(U.getMacroLabelBegin());
handleMacroNodes(Macros, U);
Asm->OutStreamer->AddComment("End Of Macro List Mark");
@@ -2809,13 +2811,22 @@ void DwarfDebug::emitDebugMacinfoImpl(MCSection *Section) {
}
}
-/// Emit macros into a debug macinfo section.
-void DwarfDebug::emitDebugMacinfo() {
- emitDebugMacinfoImpl(Asm->getObjFileLowering().getDwarfMacinfoSection());
-}
-
void DwarfDebug::emitDebugMacinfoDWO() {
- emitDebugMacinfoImpl(Asm->getObjFileLowering().getDwarfMacinfoDWOSection());
+ 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);
+ }
}
// DWARF5 Experimental Separate Dwarf emitters.
OpenPOWER on IntegriCloud