]> granicus.if.org Git - llvm/commitdiff
AArch64: Fix range loop contradicting comment above it
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 16 Jun 2016 21:21:49 +0000 (21:21 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 16 Jun 2016 21:21:49 +0000 (21:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272959 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64BranchRelaxation.cpp

index a72d6e522ab37f4e11ad452a8028120bc9c4bcc7..2d80a65b98768068585bed30ab1462e38d945e91 100644 (file)
@@ -463,7 +463,8 @@ bool AArch64BranchRelaxation::relaxBranchInstructions() {
   bool Changed = false;
   // Relaxing branches involves creating new basic blocks, so re-eval
   // end() for termination.
-  for (auto &MBB : *MF) {
+  for (MachineFunction::iterator I = MF->begin(); I != MF->end(); ++I) {
+    MachineBasicBlock &MBB = *I;
     MachineInstr *MI = MBB.getFirstTerminator();
     if (isConditionalBranch(MI->getOpcode()) &&
         !isBlockInRange(MI, getDestBlock(MI),