Revert "[NFC][DwarfDebug] Avoid default capturing when using lambdas"
authorDjordje Todorovic <djordje.todorovic@syrmia.com>
Tue, 12 May 2020 07:04:57 +0000 (09:04 +0200)
committerDjordje Todorovic <djordje.todorovic@syrmia.com>
Tue, 12 May 2020 07:37:28 +0000 (09:37 +0200)
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

index bd03394..f53fd30 100644 (file)
@@ -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<unsigned, 4> &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<unsigned, 4> &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<unsigned, 4> FwdRegDefs;
 
-    getForwardingRegsDefinedByMI(*I, FwdRegDefs, ForwardedRegWorklist);
+    getForwardingRegsDefinedByMI(*I, FwdRegDefs);
     if (FwdRegDefs.empty())
       continue;