diff options
author | David Blaikie <dblaikie@gmail.com> | 2019-11-08 15:31:15 -0800 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2019-11-08 15:31:15 -0800 |
commit | db797bfb2bd24e40d8f0ed422fd4087894ed0eab (patch) | |
tree | c29aed53d81c463c06356781ad0c6fb33a538202 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 736273c7fe3e88baf548cd555f21eb123f81381d (diff) | |
download | bcm5719-llvm-db797bfb2bd24e40d8f0ed422fd4087894ed0eab.tar.gz bcm5719-llvm-db797bfb2bd24e40d8f0ed422fd4087894ed0eab.zip |
DebugInfo: Remove redundant conditionals/checks from macro info emission
These checks fall out naturally from the current implementation without
needing to be explicitly considered anymore.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 56615584a18..4b8a44da3e1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2729,30 +2729,20 @@ void DwarfDebug::emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U) { /// Emit macros into a debug macinfo section. void DwarfDebug::emitDebugMacinfo() { - if (CUMap.empty()) - return; - - if (llvm::all_of(CUMap, [](const decltype(CUMap)::value_type &Pair) { - return Pair.second->getCUNode()->isDebugDirectivesOnly(); - })) - return; - for (const auto &P : CUMap) { auto &TheCU = *P.second; - if (TheCU.getCUNode()->isDebugDirectivesOnly()) - continue; auto *SkCU = TheCU.getSkeleton(); DwarfCompileUnit &U = SkCU ? *SkCU : TheCU; 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"); - Asm->emitInt8(0); - } + if (Macros.empty()) + continue; + Asm->OutStreamer->SwitchSection( + Asm->getObjFileLowering().getDwarfMacinfoSection()); + Asm->OutStreamer->EmitLabel(U.getMacroLabelBegin()); + handleMacroNodes(Macros, U); + Asm->OutStreamer->AddComment("End Of Macro List Mark"); + Asm->emitInt8(0); } } |