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.

llvm-svn: 68129
This commit is contained in:
Dan Gohman
2009-03-31 18:39:13 +00:00
parent aa59489b18
commit 6b42dfddf4
3 changed files with 19 additions and 1 deletions

View File

@@ -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());
}