[clang-tools-extra] Add option to exclude headers from clang-tidy analysis (PR #91400)

Justin Cady via cfe-commits cfe-commits at lists.llvm.org
Wed May 8 10:16:01 PDT 2024


================
@@ -578,6 +579,13 @@ llvm::Regex *ClangTidyDiagnosticConsumer::getHeaderFilter() {
   return HeaderFilter.get();
 }
 
+llvm::Regex *ClangTidyDiagnosticConsumer::getExcludeHeaderFilter() {
+  if (!ExcludeHeaderFilter)
+    ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
+        *Context.getOptions().ExcludeHeaderFilterRegex);
----------------
justincady wrote:

I'm not sure I follow here. If `ExcludeHeaderFilterRegex` isn't set via the command line or config, it will be initialized to an empty string. Then the `llvm::Regex` will be constructed with that empty string.

Is that different than what you mean?

https://github.com/llvm/llvm-project/pull/91400


More information about the cfe-commits mailing list