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 | 3e7816b58d80d045b1d1e0fcd8505b7269c1f7bc (patch) | |
tree | 550286e12d0329b7e1ab4b88483a741672bd9515 /lib/Transforms/Utils/Local.cpp | |
parent | f416493006249d2f31afa4e9877e08707edcc2c6 (diff) | |
download | external_llvm-3e7816b58d80d045b1d1e0fcd8505b7269c1f7bc.tar.gz external_llvm-3e7816b58d80d045b1d1e0fcd8505b7269c1f7bc.tar.bz2 external_llvm-3e7816b58d80d045b1d1e0fcd8505b7269c1f7bc.zip |
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; } |