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

View File

@@ -829,7 +829,7 @@ SpeculationFailure:
SmallVector<BasicBlock*, 32> BBWorklist;
BBWorklist.push_back(BB);
while (!BBWorklist.empty()) {
do {
BasicBlock *Entry = BBWorklist.pop_back_val();
// Note that this sets blocks to 0 (unavailable) if they happen to not
// already be in FullyAvailableBlocks. This is safe.
@@ -841,7 +841,7 @@ SpeculationFailure:
for (succ_iterator I = succ_begin(Entry), E = succ_end(Entry); I != E; ++I)
BBWorklist.push_back(*I);
}
} while (!BBWorklist.empty());
return false;
}