summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2019-11-08 15:26:17 -0800
committerDavid Blaikie <dblaikie@gmail.com>2019-11-08 15:30:11 -0800
commit736273c7fe3e88baf548cd555f21eb123f81381d (patch)
treef35020c55f281f944bd24a95a4ef63ee73939169 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent6278fba9b11751b97c6091049341c51226c5b434 (diff)
downloadbcm5719-llvm-736273c7fe3e88baf548cd555f21eb123f81381d.tar.gz
bcm5719-llvm-736273c7fe3e88baf548cd555f21eb123f81381d.zip
DebugInfo: Do not create a debug_macinfo section if no CUs have associated macros
Patch based on Sourabh Singh's D69839 patch.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index d17dd4dc3f7..56615584a18 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2737,10 +2737,6 @@ void DwarfDebug::emitDebugMacinfo() {
}))
return;
- // Start the dwarf macinfo section.
- Asm->OutStreamer->SwitchSection(
- Asm->getObjFileLowering().getDwarfMacinfoSection());
-
for (const auto &P : CUMap) {
auto &TheCU = *P.second;
if (TheCU.getCUNode()->isDebugDirectivesOnly())
@@ -2750,6 +2746,8 @@ void DwarfDebug::emitDebugMacinfo() {
auto *CUNode = cast<DICompileUnit>(P.first);
DIMacroNodeArray Macros = CUNode->getMacros();
if (!Macros.empty()) {
+ Asm->OutStreamer->SwitchSection(
+ Asm->getObjFileLowering().getDwarfMacinfoSection());
Asm->OutStreamer->EmitLabel(U.getMacroLabelBegin());
handleMacroNodes(Macros, U);
Asm->OutStreamer->AddComment("End Of Macro List Mark");
OpenPOWER on IntegriCloud