[RISCV] Use llvm::none_of to replace a loop. NFC
authorCraig Topper <craig.topper@sifive.com>
Tue, 6 Sep 2022 23:03:45 +0000 (16:03 -0700)
committerCraig Topper <craig.topper@sifive.com>
Tue, 6 Sep 2022 23:24:23 +0000 (16:24 -0700)
clang/lib/Sema/SemaChecking.cpp

index 5b2d28c..fcdc866 100644 (file)
@@ -4338,15 +4338,9 @@ bool Sema::CheckRISCVBuiltinFunctionCall(const TargetInfo &TI,
   for (StringRef F : ReqFeatures) {
     SmallVector<StringRef> ReqOpFeatures;
     F.split(ReqOpFeatures, '|');
-    bool HasFeature = false;
-    for (StringRef OF : ReqOpFeatures) {
-      if (TI.hasFeature(OF)) {
-        HasFeature = true;
-        continue;
-      }
-    }
 
-    if (!HasFeature) {
+    if (llvm::none_of(ReqOpFeatures,
+                      [&TI](StringRef OF) { return TI.hasFeature(OF); })) {
       std::string FeatureStrs;
       for (StringRef OF : ReqOpFeatures) {
         // If the feature is 64bit, alter the string so it will print better in