llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang-tools-extra Author: Victor Chernyakin (localspook) <details> <summary>Changes</summary> --- Full diff: https://github.com/llvm/llvm-project/pull/172432.diff 1 Files Affected: - (modified) clang-tools-extra/clang-tidy/ClangTidyModule.cpp (+6-7) ``````````diff diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp index 4fb4144f835a3..1691b6251614d 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp @@ -23,9 +23,9 @@ void ClangTidyCheckFactories::registerCheckFactory(StringRef Name, std::vector<std::unique_ptr<ClangTidyCheck>> ClangTidyCheckFactories::createChecks(ClangTidyContext *Context) const { std::vector<std::unique_ptr<ClangTidyCheck>> Checks; - for (const auto &Factory : Factories) { - if (Context->isCheckEnabled(Factory.getKey())) - Checks.emplace_back(Factory.getValue()(Factory.getKey(), Context)); + for (const auto &[CheckName, Factory] : Factories) { + if (Context->isCheckEnabled(CheckName)) + Checks.emplace_back(Factory(CheckName, Context)); } return Checks; } @@ -35,11 +35,10 @@ ClangTidyCheckFactories::createChecksForLanguage( ClangTidyContext *Context) const { std::vector<std::unique_ptr<ClangTidyCheck>> Checks; const LangOptions &LO = Context->getLangOpts(); - for (const auto &Factory : Factories) { - if (!Context->isCheckEnabled(Factory.getKey())) + for (const auto &[CheckName, Factory] : Factories) { + if (!Context->isCheckEnabled(CheckName)) continue; - std::unique_ptr<ClangTidyCheck> Check = - Factory.getValue()(Factory.getKey(), Context); + std::unique_ptr<ClangTidyCheck> Check = Factory(CheckName, Context); if (Check->isLanguageVersionSupported(LO)) Checks.push_back(std::move(Check)); } `````````` </details> https://github.com/llvm/llvm-project/pull/172432 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
