diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-11-23 08:23:54 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-11-23 08:23:54 +0000 |
commit | 521fc5bcd73489f604a0b3251247c5ef21b5a0a5 (patch) | |
tree | ce33b8f13e1b6e5e1e4749a77d02bd62f2c172a8 /lib/CodeGen | |
parent | 23d66a58b7900784a5808d24ce2d4a449f869aa8 (diff) | |
download | external_llvm-521fc5bcd73489f604a0b3251247c5ef21b5a0a5.zip external_llvm-521fc5bcd73489f604a0b3251247c5ef21b5a0a5.tar.gz external_llvm-521fc5bcd73489f604a0b3251247c5ef21b5a0a5.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index f05b6c1..b9d1ef7 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/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); } |