mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-30 05:29:47 +00:00
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
This commit is contained in:
parent
452394d812
commit
66b581ef49
@ -124,10 +124,9 @@ bool JumpThreading::runOnFunction(Function &F) {
|
|||||||
|
|
||||||
FindLoopHeaders(F);
|
FindLoopHeaders(F);
|
||||||
|
|
||||||
bool AnotherIteration = true, EverChanged = false;
|
bool Changed, EverChanged = false;
|
||||||
while (AnotherIteration) {
|
do {
|
||||||
AnotherIteration = false;
|
Changed = false;
|
||||||
bool Changed = false;
|
|
||||||
for (Function::iterator I = F.begin(), E = F.end(); I != E;) {
|
for (Function::iterator I = F.begin(), E = F.end(); I != E;) {
|
||||||
BasicBlock *BB = I;
|
BasicBlock *BB = I;
|
||||||
// Thread all of the branches we can over this block.
|
// Thread all of the branches we can over this block.
|
||||||
@ -176,9 +175,8 @@ bool JumpThreading::runOnFunction(Function &F) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AnotherIteration = Changed;
|
|
||||||
EverChanged |= Changed;
|
EverChanged |= Changed;
|
||||||
}
|
} while (Changed);
|
||||||
|
|
||||||
LoopHeaders.clear();
|
LoopHeaders.clear();
|
||||||
return EverChanged;
|
return EverChanged;
|
||||||
|
Loading…
Reference in New Issue
Block a user