aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-17 21:47:33 +0000
committerChris Lattner <sabre@nondot.org>2003-08-17 21:47:33 +0000
commit169db9d775ad44f31c6aa1985e33933ed3740704 (patch)
tree102b9eb37ee5d7ff8337fac2d0253759fc524752 /lib/Analysis/LoopInfo.cpp
parente2ce618e2c221205014fbeb01b5100482bb34355 (diff)
Fix the bug that broke the nightly tester in McCat/18-imp last night. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r--lib/Analysis/LoopInfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index a86d73b34a..c31e55511b 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -220,15 +220,15 @@ Loop *LoopInfo::ConsiderForLoop(BasicBlock *BB, const DominatorSet &DS) {
if (BlockLoop == 0) { // Child block not processed yet...
BlockLoop = Child;
} else if (BlockLoop != Child) {
+ Loop *SubLoop = BlockLoop;
+ // Reparent all of the blocks which used to belong to BlockLoops
+ for (unsigned j = 0, e = SubLoop->Blocks.size(); j != e; ++j)
+ ContainingLoops[SubLoop->Blocks[j]] = Child;
+
// There is already a loop which contains this block, that means
// that we should reparent the loop which the block is currently
// considered to belong to to be a child of this loop.
- MoveSiblingLoopInto(BlockLoop, Child);
-
- // Reparent all of the blocks which used to belong to BlockLoops
- for (unsigned j = 0, e = BlockLoop->Blocks.size(); j != e; ++j)
- ContainingLoops[BlockLoop->Blocks[j]] = Child;
-
+ MoveSiblingLoopInto(SubLoop, Child);
--i; // We just shrunk the SubLoops list.
}
}