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 | 28943873e66fcd1640062dd9b481c2b44ed4e397 (patch) | |
tree | 1e3a9cea2c2dab6b0f40ac1e4acb9586434057e2 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 92fdb96474961ffbee73dce4ba7af7a25ae9c263 (diff) | |
download | bcm5719-llvm-28943873e66fcd1640062dd9b481c2b44ed4e397.tar.gz bcm5719-llvm-28943873e66fcd1640062dd9b481c2b44ed4e397.zip |
Use do+while instead of while for loops which obviously have a
non-zero trip count. Use SmallVector's pop_back_val().
llvm-svn: 92734
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 27d9a06bfc6..30fe8025135 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/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; } |