[llvm-diff] Use llvm::predecessors (NFC)

This commit is contained in:
Kazu Hirata 2024-01-22 21:19:16 -08:00
parent 47c76e7aba
commit 8c3304453c

View File

@ -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;