diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-07 13:50:07 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-07 13:50:07 +0000 |
commit | 66b581ef4965ca3a6c72450ee9916a5c2ab44461 (patch) | |
tree | 877e5bc63e930dccefaf372fce64757ce793ab45 /lib/Transforms | |
parent | 452394d812816b05f626d414ce6dbd3b87d45a73 (diff) | |
download | external_llvm-66b581ef4965ca3a6c72450ee9916a5c2ab44461.zip external_llvm-66b581ef4965ca3a6c72450ee9916a5c2ab44461.tar.gz external_llvm-66b581ef4965ca3a6c72450ee9916a5c2ab44461.tar.bz2 |
Use a do-while loop instead of while + boolean.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/JumpThreading.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index fadbec5..ab7d971 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -124,10 +124,9 @@ bool JumpThreading::runOnFunction(Function &F) { FindLoopHeaders(F); - bool AnotherIteration = true, EverChanged = false; - while (AnotherIteration) { - AnotherIteration = false; - bool Changed = false; + bool Changed, EverChanged = false; + do { + Changed = false; for (Function::iterator I = F.begin(), E = F.end(); I != E;) { BasicBlock *BB = I; // Thread all of the branches we can over this block. @@ -176,9 +175,8 @@ bool JumpThreading::runOnFunction(Function &F) { } } } - AnotherIteration = Changed; EverChanged |= Changed; - } + } while (Changed); LoopHeaders.clear(); return EverChanged; |