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
This commit is contained in:
Dan Gohman
2009-05-05 21:10:19 +00:00
parent 8c87ae229c
commit 5412d06e9c
3 changed files with 28 additions and 9 deletions
+2 -4
View File
@@ -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