================
@@ -574,15 +576,30 @@ ParsedAST::build(llvm::StringRef Filename, const 
ParseInputs &Inputs,
         E.instantiate()->addCheckFactories(*CTFactories);
       return CTFactories;
     }();
-    tidy::ClangTidyCheckFactories FastFactories = filterFastTidyChecks(
-        *AllCTFactories, Cfg.Diagnostics.ClangTidy.FastCheckFilter);
     CTContext.emplace(std::make_unique<tidy::DefaultOptionsProvider>(
-        tidy::ClangTidyGlobalOptions(), ClangTidyOpts));
+                          tidy::ClangTidyGlobalOptions(), ClangTidyOpts),
+                      /*AllowEnablingAnalyzerAlphaCheckers=*/false,
+                      /*EnableModuleHeadersParsing=*/false,
+                      Cfg.Diagnostics.ClangTidy.ExperimentalCustomChecks);
     // The lifetime of DiagnosticOptions is managed by \c Clang.
     CTContext->setDiagnosticsEngine(nullptr, &Clang->getDiagnostics());
     CTContext->setASTContext(&Clang->getASTContext());
     CTContext->setCurrentFile(Filename);
     CTContext->setSelfContainedDiags(true);
+    tidy::ClangTidyCheckFactories CTCheckFactories = *AllCTFactories;
+#if CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
----------------
ArcsinX wrote:

`CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS` is defined in 
`clang-tidy-config.h`, but we don't include it in `ParsedAST.cpp` directly, 
because `ClangTidyForceLinker.h` includes `clang-tidy-config.h`.
This also explains why there is only 
`CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS` check here (without 
`CLANGD_TIDY_CHECKS`).
I think this is not an obvious and deserves a comment near 
`ClangTidyForceLinker.h` inclusion.

Btw, unsure, is it ok, that `ClangTidyForceLinker.h` includes 
`clang-tidy-config.h` despite the fact that a comment in `clang-tidy-config.h` 
explicitly forbids including it in other headers? @vbvictor 
@zeyi2 

https://github.com/llvm/llvm-project/pull/216336
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to