From a92b2b38fffc0e0c35e761d450a52c50a7ea3a9d 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. llvm-svn: 37190 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 39780350dedf..44f7f90a65b1 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::const_iterator I = + std::find(Successors.begin(), Successors.end(), MBB); + return I != Successors.end(); +} -- cgit v1.2.3