[llvm] 918e343 - [SanitizerCoverage] Use llvm::all_of (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 15 19:01:41 PST 2020
Author: Kazu Hirata
Date: 2020-11-15T19:01:20-08:00
New Revision: 918e3439e20d068b3336febf084d7e11baa48311
URL: https://github.com/llvm/llvm-project/commit/918e3439e20d068b3336febf084d7e11baa48311
DIFF: https://github.com/llvm/llvm-project/commit/918e3439e20d068b3336febf084d7e11baa48311.diff
LOG: [SanitizerCoverage] Use llvm::all_of (NFC)
Added:
Modified:
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 7e2d5260fb6c..f4f94edd3ce2 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -519,29 +519,23 @@ bool ModuleSanitizerCoverage::instrumentModule(
// True if block has successors and it dominates all of them.
static bool isFullDominator(const BasicBlock *BB, const DominatorTree *DT) {
- if (succ_begin(BB) == succ_end(BB))
+ if (succ_empty(BB))
return false;
- for (const BasicBlock *SUCC : make_range(succ_begin(BB), succ_end(BB))) {
- if (!DT->dominates(BB, SUCC))
- return false;
- }
-
- return true;
+ return llvm::all_of(successors(BB), [BB, DT](const BasicBlock *SUCC) {
+ return DT->dominates(BB, SUCC);
+ });
}
// True if block has predecessors and it postdominates all of them.
static bool isFullPostDominator(const BasicBlock *BB,
const PostDominatorTree *PDT) {
- if (pred_begin(BB) == pred_end(BB))
+ if (pred_empty(BB))
return false;
- for (const BasicBlock *PRED : make_range(pred_begin(BB), pred_end(BB))) {
- if (!PDT->dominates(BB, PRED))
- return false;
- }
-
- return true;
+ return llvm::all_of(predecessors(BB), [BB, PDT](const BasicBlock *PRED) {
+ return PDT->dominates(BB, PRED);
+ });
}
static bool shouldInstrumentBlock(const Function &F, const BasicBlock *BB,
More information about the llvm-commits
mailing list