Index: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp =================================================================== --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -706,20 +706,21 @@ // If the MI is an instruction defining one or more parameters' forwarding // registers, add those defines. - 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); - } - } - }; + auto getForwardingRegsDefinedByMI = + [&ForwardedRegWorklist, &TRI](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) {