File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -519,29 +519,23 @@ bool ModuleSanitizerCoverage::instrumentModule(
519
519
520
520
// True if block has successors and it dominates all of them.
521
521
static bool isFullDominator (const BasicBlock *BB, const DominatorTree *DT) {
522
- if (succ_begin (BB) == succ_end (BB))
522
+ if (succ_empty (BB))
523
523
return false ;
524
524
525
- for (const BasicBlock *SUCC : make_range (succ_begin (BB), succ_end (BB))) {
526
- if (!DT->dominates (BB, SUCC))
527
- return false ;
528
- }
529
-
530
- return true ;
525
+ return llvm::all_of (successors (BB), [BB, DT](const BasicBlock *SUCC) {
526
+ return DT->dominates (BB, SUCC);
527
+ });
531
528
}
532
529
533
530
// True if block has predecessors and it postdominates all of them.
534
531
static bool isFullPostDominator (const BasicBlock *BB,
535
532
const PostDominatorTree *PDT) {
536
- if (pred_begin (BB) == pred_end (BB))
533
+ if (pred_empty (BB))
537
534
return false ;
538
535
539
- for (const BasicBlock *PRED : make_range (pred_begin (BB), pred_end (BB))) {
540
- if (!PDT->dominates (BB, PRED))
541
- return false ;
542
- }
543
-
544
- return true ;
536
+ return llvm::all_of (predecessors (BB), [BB, PDT](const BasicBlock *PRED) {
537
+ return PDT->dominates (BB, PRED);
538
+ });
545
539
}
546
540
547
541
static bool shouldInstrumentBlock (const Function &F, const BasicBlock *BB,
You can’t perform that action at this time.
0 commit comments