diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-05-17 23:58:53 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-05-17 23:58:53 +0000 |
commit | a92b2b38fffc0e0c35e761d450a52c50a7ea3a9d (patch) | |
tree | 7d31a2ccd07dc78c1b3e8527de4b1a5946d1ce2b /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 07aa66887c772745f80d9216c515fc0562507ff2 (diff) | |
download | bcm5719-llvm-a92b2b38fffc0e0c35e761d450a52c50a7ea3a9d.tar.gz bcm5719-llvm-a92b2b38fffc0e0c35e761d450a52c50a7ea3a9d.zip |
Move isSuccessor() offline, change it to use std::find.
llvm-svn: 37190
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 39780350ded..44f7f90a65b 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -192,3 +192,9 @@ void MachineBasicBlock::removePredecessor(MachineBasicBlock *pred) { assert(I != Predecessors.end() && "Pred is not a predecessor of this block!"); Predecessors.erase(I); } + +bool MachineBasicBlock::isSuccessor(MachineBasicBlock *MBB) const { + std::vector<MachineBasicBlock *>::const_iterator I = + std::find(Successors.begin(), Successors.end(), MBB); + return I != Successors.end(); +} |