From 6c52736e024588ab3020d4890ead495252b85290 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Sun, 4 Sep 2022 14:52:04 -0700 Subject: [PATCH] Revert "[llvm] Use range-based for loops (NFC)" range-based loop should not be used here, as fixupImmediateBr push_backs into the container. http://lab.llvm.org/buildbot/#/builders/168 http://lab.llvm.org/buildbot/#/builders/74 http://lab.llvm.org/buildbot/#/builders/5 http://lab.llvm.org/buildbot/#/builders/239 http://lab.llvm.org/buildbot/#/builders/237 http://lab.llvm.org/buildbot/#/builders/236 This reverts commit fedc59734a44ef7b62c5f389b0cdffd02264b2a9. --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | 4 ++-- llvm/lib/Target/Mips/MipsConstantIslandPass.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp index 24a5f02..386a748 100644 --- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -480,8 +480,8 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &mf) { LLVM_DEBUG(dbgs() << "Beginning BR iteration #" << NoBRIters << '\n'); bool BRChange = false; - for (ImmBranch &IB : ImmBranches) - BRChange |= fixupImmediateBr(IB); + for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i) + BRChange |= fixupImmediateBr(ImmBranches[i]); if (BRChange && ++NoBRIters > 30) report_fatal_error("Branch Fix Up pass failed to converge!"); LLVM_DEBUG(dumpBBs()); diff --git a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp index 25a0b05..0341af0 100644 --- a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp +++ b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp @@ -500,8 +500,8 @@ bool MipsConstantIslands::runOnMachineFunction(MachineFunction &mf) { LLVM_DEBUG(dbgs() << "Beginning BR iteration #" << NoBRIters << '\n'); bool BRChange = false; - for (ImmBranch &IB : ImmBranches) - BRChange |= fixupImmediateBr(IB); + for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i) + BRChange |= fixupImmediateBr(ImmBranches[i]); if (BRChange && ++NoBRIters > 30) report_fatal_error("Branch Fix Up pass failed to converge!"); LLVM_DEBUG(dumpBBs()); -- 2.7.4