parent
1dc4c29b6d
commit
1cbe5116ff
|
@ -155,17 +155,19 @@ Loop *LoopInfo::ConsiderForLoop(BasicBlock *BB, const DominatorSet &DS) {
|
||||||
// now by moving the loop into the correct subloop.
|
// now by moving the loop into the correct subloop.
|
||||||
//
|
//
|
||||||
Loop *SubLoop = BBMI->second;
|
Loop *SubLoop = BBMI->second;
|
||||||
Loop *OldSubLoopParent = SubLoop->getParentLoop();
|
if (SubLoop->getHeader() == *I) { // Only do this once for the loop...
|
||||||
if (OldSubLoopParent != L) {
|
Loop *OldSubLoopParent = SubLoop->getParentLoop();
|
||||||
// Remove SubLoop from OldSubLoopParent's list of subloops...
|
if (OldSubLoopParent != L) {
|
||||||
std::vector<Loop*>::iterator I =
|
// Remove SubLoop from OldSubLoopParent's list of subloops...
|
||||||
std::find(OldSubLoopParent->SubLoops.begin(),
|
std::vector<Loop*>::iterator I =
|
||||||
OldSubLoopParent->SubLoops.end(), SubLoop);
|
std::find(OldSubLoopParent->SubLoops.begin(),
|
||||||
assert(I != OldSubLoopParent->SubLoops.end()
|
OldSubLoopParent->SubLoops.end(), SubLoop);
|
||||||
&& "Loop parent doesn't contain loop?");
|
assert(I != OldSubLoopParent->SubLoops.end()
|
||||||
OldSubLoopParent->SubLoops.erase(I);
|
&& "Loop parent doesn't contain loop?");
|
||||||
SubLoop->ParentLoop = L;
|
OldSubLoopParent->SubLoops.erase(I);
|
||||||
L->SubLoops.push_back(SubLoop);
|
SubLoop->ParentLoop = L;
|
||||||
|
L->SubLoops.push_back(SubLoop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue