20 Factories.insert_or_assign(
Name, std::move(Factory));
23std::vector<std::unique_ptr<ClangTidyCheck>>
25 std::vector<std::unique_ptr<ClangTidyCheck>> Checks;
26 for (
const auto &Factory : Factories) {
27 if (Context->isCheckEnabled(Factory.getKey()))
28 Checks.emplace_back(Factory.getValue()(Factory.getKey(), Context));
33std::vector<std::unique_ptr<ClangTidyCheck>>
36 std::vector<std::unique_ptr<ClangTidyCheck>> Checks;
37 const LangOptions &LO = Context->getLangOpts();
38 for (
const auto &Factory : Factories) {
39 if (!Context->isCheckEnabled(Factory.getKey()))
41 std::unique_ptr<ClangTidyCheck> Check =
42 Factory.getValue()(Factory.getKey(), Context);
43 if (Check->isLanguageVersionSupported(LO))
44 Checks.push_back(std::move(Check));
llvm::SmallString< 256U > Name
std::vector< std::unique_ptr< ClangTidyCheck > > createChecksForLanguage(ClangTidyContext *Context) const
Create instances of checks that are enabled for the current Language.
void registerCheckFactory(llvm::StringRef Name, CheckFactory Factory)
Registers check Factory with name Name.
std::function< std::unique_ptr< ClangTidyCheck >(llvm::StringRef Name, ClangTidyContext *Context)> CheckFactory
std::vector< std::unique_ptr< ClangTidyCheck > > createChecks(ClangTidyContext *Context) const
Create instances of checks that are enabled.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
virtual ClangTidyOptions getModuleOptions()
Gets default options for checks defined in this module.
Contains options for clang-tidy.