mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 04:39:44 +00:00
Simplify a bit by using a new member function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5662 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f2e2925f95
commit
a94837a28f
@ -242,12 +242,9 @@ void Loop::addBasicBlockToLoop(BasicBlock *NewBB, LoopInfo &LI) {
|
||||
void Loop::changeExitBlock(BasicBlock *Old, BasicBlock *New) {
|
||||
assert(Old != New && "Cannot changeExitBlock to the same thing!");
|
||||
assert(Old && New && "Cannot changeExitBlock to or from a null node!");
|
||||
std::vector<BasicBlock*>::iterator I =
|
||||
std::find(ExitBlocks.begin(), ExitBlocks.end(), Old);
|
||||
assert(I != ExitBlocks.end() && "Old exit block not found!");
|
||||
*I = New;
|
||||
|
||||
I = std::find(I+1, ExitBlocks.end(), Old);
|
||||
assert(hasExitBlock(Old) && "Old exit block not found!");
|
||||
std::vector<BasicBlock*>::iterator
|
||||
I = std::find(ExitBlocks.begin(), ExitBlocks.end(), Old);
|
||||
while (I != ExitBlocks.end()) {
|
||||
*I = New;
|
||||
I = std::find(I+1, ExitBlocks.end(), Old);
|
||||
|
Loading…
Reference in New Issue
Block a user