aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-03-31 08:41:31 +0000
committerBill Wendling <isanbard@gmail.com>2009-03-31 08:41:31 +0000
commite67f5e42734199a1f4771773417699262491eb86 (patch)
treeda861fb7d38f820e2dbce74ae5055da42eb568d4 /include
parent696a1307ba5e98fe813d21cecb9dbfd72be8562c (diff)
Oy! When reverting r68073, I added in experimental code. Sorry...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 1ba7e798f8..f962273d2b 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -253,6 +253,15 @@ public:
/// it returns end()
iterator getFirstTerminator();
+ /// isOnlyReachableViaFallthough - Return true if this basic block has
+ /// exactly one predecessor and the control transfer mechanism between
+ /// the predecessor and this block is a fall-through.
+ bool isOnlyReachableByFallthrough() const {
+ return !pred_empty() &&
+ next(pred_begin()) == pred_end() &&
+ (*pred_begin())->getFirstTerminator() == (*pred_begin())->end();
+ }
+
void pop_front() { Insts.pop_front(); }
void pop_back() { Insts.pop_back(); }
void push_back(MachineInstr *MI) { Insts.push_back(MI); }