[llvm] 8c33044 - [llvm-diff] Use llvm::predecessors (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 22 21:19:28 PST 2024
Author: Kazu Hirata
Date: 2024-01-22T21:19:16-08:00
New Revision: 8c3304453c22ad1b5a914e64a7f6435f58f4099c
URL: https://github.com/llvm/llvm-project/commit/8c3304453c22ad1b5a914e64a7f6435f58f4099c
DIFF: https://github.com/llvm/llvm-project/commit/8c3304453c22ad1b5a914e64a7f6435f58f4099c.diff
LOG: [llvm-diff] Use llvm::predecessors (NFC)
Added:
Modified:
llvm/tools/llvm-diff/lib/DifferenceEngine.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-
diff /lib/DifferenceEngine.cpp b/llvm/tools/llvm-
diff /lib/DifferenceEngine.cpp
index 0d4d82e5cadd36..64b5051af14892 100644
--- a/llvm/tools/llvm-
diff /lib/DifferenceEngine.cpp
+++ b/llvm/tools/llvm-
diff /lib/DifferenceEngine.cpp
@@ -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;
More information about the llvm-commits
mailing list