llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) <details> <summary>Changes</summary> Note that use of llvm::for_each is discouraged unless we have functors readily available. --- Full diff: https://github.com/llvm/llvm-project/pull/143153.diff 3 Files Affected: - (modified) clang/lib/Sema/ParsedAttr.cpp (+2-1) - (modified) clang/tools/clang-installapi/Options.cpp (+2-2) - (modified) clang/unittests/StaticAnalyzer/BlockEntranceCallbackTest.cpp (+2-2) ``````````diff diff --git a/clang/lib/Sema/ParsedAttr.cpp b/clang/lib/Sema/ParsedAttr.cpp index 4e4859d538cd6..294f88eae931c 100644 --- a/clang/lib/Sema/ParsedAttr.cpp +++ b/clang/lib/Sema/ParsedAttr.cpp @@ -91,7 +91,8 @@ void AttributePool::takePool(AttributePool &pool) { void AttributePool::takeFrom(ParsedAttributesView &List, AttributePool &Pool) { assert(&Pool != this && "AttributePool can't take attributes from itself"); - llvm::for_each(List.AttrList, [&Pool](ParsedAttr *A) { Pool.remove(A); }); + for (ParsedAttr *A : List.AttrList) + Pool.remove(A); llvm::append_range(Attrs, List.AttrList); } diff --git a/clang/tools/clang-installapi/Options.cpp b/clang/tools/clang-installapi/Options.cpp index d0638b644df52..52b48a34d361c 100644 --- a/clang/tools/clang-installapi/Options.cpp +++ b/clang/tools/clang-installapi/Options.cpp @@ -1083,10 +1083,10 @@ void Options::addConditionalCC1Args(std::vector<std::string> &ArgStrings, // Add specific to platform arguments. PathSeq PlatformSearchPaths = getPathsForPlatform(FEOpts.SystemFwkPaths, mapToPlatformType(Targ)); - llvm::for_each(PlatformSearchPaths, [&ArgStrings](const StringRef Path) { + for (StringRef Path : PlatformSearchPaths) { ArgStrings.push_back("-iframework"); ArgStrings.push_back(Path.str()); - }); + } // Add specific to header type arguments. if (Type == HeaderType::Project) diff --git a/clang/unittests/StaticAnalyzer/BlockEntranceCallbackTest.cpp b/clang/unittests/StaticAnalyzer/BlockEntranceCallbackTest.cpp index 9f62d8b87d96d..0f05c39df93e0 100644 --- a/clang/unittests/StaticAnalyzer/BlockEntranceCallbackTest.cpp +++ b/clang/unittests/StaticAnalyzer/BlockEntranceCallbackTest.cpp @@ -111,10 +111,10 @@ llvm::SmallVector<StringRef> parseEachDiag(StringRef Diags) { llvm::SmallVector<StringRef> Fragments; llvm::SplitString(Diags, Fragments, "\n"); // Drop the prefix like "test.BlockEntranceTester: " from each fragment. - llvm::for_each(Fragments, [](StringRef &Fragment) { + for (StringRef &Fragment : Fragments) { Fragment = Fragment.drop_until([](char Ch) { return Ch == ' '; }); Fragment.consume_front(" "); - }); + } llvm::sort(Fragments); return Fragments; } `````````` </details> https://github.com/llvm/llvm-project/pull/143153 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits