[llvm] r311782 - Fix unused-lambda-capture warning by using default capture-by-ref
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 25 09:46:07 PDT 2017
Author: dblaikie
Date: Fri Aug 25 09:46:07 2017
New Revision: 311782
URL: http://llvm.org/viewvc/llvm-project?rev=311782&view=rev
Log:
Fix unused-lambda-capture warning by using default capture-by-ref
Since the lambda isn't escaped (via a std::function or similar) it's
fine/better to use default capture-by-ref to provide semantics similar
to language-level nested scopes (if/for/while/etc).
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp?rev=311782&r1=311781&r2=311782&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp Fri Aug 25 09:46:07 2017
@@ -661,8 +661,7 @@ LegalizerHelper::widenScalar(MachineInst
}
case TargetOpcode::G_PHI: {
assert(TypeIdx == 0 && "Expecting only Idx 0");
- auto getExtendedReg = [this, WideTy](unsigned Reg,
- MachineBasicBlock &MBB) {
+ auto getExtendedReg = [&](unsigned Reg, MachineBasicBlock &MBB) {
auto FirstTermIt = MBB.getFirstTerminator();
MIRBuilder.setInsertPt(MBB, FirstTermIt);
MachineInstr *DefMI = MRI.getVRegDef(Reg);
More information about the llvm-commits
mailing list