mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
[SimplifyCFGPass] mergeEmptyReturnBlocks(): skip blocks scheduled for removal as per DomTreeUpdater
Thus supporting lazy DomTreeUpdater mode, where the domtree updates (and thus block removals) aren't applied immediately, but are delayed until last possible moment.
This commit is contained in:
parent
ef53c50f1a
commit
0938d81acb
@ -86,8 +86,9 @@ static bool mergeEmptyReturnBlocks(Function &F, DomTreeUpdater *DTU) {
|
||||
BasicBlock *RetBlock = nullptr;
|
||||
|
||||
// Scan all the blocks in the function, looking for empty return blocks.
|
||||
for (Function::iterator BBI = F.begin(), E = F.end(); BBI != E; ) {
|
||||
BasicBlock &BB = *BBI++;
|
||||
for (BasicBlock &BB : make_early_inc_range(F)) {
|
||||
if (DTU && DTU->isBBPendingDeletion(&BB))
|
||||
continue;
|
||||
|
||||
// Only look at return blocks.
|
||||
ReturnInst *Ret = dyn_cast<ReturnInst>(BB.getTerminator());
|
||||
|
Loading…
Reference in New Issue
Block a user