diff options
author | Dan Gohman <gohman@apple.com> | 2008-10-02 22:09:09 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-10-02 22:09:09 +0000 |
commit | 6ade6f55a836129af634074e96f660ff23f59a30 (patch) | |
tree | 9d3b8f495e13893431a3ae50ac05070bdce2cc4e /lib/CodeGen/MachineBasicBlock.cpp | |
parent | e4a5ea3130129124a9d88e5e27d8bcf26f147fa0 (diff) |
Add a new MachineBasicBlock utility function, isLayoutSuccessor, that
can be used when deciding if a block can transfer control to another
via a fall-through instead of a branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 0320affa3a..bac0a6cc71 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -254,6 +254,11 @@ bool MachineBasicBlock::isSuccessor(MachineBasicBlock *MBB) const { return I != Successors.end(); } +bool MachineBasicBlock::isLayoutSuccessor(MachineBasicBlock *MBB) const { + MachineFunction::const_iterator I(this); + return next(I) == MachineFunction::const_iterator(MBB); +} + /// removeFromParent - This method unlinks 'this' from the containing function, /// and returns it, but does not delete it. MachineBasicBlock *MachineBasicBlock::removeFromParent() { |