From 41ca6058132f554033db0bbdd12032e20237fe0d Mon Sep 17 00:00:00 2001 From: Djordje Todorovic Date: Tue, 12 May 2020 09:04:57 +0200 Subject: [PATCH] Revert "[NFC][DwarfDebug] Avoid default capturing when using lambdas" Reverting this because we found it isn't that useful. Please see https://reviews.llvm.org/D79616. This reverts commit rG45e5a32a8bd3. --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 31 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index bd03394..f53fd301 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -706,21 +706,20 @@ static void collectCallSiteParameters(const MachineInstr *CallMI, // If the MI is an instruction defining one or more parameters' forwarding // registers, add those defines. - auto getForwardingRegsDefinedByMI = - [&TRI](const MachineInstr &MI, SmallSetVector &Defs, - const FwdRegWorklist &ForwardedRegWorklist) { - if (MI.isDebugInstr()) - return; - - for (const MachineOperand &MO : MI.operands()) { - if (MO.isReg() && MO.isDef() && - Register::isPhysicalRegister(MO.getReg())) { - for (auto FwdReg : ForwardedRegWorklist) - if (TRI.regsOverlap(FwdReg.first, MO.getReg())) - Defs.insert(FwdReg.first); - } - } - }; + auto getForwardingRegsDefinedByMI = [&](const MachineInstr &MI, + SmallSetVector &Defs) { + if (MI.isDebugInstr()) + return; + + for (const MachineOperand &MO : MI.operands()) { + if (MO.isReg() && MO.isDef() && + Register::isPhysicalRegister(MO.getReg())) { + for (auto FwdReg : ForwardedRegWorklist) + if (TRI.regsOverlap(FwdReg.first, MO.getReg())) + Defs.insert(FwdReg.first); + } + } + }; // Search for a loading value in forwarding registers. for (; I != MBB->rend(); ++I) { @@ -739,7 +738,7 @@ static void collectCallSiteParameters(const MachineInstr *CallMI, // Set of worklist registers that are defined by this instruction. SmallSetVector FwdRegDefs; - getForwardingRegsDefinedByMI(*I, FwdRegDefs, ForwardedRegWorklist); + getForwardingRegsDefinedByMI(*I, FwdRegDefs); if (FwdRegDefs.empty()) continue; -- 2.7.4