[llvm] f8f55f7 - [AVR] Avoid reusing the same variable name (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 2 02:36:37 PST 2022


Author: Nikita Popov
Date: 2022-02-02T11:36:30+01:00
New Revision: f8f55f7e0343634e8cf0892883ce7132b7a0dc50

URL: https://github.com/llvm/llvm-project/commit/f8f55f7e0343634e8cf0892883ce7132b7a0dc50
DIFF: https://github.com/llvm/llvm-project/commit/f8f55f7e0343634e8cf0892883ce7132b7a0dc50.diff

LOG: [AVR] Avoid reusing the same variable name (NFC)

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.

Added: 
    

Modified: 
    llvm/lib/Target/AVR/AVRFrameLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AVR/AVRFrameLowering.cpp b/llvm/lib/Target/AVR/AVRFrameLowering.cpp
index a6817834b2ef9..c22541a37f338 100644
--- a/llvm/lib/Target/AVR/AVRFrameLowering.cpp
+++ b/llvm/lib/Target/AVR/AVRFrameLowering.cpp
@@ -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;
 


        


More information about the llvm-commits mailing list