aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-05-17 23:58:53 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-05-17 23:58:53 +0000
commit4f098788d303bed05da6000f3ff24177aad56623 (patch)
tree6fe50ff4c65a82c55c5905d53a83c86b07938df5 /lib/CodeGen/MachineBasicBlock.cpp
parent413f2f961af246ff6422726fb8071555c6cacb44 (diff)
downloadexternal_llvm-4f098788d303bed05da6000f3ff24177aad56623.zip
external_llvm-4f098788d303bed05da6000f3ff24177aad56623.tar.gz
external_llvm-4f098788d303bed05da6000f3ff24177aad56623.tar.bz2
Move isSuccessor() offline, change it to use std::find.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index 3978035..44f7f90 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/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();
+}