@@ -2083,21 +2083,20 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
2083
2083
// instructions (but at least this isn't producing wrong locations).
2084
2084
MachineInstrBuilder MIRBuilder (*MBB->getParent (), Loc);
2085
2085
auto HoistAndKillDbgInstr =
2086
- [MBB](MachineBasicBlock::iterator DI,
2087
- MachineBasicBlock::iterator InsertBefore) {
2086
+ [MBB, Loc](MachineBasicBlock::iterator DI) {
2088
2087
assert (DI->isDebugInstr () && " Expected a debug instruction" );
2089
2088
if (DI->isDebugRef ()) {
2090
2089
const TargetInstrInfo *TII =
2091
2090
MBB->getParent ()->getSubtarget ().getInstrInfo ();
2092
2091
const MCInstrDesc &DBGV = TII->get (TargetOpcode::DBG_VALUE);
2093
2092
DI = BuildMI (*MBB->getParent (), DI->getDebugLoc (), DBGV, false , 0 ,
2094
2093
DI->getDebugVariable (), DI->getDebugExpression ());
2095
- MBB->insert (InsertBefore , &*DI);
2094
+ MBB->insert (Loc , &*DI);
2096
2095
return ;
2097
2096
}
2098
2097
2099
2098
DI->setDebugValueUndef ();
2100
- DI->moveBefore (&*InsertBefore );
2099
+ DI->moveBefore (&*Loc );
2101
2100
};
2102
2101
2103
2102
// 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) {
2114
2113
while (FI->isDebugOrPseudoInstr ()) {
2115
2114
assert (FI != FE && " Unexpected end of FBB range" );
2116
2115
MachineBasicBlock::iterator FINext = std::next (FI);
2117
- HoistAndKillDbgInstr (FI, Loc );
2116
+ HoistAndKillDbgInstr (FI);
2118
2117
FI = FINext;
2119
2118
}
2120
2119
@@ -2125,7 +2124,7 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
2125
2124
}
2126
2125
// Kill debug instructions before moving.
2127
2126
if (TI->isDebugInstr ()) {
2128
- HoistAndKillDbgInstr (TI, Loc );
2127
+ HoistAndKillDbgInstr (TI);
2129
2128
continue ;
2130
2129
}
2131
2130
0 commit comments