@@ -53,11 +53,6 @@ LLVM_INSTANTIATE_REGISTRY(clang::tidy::ClangTidyModuleRegistry)
5353
5454namespace clang::tidy {
5555
56- namespace custom {
57- extern void registerCustomChecks (const ClangTidyOptions &O,
58- ClangTidyCheckFactories &Factories);
59- } // namespace custom
60-
6156namespace {
6257#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
6358#define ANALYZER_CHECK_NAME_PREFIX " clang-analyzer-"
@@ -347,10 +342,6 @@ ClangTidyASTConsumerFactory::ClangTidyASTConsumerFactory(
347342 IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS)
348343 : Context(Context), OverlayFS(std::move(OverlayFS)),
349344 CheckFactories(new ClangTidyCheckFactories) {
350- #if CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
351- if (Context.canExperimentalCustomChecks ())
352- custom::registerCustomChecks (Context.getOptions (), *CheckFactories);
353- #endif
354345 for (ClangTidyModuleRegistry::entry E : ClangTidyModuleRegistry::entries ()) {
355346 std::unique_ptr<ClangTidyModule> Module = E.instantiate ();
356347 Module->addCheckFactories (*CheckFactories);
@@ -420,10 +411,7 @@ ClangTidyASTConsumerFactory::createASTConsumer(
420411 .getCurrentWorkingDirectory ();
421412 if (WorkingDir)
422413 Context.setCurrentBuildDirectory (WorkingDir.get ());
423- #if CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
424- if (Context.canExperimentalCustomChecks ())
425- custom::registerCustomChecks (Context.getOptions (), *CheckFactories);
426- #endif
414+
427415 std::vector<std::unique_ptr<ClangTidyCheck>> Checks =
428416 CheckFactories->createChecksForLanguage (&Context);
429417
@@ -509,13 +497,13 @@ ClangTidyOptions::OptionMap ClangTidyASTConsumerFactory::getCheckOptions() {
509497 return Options;
510498}
511499
512- std::vector<std::string> getCheckNames ( const ClangTidyOptions &Options,
513- bool AllowEnablingAnalyzerAlphaCheckers ,
514- bool ExperimentalCustomChecks ) {
500+ std::vector<std::string>
501+ getCheckNames ( const ClangTidyOptions &Options ,
502+ bool AllowEnablingAnalyzerAlphaCheckers ) {
515503 clang::tidy::ClangTidyContext Context (
516504 std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions (),
517505 Options),
518- AllowEnablingAnalyzerAlphaCheckers, false , ExperimentalCustomChecks );
506+ AllowEnablingAnalyzerAlphaCheckers);
519507 ClangTidyASTConsumerFactory Factory (Context);
520508 return Factory.getCheckNames ();
521509}
@@ -536,12 +524,11 @@ void filterCheckOptions(ClangTidyOptions &Options,
536524
537525ClangTidyOptions::OptionMap
538526getCheckOptions (const ClangTidyOptions &Options,
539- bool AllowEnablingAnalyzerAlphaCheckers,
540- bool ExperimentalCustomChecks) {
527+ bool AllowEnablingAnalyzerAlphaCheckers) {
541528 clang::tidy::ClangTidyContext Context (
542529 std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions (),
543530 Options),
544- AllowEnablingAnalyzerAlphaCheckers, false , ExperimentalCustomChecks );
531+ AllowEnablingAnalyzerAlphaCheckers);
545532 ClangTidyDiagnosticConsumer DiagConsumer (Context);
546533 auto DiagOpts = std::make_unique<DiagnosticOptions>();
547534 DiagnosticsEngine DE (llvm::makeIntrusiveRefCnt<DiagnosticIDs>(), *DiagOpts,
@@ -678,19 +665,15 @@ void exportReplacements(const llvm::StringRef MainFilePath,
678665 YAML << TUD;
679666}
680667
681- ChecksAndOptions getAllChecksAndOptions ( bool AllowEnablingAnalyzerAlphaCheckers,
682- bool ExperimentalCustomChecks ) {
668+ ChecksAndOptions
669+ getAllChecksAndOptions ( bool AllowEnablingAnalyzerAlphaCheckers ) {
683670 ChecksAndOptions Result;
684671 ClangTidyOptions Opts;
685672 Opts.Checks = " *" ;
686673 clang::tidy::ClangTidyContext Context (
687674 std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions (), Opts),
688- AllowEnablingAnalyzerAlphaCheckers, false , ExperimentalCustomChecks );
675+ AllowEnablingAnalyzerAlphaCheckers);
689676 ClangTidyCheckFactories Factories;
690- #if CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
691- if (ExperimentalCustomChecks)
692- custom::registerCustomChecks (Context.getOptions (), Factories);
693- #endif
694677 for (const ClangTidyModuleRegistry::entry &Module :
695678 ClangTidyModuleRegistry::entries ()) {
696679 Module.instantiate ()->addCheckFactories (Factories);
0 commit comments