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 | a78bae34a5a52c3a16d70e296857090f1456120d (patch) | |
tree | fdd24b0b36165a8013d2fcc55919f98c729aad46 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | f40296bb49a3ae6702f66f774fbbd1d33ccad93d (diff) | |
download | bcm5719-llvm-a78bae34a5a52c3a16d70e296857090f1456120d.tar.gz bcm5719-llvm-a78bae34a5a52c3a16d70e296857090f1456120d.zip |
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.
llvm-svn: 56968
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 0320affa3a5..bac0a6cc719 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/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() { |