summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-08-08 17:31:52 +0000
committerTim Northover <tnorthover@apple.com>2014-08-08 17:31:52 +0000
commite42fac519134d21ad3e7396da5746d27d3f7caab (patch)
treee6819ceb2a52bb064b395273d6cd15f6ea03e930 /llvm/lib
parent495bc3f5f6a1924dddfeb3c090520175e637af4d (diff)
downloadbcm5719-llvm-e42fac519134d21ad3e7396da5746d27d3f7caab.tar.gz
bcm5719-llvm-e42fac519134d21ad3e7396da5746d27d3f7caab.zip
AArch64: avoid deleting the current iterator in a loop.
std::map invalidates the iterator to any element that gets deleted, which means we can't increment it correctly afterwards. This was causing Darwin test failures. llvm-svn: 215233
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp b/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
index 705679b570e..dc8cb32d199 100644
--- a/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
+++ b/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
@@ -671,13 +671,14 @@ maybeKillChain(MachineOperand &MO, unsigned Idx,
} else if (MO.isRegMask()) {
for (auto I = ActiveChains.begin(), E = ActiveChains.end();
- I != E; ++I) {
+ I != E;) {
if (MO.clobbersPhysReg(I->first)) {
DEBUG(dbgs() << "Kill (regmask) seen for chain "
<< TRI->getName(I->first) << "\n");
I->second->setKill(MI, Idx, /*Immutable=*/true);
- ActiveChains.erase(I);
- }
+ ActiveChains.erase(I++);
+ } else
+ ++I;
}
}
OpenPOWER on IntegriCloud