@@ -43,32 +43,22 @@ class TargetEnv {
43
43
bool allows (Profile prof) const { return enabledProfiles.count (prof) != 0 ; }
44
44
45
45
bool allowsAnyOf (ArrayRef<Profile> profs) const {
46
- const auto *chosen = llvm::find_if (
47
- profs, [this ](tosa::Profile prof) { return allows (prof); });
48
- return chosen != profs.end () ? true : false ;
46
+ return llvm::any_of (profs, [&](Profile prof) { return allows (prof); });
49
47
}
50
48
51
49
bool allowsAllOf (ArrayRef<Profile> profs) const {
52
- bool is_allowed = true ;
53
- llvm::for_each (profs,
54
- [&](tosa::Profile prof) { is_allowed &= allows (prof); });
55
- return is_allowed;
50
+ return llvm::all_of (profs, [&](Profile prof) { return allows (prof); });
56
51
}
57
52
58
53
// Returns true if the given extension is allowed.
59
54
bool allows (Extension ext) const { return enabledExtensions.count (ext) != 0 ; }
60
55
61
56
bool allowsAnyOf (ArrayRef<Extension> exts) const {
62
- const auto *chosen = llvm::find_if (
63
- exts, [this ](tosa::Extension ext) { return allows (ext); });
64
- return chosen != exts.end () ? true : false ;
57
+ return llvm::any_of (exts, [&](Extension ext) { return allows (ext); });
65
58
}
66
59
67
60
bool allowsAllOf (ArrayRef<Extension> exts) const {
68
- bool is_allowed = true ;
69
- llvm::for_each (exts,
70
- [&](tosa::Extension ext) { is_allowed &= allows (ext); });
71
- return is_allowed;
61
+ return llvm::all_of (exts, [&](Extension ext) { return allows (ext); });
72
62
}
73
63
74
64
private:
0 commit comments