Skip to content

Commit

Permalink
[AVR] Avoid reusing the same variable name (NFC)
Browse files Browse the repository at this point in the history
Apparently GCC 5.4 (a supported compiler) has a bug where it will
use the "MachineInstr &MI" defined by the range-based for loop
to evaluate the for loop expression. Pick a different variable
name to avoid this.

(cherry picked from commit f8f55f7)
  • Loading branch information
nikic committed Feb 3, 2022
1 parent c8bb177 commit a55727f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Target/AVR/AVRFrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ bool AVRFrameLowering::restoreCalleeSavedRegisters(
/// Replace pseudo store instructions that pass arguments through the stack with
/// real instructions.
static void fixStackStores(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI,
MachineBasicBlock::iterator StartMI,
const TargetInstrInfo &TII, Register FP) {
// Iterate through the BB until we hit a call instruction or we reach the end.
for (MachineInstr &MI :
llvm::make_early_inc_range(llvm::make_range(MI, MBB.end()))) {
llvm::make_early_inc_range(llvm::make_range(StartMI, MBB.end()))) {
if (MI.isCall())
break;

Expand Down

0 comments on commit a55727f

Please sign in to comment.