[llvm] r283638 - [AVR] Don't shadow container while iterating in range-based loop
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 7 18:09:06 PDT 2016
Author: dylanmckay
Date: Fri Oct 7 20:09:06 2016
New Revision: 283638
URL: http://llvm.org/viewvc/llvm-project?rev=283638&view=rev
Log:
[AVR] Don't shadow container while iterating in range-based loop
This works on clang, but fails on GCC 4.6
Modified:
llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp
Modified: llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp?rev=283638&r1=283637&r2=283638&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp Fri Oct 7 20:09:06 2016
@@ -26,6 +26,8 @@
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Function.h"
+#include <vector>
+
namespace llvm {
AVRFrameLowering::AVRFrameLowering()
@@ -272,8 +274,8 @@ bool AVRFrameLowering::restoreCalleeSave
const AVRSubtarget &STI = MF.getSubtarget<AVRSubtarget>();
const TargetInstrInfo &TII = *STI.getInstrInfo();
- for (const CalleeSavedInfo &CSI : CSI) {
- unsigned Reg = CSI.getReg();
+ for (const CalleeSavedInfo &CCSI : CSI) {
+ unsigned Reg = CCSI.getReg();
assert(TRI->getMinimalPhysRegClass(Reg)->getSize() == 1 &&
"Invalid register size");
More information about the llvm-commits
mailing list