diff options
author | Dan Gohman <gohman@apple.com> | 2009-05-05 21:10:19 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-05-05 21:10:19 +0000 |
commit | 5412d06e9c352c9795f4a71b91c4f869585866eb (patch) | |
tree | b9dd046cc5947a1881033e8a0c35e6bbd85d944b /lib/CodeGen/MachineBasicBlock.cpp | |
parent | 8c87ae229c43939f5868b5778c53e787df0927ef (diff) |
If a MachineBasicBlock has multiple ways of reaching another block,
allow it to have multiple CFG edges to that block. This is needed
to allow MachineBasicBlock::isOnlyReachableByFallthrough to work
correctly. This fixes PR4126.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 5ac54ea8a4..71e6b3e4d0 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -305,11 +305,9 @@ void MachineBasicBlock::ReplaceUsesOfBlockWith(MachineBasicBlock *Old, I->getOperand(i).setMBB(New); } - // Update the successor information. If New was already a successor, just - // remove the link to Old instead of creating another one. PR 1444. + // Update the successor information. removeSuccessor(Old); - if (!isSuccessor(New)) - addSuccessor(New); + addSuccessor(New); } /// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in the |