diff options
author | Dan Gohman <gohman@apple.com> | 2009-03-31 18:39:13 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-03-31 18:39:13 +0000 |
commit | 968dc7a2077d5c4a0b2fca9810b0fdf9cd62991b (patch) | |
tree | e18aa62737b225df2ec84a32c3cae264f39ff841 /lib/CodeGen/MachineBasicBlock.cpp | |
parent | 46801029ea64dc9f3547b2977b455eae927fc7be (diff) |
Reapply 68073, with fixes. EH Landing-pad basic blocks are not
entered via fall-through. Don't miss fallthroughs from blocks
terminated by conditional branches. Also, move
isOnlyReachableByFallthrough out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 51f0f9d000..5ac54ea8a4 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -123,6 +123,16 @@ MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() { return I; } +bool +MachineBasicBlock::isOnlyReachableByFallthrough() const { + return !isLandingPad() && + !pred_empty() && + next(pred_begin()) == pred_end() && + (*pred_begin())->isLayoutSuccessor(this) && + ((*pred_begin())->empty() || + !(*pred_begin())->back().getDesc().isBarrier()); +} + void MachineBasicBlock::dump() const { print(*cerr.stream()); } |