summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-23 08:23:54 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-23 08:23:54 +0000
commit8c68f1f3c8990ee8424c601d1587d0f11a1735b9 (patch)
treea111586942c1f44c9abbc32263b9c139dd69fd9d /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentebb44646c40e67d67a975e16992bc67b0a868900 (diff)
downloadbcm5719-llvm-8c68f1f3c8990ee8424c601d1587d0f11a1735b9.tar.gz
bcm5719-llvm-8c68f1f3c8990ee8424c601d1587d0f11a1735b9.zip
Handle the case of a no-return invoke correctly. It actually still has
successors, they just are all landing pad successors. We handle this the same way as no successors. Comments attached for the next person to wade through here and another lovely test case courtesy of Benjamin Kramer's bugpoint reduction. llvm-svn: 145098
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index f05b6c1eb97..b9d1ef7c68c 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -305,6 +305,14 @@ void MachineBasicBlock::updateTerminator() {
assert(!TBB && "Found more than one non-landing-pad successor!");
TBB = *SI;
}
+
+ // If there is no non-landing-pad successor, the block has no
+ // fall-through edges to be concerned with.
+ if (!TBB)
+ return;
+
+ // Finally update the unconditional successor to be reached via a branch
+ // if it would not be reached by fallthrough.
if (!isLayoutSuccessor(TBB))
TII->InsertBranch(*this, TBB, 0, Cond, dl);
}
OpenPOWER on IntegriCloud