aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-05 21:10:19 +0000
committerDan Gohman <gohman@apple.com>2009-05-05 21:10:19 +0000
commitbb2f10759ee101a3fed1a5752f7ff4751faba573 (patch)
tree1738aa7eb401477169b2ed8e62a193fcc8af71c5 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent1eb40dad172a848bc17d7876186cd9054500de17 (diff)
downloadllvm-bb2f10759ee101a3fed1a5752f7ff4751faba573.zip
llvm-bb2f10759ee101a3fed1a5752f7ff4751faba573.tar.gz
llvm-bb2f10759ee101a3fed1a5752f7ff4751faba573.tar.bz2
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp6
1 files changed, 2 insertions, 4 deletions
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