Use MachineFunction::iterator instead of a MachineBasicBlock* because
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Sat, 31 Jul 2004 15:03:52 +0000 (15:03 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Sat, 31 Jul 2004 15:03:52 +0000 (15:03 +0000)
FallThrough maybe == to MF.end().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15372 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BranchFolding.cpp

index 980852e8cdb477501813eeed0d778eb9d2637c0e..b5103750f7777e5aa2d77ca6323d9fbd3d853c4c 100644 (file)
@@ -172,8 +172,9 @@ bool BranchFolder::OptimizeBlock(MachineBasicBlock *MBB,
     MachineInstr *UncondBr = MI;
     MachineFunction::iterator FallThrough = MBB; ++FallThrough;
 
-    MachineBasicBlock *UncondDest = MI->getOperand(0).getMachineBasicBlock();
-    if (UncondDest == &*FallThrough) {
+    MachineFunction::iterator UncondDest =
+      MI->getOperand(0).getMachineBasicBlock();
+    if (UncondDest == FallThrough) {
       // Just delete the branch.  This does not effect the CFG.
       MBB->erase(UncondBr);
       return true;