mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
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
This commit is contained in:
@@ -99,9 +99,8 @@ static bool MarkAliveBlocks(BasicBlock *BB,
|
||||
SmallVector<BasicBlock*, 128> Worklist;
|
||||
Worklist.push_back(BB);
|
||||
bool Changed = false;
|
||||
while (!Worklist.empty()) {
|
||||
BB = Worklist.back();
|
||||
Worklist.pop_back();
|
||||
do {
|
||||
BB = Worklist.pop_back_val();
|
||||
|
||||
if (!Reachable.insert(BB))
|
||||
continue;
|
||||
@@ -150,7 +149,7 @@ static bool MarkAliveBlocks(BasicBlock *BB,
|
||||
Changed |= ConstantFoldTerminator(BB);
|
||||
for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
|
||||
Worklist.push_back(*SI);
|
||||
}
|
||||
} while (!Worklist.empty());
|
||||
return Changed;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user