aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 980852e8cd..b5103750f7 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -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;