mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Change behavior of changeExitBlock function to replace all instances of exit block
llvm-svn: 5661
This commit is contained in:
parent
c0fc5571dc
commit
c37308604f
@ -89,8 +89,8 @@ public:
|
||||
///
|
||||
void addBasicBlockToLoop(BasicBlock *NewBB, LoopInfo &LI);
|
||||
|
||||
/// changeExitBlock - This method is used to update loop information. One
|
||||
/// instance of the specified Old basic block is removed from the exit list
|
||||
/// changeExitBlock - This method is used to update loop information. All
|
||||
/// instances of the specified Old basic block are removed from the exit list
|
||||
/// and replaced with New.
|
||||
///
|
||||
void changeExitBlock(BasicBlock *Old, BasicBlock *New);
|
||||
|
@ -235,8 +235,8 @@ void Loop::addBasicBlockToLoop(BasicBlock *NewBB, LoopInfo &LI) {
|
||||
}
|
||||
}
|
||||
|
||||
/// changeExitBlock - This method is used to update loop information. One
|
||||
/// instance of the specified Old basic block is removed from the exit list
|
||||
/// changeExitBlock - This method is used to update loop information. All
|
||||
/// instances of the specified Old basic block are removed from the exit list
|
||||
/// and replaced with New.
|
||||
///
|
||||
void Loop::changeExitBlock(BasicBlock *Old, BasicBlock *New) {
|
||||
@ -246,4 +246,10 @@ void Loop::changeExitBlock(BasicBlock *Old, BasicBlock *New) {
|
||||
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);
|
||||
while (I != ExitBlocks.end()) {
|
||||
*I = New;
|
||||
I = std::find(I+1, ExitBlocks.end(), Old);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user