Skip to content

Commit

Permalink
[llvm-diff] Use llvm::predecessors (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Jan 23, 2024
1 parent 47c76e7 commit 8c33044
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions llvm/tools/llvm-diff/lib/DifferenceEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,9 @@ class FunctionDifferenceEngine {
};

unsigned getUnprocPredCount(const BasicBlock *Block) const {
unsigned Count = 0;
for (const_pred_iterator I = pred_begin(Block), E = pred_end(Block); I != E;
++I)
if (!Blocks.count(*I)) Count++;
return Count;
return llvm::count_if(predecessors(Block), [&](const BasicBlock *Pred) {
return !Blocks.contains(Pred);
});
}

typedef std::pair<const BasicBlock *, const BasicBlock *> BlockPair;
Expand Down

0 comments on commit 8c33044

Please sign in to comment.