From bb2f10759ee101a3fed1a5752f7ff4751faba573 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 5 May 2009 21:10:19 +0000 Subject: 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. llvm-svn: 71018 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 5ac54ea8..71e6b3e 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/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 -- cgit v1.1