]> granicus.if.org Git - clang/commitdiff
Use llvm::{all,any,none}_of instead std::{all,any,none}_of. NFC
authorFangrui Song <maskray@google.com>
Sat, 20 Oct 2018 17:53:42 +0000 (17:53 +0000)
committerFangrui Song <maskray@google.com>
Sat, 20 Oct 2018 17:53:42 +0000 (17:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344859 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/VTableBuilder.cpp
lib/ASTMatchers/ASTMatchersInternal.cpp
lib/Analysis/CloneDetection.cpp
lib/CodeGen/CGCall.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/Parse/ParseTentative.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaLookup.cpp
lib/Sema/SemaOverload.cpp
lib/Tooling/ASTDiff/ASTDiff.cpp

index 81e3c947801dd36c09af89e94f8c6e5ccd09f04a..846a6085743e1066c7977999d30028112311c12c 100644 (file)
@@ -3406,10 +3406,9 @@ static void removeRedundantPaths(std::list<FullPathTy> &FullPaths) {
     for (const FullPathTy &OtherPath : FullPaths) {
       if (&SpecificPath == &OtherPath)
         continue;
-      if (std::all_of(SpecificPath.begin(), SpecificPath.end(),
-                      [&](const BaseSubobject &BSO) {
-                        return OtherPath.count(BSO) != 0;
-                      })) {
+      if (llvm::all_of(SpecificPath, [&](const BaseSubobject &BSO) {
+            return OtherPath.count(BSO) != 0;
+          })) {
         return true;
       }
     }
@@ -3485,10 +3484,9 @@ static const FullPathTy *selectBestPath(ASTContext &Context,
       // It's possible that the overrider isn't in this path.  If so, skip it
       // because this path didn't introduce it.
       const CXXRecordDecl *OverridingParent = OverridingMethod->getParent();
-      if (std::none_of(SpecificPath.begin(), SpecificPath.end(),
-                       [&](const BaseSubobject &BSO) {
-                         return BSO.getBase() == OverridingParent;
-                       }))
+      if (llvm::none_of(SpecificPath, [&](const BaseSubobject &BSO) {
+            return BSO.getBase() == OverridingParent;
+          }))
         continue;
       CurrentOverrides.insert(OverridingMethod);
     }
index 7b551a4eee70566180808f57b7b8ad5918bed221..38825257105476d7dba398cc13b2b763fabb2cf5 100644 (file)
@@ -144,10 +144,10 @@ DynTypedMatcher DynTypedMatcher::constructVariadic(
     ast_type_traits::ASTNodeKind SupportedKind,
     std::vector<DynTypedMatcher> InnerMatchers) {
   assert(!InnerMatchers.empty() && "Array must not be empty.");
-  assert(std::all_of(InnerMatchers.begin(), InnerMatchers.end(),
-                     [SupportedKind](const DynTypedMatcher &M) {
-                       return M.canConvertTo(SupportedKind);
-                     }) &&
+  assert(llvm::all_of(InnerMatchers,
+                      [SupportedKind](const DynTypedMatcher &M) {
+                        return M.canConvertTo(SupportedKind);
+                      }) &&
          "InnerMatchers must be convertible to SupportedKind!");
 
   // We must relax the restrict kind here.
@@ -449,7 +449,7 @@ bool HasNameMatcher::matchesNodeUnqualified(const NamedDecl &Node) const {
   assert(UseUnqualifiedMatch);
   llvm::SmallString<128> Scratch;
   StringRef NodeName = getNodeName(Node, Scratch);
-  return std::any_of(Names.begin(), Names.end(), [&](StringRef Name) {
+  return llvm::any_of(Names, [&](StringRef Name) {
     return consumeNameSuffix(Name, NodeName) && Name.empty();
   });
 }
index 9a18eacf486683b159cf71e643025fee536b9242..cbf70c356f14e517fc9cc222975e8f49d4308e51 100644 (file)
@@ -523,8 +523,7 @@ void CloneConstraint::splitCloneGroups(
       Result.push_back(PotentialGroup);
     }
 
-    assert(std::all_of(Indexes.begin(), Indexes.end(),
-                       [](char c) { return c == 1; }));
+    assert(llvm::all_of(Indexes, [](char c) { return c == 1; }));
   }
   CloneGroups = Result;
 }
index 8edf7f496027bdcc096becc02c8b3bf70e6e30f9..7b181a01c82e7734997f22519e1ab43c9986abb6 100644 (file)
@@ -741,8 +741,8 @@ CodeGenTypes::arrangeLLVMFunctionInfo(CanQualType resultType,
                                       FunctionType::ExtInfo info,
                      ArrayRef<FunctionProtoType::ExtParameterInfo> paramInfos,
                                       RequiredArgs required) {
-  assert(std::all_of(argTypes.begin(), argTypes.end(),
-                     [](CanQualType T) { return T.isCanonicalAsParam(); }));
+  assert(llvm::all_of(argTypes,
+                      [](CanQualType T) { return T.isCanonicalAsParam(); }));
 
   // Lookup or create unique function info.
   llvm::FoldingSetNodeID ID;
index 77f978f687e5acea78da7a89f7ccebba59c8a262..6249ae846dd427d45f235eb17d5f39d8bf8bb97d 100644 (file)
@@ -2284,14 +2284,13 @@ static bool hasRequiredFeatures(const SmallVectorImpl<StringRef> &ReqFeatures,
       ReqFeatures.begin(), ReqFeatures.end(), [&](StringRef Feature) {
         SmallVector<StringRef, 1> OrFeatures;
         Feature.split(OrFeatures, '|');
-        return std::any_of(OrFeatures.begin(), OrFeatures.end(),
-                           [&](StringRef Feature) {
-                             if (!CallerFeatureMap.lookup(Feature)) {
-                               FirstMissing = Feature.str();
-                               return false;
-                             }
-                             return true;
-                           });
+        return llvm::any_of(OrFeatures, [&](StringRef Feature) {
+          if (!CallerFeatureMap.lookup(Feature)) {
+            FirstMissing = Feature.str();
+            return false;
+          }
+          return true;
+        });
       });
 }
 
index 2b5e266104cb28517250c39ba2ff30bc23103813..a0cc4d03b3cd88ac1988fff4ab166e4ca002dbcb 100644 (file)
@@ -1160,8 +1160,8 @@ public:
     // Reject any candidate that only resolves to instance members since they
     // aren't viable as standalone identifiers instead of member references.
     if (Candidate.isResolved() && !Candidate.isKeyword() &&
-        std::all_of(Candidate.begin(), Candidate.end(),
-                    [](NamedDecl *ND) { return ND->isCXXInstanceMember(); }))
+        llvm::all_of(Candidate,
+                     [](NamedDecl *ND) { return ND->isCXXInstanceMember(); }))
       return false;
 
     return CorrectionCandidateCallback::ValidateCandidate(Candidate);
index 71f3c4e34b581eac415e9d6cc08c2cbb4f5ff15c..597b7ba59e7379dcaf9f2d8d25f942077f19d78f 100644 (file)
@@ -6441,7 +6441,7 @@ static bool isVarOnPath(IndirectLocalPath &Path, VarDecl *VD) {
 }
 
 static bool pathContainsInit(IndirectLocalPath &Path) {
-  return std::any_of(Path.begin(), Path.end(), [=](IndirectLocalPathEntry E) {
+  return llvm::any_of(Path, [=](IndirectLocalPathEntry E) {
     return E.Kind == IndirectLocalPathEntry::DefaultInit ||
            E.Kind == IndirectLocalPathEntry::VarInit;
   });
index 8cb0fb4cb88870b3effcb68fa8d34b6e5a943677..e359d59d89438eee856c05e6d914fe6588571125 100644 (file)
@@ -1600,9 +1600,9 @@ bool Sema::isModuleVisible(const Module *M, bool ModulePrivate) {
     return false;
 
   // Check whether M is transitively exported to an import of the lookup set.
-  return std::any_of(LookupModules.begin(), LookupModules.end(),
-                     [&](const Module *LookupM) {
-                       return LookupM->isModuleVisible(M); });
+  return llvm::any_of(LookupModules, [&](const Module *LookupM) {
+    return LookupM->isModuleVisible(M);
+  });
 }
 
 bool Sema::isVisibleSlow(const NamedDecl *D) {
index a8d69ea7fbadfce7859e4f9b252bede3c92a84b9..e891bf95b317aa06908ccc6fb8986c6673d233cf 100644 (file)
@@ -10997,7 +10997,7 @@ private:
 
     // Note: We explicitly leave Matches unmodified if there isn't a clear best
     // option, so we can potentially give the user a better error
-    if (!std::all_of(Matches.begin(), Matches.end(), IsBestOrInferiorToBest))
+    if (!llvm::all_of(Matches, IsBestOrInferiorToBest))
       return false;
     Matches[0] = *Best;
     Matches.resize(1);
index 9ff9a02a58ae7b2956593e8b3776a71529093a98..592e8572c77057f48c091c0565e0c6aae018689c 100644 (file)
@@ -845,9 +845,8 @@ void ASTDiff::Impl::matchBottomUp(Mapping &M) const {
     }
     bool Matched = M.hasSrc(Id1);
     const Node &N1 = T1.getNode(Id1);
-    bool MatchedChildren =
-        std::any_of(N1.Children.begin(), N1.Children.end(),
-                    [&](NodeId Child) { return M.hasSrc(Child); });
+    bool MatchedChildren = llvm::any_of(
+        N1.Children, [&](NodeId Child) { return M.hasSrc(Child); });
     if (Matched || !MatchedChildren)
       continue;
     NodeId Id2 = findCandidate(M, Id1);