forked from OSchip/llvm-project
[CodeGen] Use pred_empty (NFC)
This commit is contained in:
parent
df73b8c174
commit
85d6af393c
|
@ -559,7 +559,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
|
|||
|
||||
for (SmallVectorImpl<BasicBlock*>::iterator
|
||||
II = Successors.begin(), IE = Successors.end(); II != IE; ++II)
|
||||
if (pred_begin(*II) == pred_end(*II))
|
||||
if (pred_empty(*II))
|
||||
WorkList.insert(*II);
|
||||
}
|
||||
|
||||
|
@ -573,7 +573,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
|
|||
|
||||
for (SmallVectorImpl<BasicBlock*>::iterator
|
||||
II = Successors.begin(), IE = Successors.end(); II != IE; ++II)
|
||||
if (pred_begin(*II) == pred_end(*II))
|
||||
if (pred_empty(*II))
|
||||
WorkList.insert(*II);
|
||||
}
|
||||
|
||||
|
@ -2300,7 +2300,7 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB, bool &ModifiedDT
|
|||
}
|
||||
|
||||
// If we eliminated all predecessors of the block, delete the block now.
|
||||
if (Changed && !BB->hasAddressTaken() && pred_begin(BB) == pred_end(BB))
|
||||
if (Changed && !BB->hasAddressTaken() && pred_empty(BB))
|
||||
BB->eraseFromParent();
|
||||
|
||||
return Changed;
|
||||
|
|
|
@ -169,7 +169,7 @@ static void eraseDeadBBsAndChildren(const Container &BBs, DomTreeUpdater *DTU) {
|
|||
SmallVector<BasicBlock *, 8> WL(BBs.begin(), BBs.end());
|
||||
while (!WL.empty()) {
|
||||
auto *BB = WL.pop_back_val();
|
||||
if (pred_begin(BB) != pred_end(BB))
|
||||
if (!pred_empty(BB))
|
||||
continue;
|
||||
WL.append(succ_begin(BB), succ_end(BB));
|
||||
DeleteDeadBlock(BB, DTU);
|
||||
|
|
Loading…
Reference in New Issue