Skip to content

Commit

Permalink
[IR] Use llvm::is_contained in BasicBlock::removePredecessor (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Nov 16, 2020
1 parent 0888eaf commit aa06951
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/IR/BasicBlock.cpp
Expand Up @@ -326,8 +326,7 @@ iterator_range<BasicBlock::phi_iterator> BasicBlock::phis() {
void BasicBlock::removePredecessor(BasicBlock *Pred,
bool KeepOneInputPHIs) {
// Use hasNUsesOrMore to bound the cost of this assertion for complex CFGs.
assert((hasNUsesOrMore(16) ||
find(pred_begin(this), pred_end(this), Pred) != pred_end(this)) &&
assert((hasNUsesOrMore(16) || llvm::is_contained(predecessors(this), Pred)) &&
"Pred is not a predecessor!");

// Return early if there are no PHI nodes to update.
Expand Down

0 comments on commit aa06951

Please sign in to comment.