diff options
author | Dan Gohman <gohman@apple.com> | 2010-01-05 16:27:25 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-01-05 16:27:25 +0000 |
commit | 321a813c536e2f1f2f05bbe78a7fbf64046f0557 (patch) | |
tree | 550286e12d0329b7e1ab4b88483a741672bd9515 /lib/Transforms/Utils/Local.cpp | |
parent | b7a9f2b5042589db89e521a4f86fd2fd70845e0f (diff) |
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
Diffstat (limited to 'lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | lib/Transforms/Utils/Local.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 27d9a06bfc..30fe802513 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -278,7 +278,7 @@ bool llvm::RecursivelyDeleteTriviallyDeadInstructions(Value *V) { SmallVector<Instruction*, 16> DeadInsts; DeadInsts.push_back(I); - while (!DeadInsts.empty()) { + do { I = DeadInsts.pop_back_val(); // Null out all of the instruction's operands to see if any operand becomes @@ -298,7 +298,7 @@ bool llvm::RecursivelyDeleteTriviallyDeadInstructions(Value *V) { } I->eraseFromParent(); - } + } while (!DeadInsts.empty()); return true; } |