@@ -2090,21 +2090,20 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
2090
2090
// instructions (but at least this isn't producing wrong locations).
2091
2091
MachineInstrBuilder MIRBuilder (*MBB->getParent (), Loc);
2092
2092
auto HoistAndKillDbgInstr =
2093
- [MBB](MachineBasicBlock::iterator DI,
2094
- MachineBasicBlock::iterator InsertBefore) {
2093
+ [MBB, Loc](MachineBasicBlock::iterator DI) {
2095
2094
assert (DI->isDebugInstr () && " Expected a debug instruction" );
2096
2095
if (DI->isDebugRef ()) {
2097
2096
const TargetInstrInfo *TII =
2098
2097
MBB->getParent ()->getSubtarget ().getInstrInfo ();
2099
2098
const MCInstrDesc &DBGV = TII->get (TargetOpcode::DBG_VALUE);
2100
2099
DI = BuildMI (*MBB->getParent (), DI->getDebugLoc (), DBGV, false , 0 ,
2101
2100
DI->getDebugVariable (), DI->getDebugExpression ());
2102
- MBB->insert (InsertBefore , &*DI);
2101
+ MBB->insert (Loc , &*DI);
2103
2102
return ;
2104
2103
}
2105
2104
2106
2105
DI->setDebugValueUndef ();
2107
- DI->moveBefore (&*InsertBefore );
2106
+ DI->moveBefore (&*Loc );
2108
2107
};
2109
2108
2110
2109
// 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) {
2121
2120
while (FI->isDebugOrPseudoInstr ()) {
2122
2121
assert (FI != FE && " Unexpected end of FBB range" );
2123
2122
MachineBasicBlock::iterator FINext = std::next (FI);
2124
- HoistAndKillDbgInstr (FI, Loc );
2123
+ HoistAndKillDbgInstr (FI);
2125
2124
FI = FINext;
2126
2125
}
2127
2126
@@ -2132,7 +2131,7 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
2132
2131
}
2133
2132
// Kill debug instructions before moving.
2134
2133
if (TI->isDebugInstr ()) {
2135
- HoistAndKillDbgInstr (TI, Loc );
2134
+ HoistAndKillDbgInstr (TI);
2136
2135
continue ;
2137
2136
}
2138
2137
0 commit comments