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 | bb2f10759ee101a3fed1a5752f7ff4751faba573 (patch) | |
tree | 1738aa7eb401477169b2ed8e62a193fcc8af71c5 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 1eb40dad172a848bc17d7876186cd9054500de17 (diff) | |
download | llvm-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.cpp | 6 |
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 |