Use do+while instead of while for loops which obviously have a

non-zero trip count. Use SmallVector's pop_back_val().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92734 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-01-05 16:27:25 +00:00
parent b7a9f2b504
commit 321a813c53
12 changed files with 23 additions and 29 deletions
+2 -2
View File
@@ -91,7 +91,7 @@ Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI,
Loop *NewParentLoop = NULL;
while (!LoopNest.empty()) {
do {
Loop *L = LoopNest.pop_back_val();
Loop *NewLoop = new Loop();
@@ -123,7 +123,7 @@ Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI,
// Process sub loops
for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
LoopNest.push_back(*I);
}
} while (!LoopNest.empty());
// Remap instructions to reference operands from ValueMap.
for(SmallVector<BasicBlock *, 16>::iterator NBItr = NewBlocks.begin(),