Skip to content

Commit fdc76f8

Browse files
committed
use capture instead of param
1 parent 8810fc8 commit fdc76f8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/CodeGen/BranchFolding.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,21 +2090,20 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
20902090
// instructions (but at least this isn't producing wrong locations).
20912091
MachineInstrBuilder MIRBuilder(*MBB->getParent(), Loc);
20922092
auto HoistAndKillDbgInstr =
2093-
[MBB](MachineBasicBlock::iterator DI,
2094-
MachineBasicBlock::iterator InsertBefore) {
2093+
[MBB, Loc](MachineBasicBlock::iterator DI) {
20952094
assert(DI->isDebugInstr() && "Expected a debug instruction");
20962095
if (DI->isDebugRef()) {
20972096
const TargetInstrInfo *TII =
20982097
MBB->getParent()->getSubtarget().getInstrInfo();
20992098
const MCInstrDesc &DBGV = TII->get(TargetOpcode::DBG_VALUE);
21002099
DI = BuildMI(*MBB->getParent(), DI->getDebugLoc(), DBGV, false, 0,
21012100
DI->getDebugVariable(), DI->getDebugExpression());
2102-
MBB->insert(InsertBefore, &*DI);
2101+
MBB->insert(Loc, &*DI);
21032102
return;
21042103
}
21052104

21062105
DI->setDebugValueUndef();
2107-
DI->moveBefore(&*InsertBefore);
2106+
DI->moveBefore(&*Loc);
21082107
};
21092108

21102109
// TIB and FIB point to the end of the regions to hoist/merge in TBB and
@@ -2121,7 +2120,7 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
21212120
while (FI->isDebugOrPseudoInstr()) {
21222121
assert(FI != FE && "Unexpected end of FBB range");
21232122
MachineBasicBlock::iterator FINext = std::next(FI);
2124-
HoistAndKillDbgInstr(FI, Loc);
2123+
HoistAndKillDbgInstr(FI);
21252124
FI = FINext;
21262125
}
21272126

@@ -2132,7 +2131,7 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
21322131
}
21332132
// Kill debug instructions before moving.
21342133
if (TI->isDebugInstr()) {
2135-
HoistAndKillDbgInstr(TI, Loc);
2134+
HoistAndKillDbgInstr(TI);
21362135
continue;
21372136
}
21382137

0 commit comments

Comments
 (0)