From 4f098788d303bed05da6000f3ff24177aad56623 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 17 May 2007 23:58:53 +0000 Subject: 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 --- lib/CodeGen/MachineBasicBlock.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/CodeGen/MachineBasicBlock.cpp') diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 39780350de..44f7f90a65 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::const_iterator I = + std::find(Successors.begin(), Successors.end(), MBB); + return I != Successors.end(); +} -- cgit v1.2.3-18-g5258