summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-31 18:39:13 +0000
committerDan Gohman <gohman@apple.com>2009-03-31 18:39:13 +0000
commit6b42dfddf48a42c0258aa704e51f78328e43cd80 (patch)
tree628550b5a61f4ce265bbb809c6ddced1edd03ee4 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentaa59489b18f2520264e6427cda4caf440d6b00b3 (diff)
downloadbcm5719-llvm-6b42dfddf48a42c0258aa704e51f78328e43cd80.tar.gz
bcm5719-llvm-6b42dfddf48a42c0258aa704e51f78328e43cd80.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 51f0f9d0001..5ac54ea8a44 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/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());
}
OpenPOWER on IntegriCloud