Skip to content

Commit c7d4b45

Browse files
committed
use capture instead of param
1 parent 5984744 commit c7d4b45

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
@@ -2083,21 +2083,20 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
20832083
// instructions (but at least this isn't producing wrong locations).
20842084
MachineInstrBuilder MIRBuilder(*MBB->getParent(), Loc);
20852085
auto HoistAndKillDbgInstr =
2086-
[MBB](MachineBasicBlock::iterator DI,
2087-
MachineBasicBlock::iterator InsertBefore) {
2086+
[MBB, Loc](MachineBasicBlock::iterator DI) {
20882087
assert(DI->isDebugInstr() && "Expected a debug instruction");
20892088
if (DI->isDebugRef()) {
20902089
const TargetInstrInfo *TII =
20912090
MBB->getParent()->getSubtarget().getInstrInfo();
20922091
const MCInstrDesc &DBGV = TII->get(TargetOpcode::DBG_VALUE);
20932092
DI = BuildMI(*MBB->getParent(), DI->getDebugLoc(), DBGV, false, 0,
20942093
DI->getDebugVariable(), DI->getDebugExpression());
2095-
MBB->insert(InsertBefore, &*DI);
2094+
MBB->insert(Loc, &*DI);
20962095
return;
20972096
}
20982097

20992098
DI->setDebugValueUndef();
2100-
DI->moveBefore(&*InsertBefore);
2099+
DI->moveBefore(&*Loc);
21012100
};
21022101

21032102
// TIB and FIB point to the end of the regions to hoist/merge in TBB and
@@ -2114,7 +2113,7 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
21142113
while (FI->isDebugOrPseudoInstr()) {
21152114
assert(FI != FE && "Unexpected end of FBB range");
21162115
MachineBasicBlock::iterator FINext = std::next(FI);
2117-
HoistAndKillDbgInstr(FI, Loc);
2116+
HoistAndKillDbgInstr(FI);
21182117
FI = FINext;
21192118
}
21202119

@@ -2125,7 +2124,7 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
21252124
}
21262125
// Kill debug instructions before moving.
21272126
if (TI->isDebugInstr()) {
2128-
HoistAndKillDbgInstr(TI, Loc);
2127+
HoistAndKillDbgInstr(TI);
21292128
continue;
21302129
}
21312130

0 commit comments

Comments
 (0)