@@ -53,11 +53,6 @@ LLVM_INSTANTIATE_REGISTRY(clang::tidy::ClangTidyModuleRegistry)
53
53
54
54
namespace clang::tidy {
55
55
56
- namespace custom {
57
- extern void registerCustomChecks (const ClangTidyOptions &O,
58
- ClangTidyCheckFactories &Factories);
59
- } // namespace custom
60
-
61
56
namespace {
62
57
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
63
58
#define ANALYZER_CHECK_NAME_PREFIX " clang-analyzer-"
@@ -347,10 +342,6 @@ ClangTidyASTConsumerFactory::ClangTidyASTConsumerFactory(
347
342
IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS)
348
343
: Context(Context), OverlayFS(std::move(OverlayFS)),
349
344
CheckFactories(new ClangTidyCheckFactories) {
350
- #if CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
351
- if (Context.canExperimentalCustomChecks ())
352
- custom::registerCustomChecks (Context.getOptions (), *CheckFactories);
353
- #endif
354
345
for (ClangTidyModuleRegistry::entry E : ClangTidyModuleRegistry::entries ()) {
355
346
std::unique_ptr<ClangTidyModule> Module = E.instantiate ();
356
347
Module->addCheckFactories (*CheckFactories);
@@ -420,10 +411,7 @@ ClangTidyASTConsumerFactory::createASTConsumer(
420
411
.getCurrentWorkingDirectory ();
421
412
if (WorkingDir)
422
413
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
+
427
415
std::vector<std::unique_ptr<ClangTidyCheck>> Checks =
428
416
CheckFactories->createChecksForLanguage (&Context);
429
417
@@ -509,13 +497,13 @@ ClangTidyOptions::OptionMap ClangTidyASTConsumerFactory::getCheckOptions() {
509
497
return Options;
510
498
}
511
499
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 ) {
515
503
clang::tidy::ClangTidyContext Context (
516
504
std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions (),
517
505
Options),
518
- AllowEnablingAnalyzerAlphaCheckers, false , ExperimentalCustomChecks );
506
+ AllowEnablingAnalyzerAlphaCheckers);
519
507
ClangTidyASTConsumerFactory Factory (Context);
520
508
return Factory.getCheckNames ();
521
509
}
@@ -536,12 +524,11 @@ void filterCheckOptions(ClangTidyOptions &Options,
536
524
537
525
ClangTidyOptions::OptionMap
538
526
getCheckOptions (const ClangTidyOptions &Options,
539
- bool AllowEnablingAnalyzerAlphaCheckers,
540
- bool ExperimentalCustomChecks) {
527
+ bool AllowEnablingAnalyzerAlphaCheckers) {
541
528
clang::tidy::ClangTidyContext Context (
542
529
std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions (),
543
530
Options),
544
- AllowEnablingAnalyzerAlphaCheckers, false , ExperimentalCustomChecks );
531
+ AllowEnablingAnalyzerAlphaCheckers);
545
532
ClangTidyDiagnosticConsumer DiagConsumer (Context);
546
533
auto DiagOpts = std::make_unique<DiagnosticOptions>();
547
534
DiagnosticsEngine DE (llvm::makeIntrusiveRefCnt<DiagnosticIDs>(), *DiagOpts,
@@ -678,19 +665,15 @@ void exportReplacements(const llvm::StringRef MainFilePath,
678
665
YAML << TUD;
679
666
}
680
667
681
- ChecksAndOptions getAllChecksAndOptions ( bool AllowEnablingAnalyzerAlphaCheckers,
682
- bool ExperimentalCustomChecks ) {
668
+ ChecksAndOptions
669
+ getAllChecksAndOptions ( bool AllowEnablingAnalyzerAlphaCheckers ) {
683
670
ChecksAndOptions Result;
684
671
ClangTidyOptions Opts;
685
672
Opts.Checks = " *" ;
686
673
clang::tidy::ClangTidyContext Context (
687
674
std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions (), Opts),
688
- AllowEnablingAnalyzerAlphaCheckers, false , ExperimentalCustomChecks );
675
+ AllowEnablingAnalyzerAlphaCheckers);
689
676
ClangTidyCheckFactories Factories;
690
- #if CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
691
- if (ExperimentalCustomChecks)
692
- custom::registerCustomChecks (Context.getOptions (), Factories);
693
- #endif
694
677
for (const ClangTidyModuleRegistry::entry &Module :
695
678
ClangTidyModuleRegistry::entries ()) {
696
679
Module.instantiate ()->addCheckFactories (Factories);
0 commit comments