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

@@ -562,8 +562,7 @@ bool MemCpyOpt::performCallSlotOptzn(MemCpyInst *cpy, CallInst *C) {
SmallVector<User*, 8> srcUseList(srcAlloca->use_begin(),
srcAlloca->use_end());
while (!srcUseList.empty()) {
User *UI = srcUseList.back();
srcUseList.pop_back();
User *UI = srcUseList.pop_back_val();
if (isa<BitCastInst>(UI)) {
for (User::use_iterator I = UI->use_begin(), E = UI->use_end();