Skip to content

Commit 8c33044

Browse files
[llvm-diff] Use llvm::predecessors (NFC)
1 parent 47c76e7 commit 8c33044

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/tools/llvm-diff/lib/DifferenceEngine.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,9 @@ class FunctionDifferenceEngine {
214214
};
215215

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

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

0 commit comments

Comments
 (0)