diff options
author | Tim Northover <tnorthover@apple.com> | 2014-03-28 13:52:56 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2014-03-28 13:52:56 +0000 |
commit | 24f46618b2eef837688247be3e72fd970e09d5cf (patch) | |
tree | 32f9e68c22929fd35cab360da2ae577df939af6a /llvm/lib/Target | |
parent | 86a4d2c32b9642f178ae00de35cfbd55a7967d5f (diff) | |
download | bcm5719-llvm-24f46618b2eef837688247be3e72fd970e09d5cf.tar.gz bcm5719-llvm-24f46618b2eef837688247be3e72fd970e09d5cf.zip |
R600: avoid calling std::next on an iterator that might be end()
This was causing my llc to go into an infinite loop on
CodeGen/R600/address-space.ll (just triggered recently by some allocator
changes).
llvm-svn: 205005
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/R600/SILowerControlFlow.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/R600/SILowerControlFlow.cpp b/llvm/lib/Target/R600/SILowerControlFlow.cpp index 182f28ba774..c2f86964731 100644 --- a/llvm/lib/Target/R600/SILowerControlFlow.cpp +++ b/llvm/lib/Target/R600/SILowerControlFlow.cpp @@ -439,10 +439,10 @@ bool SILowerControlFlowPass::runOnMachineFunction(MachineFunction &MF) { BI != BE; ++BI) { MachineBasicBlock &MBB = *BI; - for (MachineBasicBlock::iterator I = MBB.begin(), Next = std::next(I); - I != MBB.end(); I = Next) { - + MachineBasicBlock::iterator I, Next; + for (I = MBB.begin(); I != MBB.end(); I = Next) { Next = std::next(I); + MachineInstr &MI = *I; if (TII->isDS(MI.getOpcode())) { NeedM0 = true; |