================
@@ -311,7 +311,12 @@ ClangTidyDiagnosticConsumer::ClangTidyDiagnosticConsumer(
     : Context(Ctx), ExternalDiagEngine(ExternalDiagEngine),
       RemoveIncompatibleErrors(RemoveIncompatibleErrors),
       GetFixesFromNotes(GetFixesFromNotes),
-      EnableNolintBlocks(EnableNolintBlocks) {}
+      EnableNolintBlocks(EnableNolintBlocks) {
+
+  if (Context.getOptions().ExcludeHeaderFilterRegex)
+    ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
+        *Context.getOptions().ExcludeHeaderFilterRegex);
+}
----------------
justincady wrote:

Well, in the initial PR `ExcludeHeaderFilter` mirrored `HeaderFilter` behavior 
exactly. I changed it because @PiotrZSL made a nearly identical comment to 
yours about saving the call to `match` on an empty regex (which I think is 
handled in the latest revision).

I _could_ migrate `HeaderFilter` to mirror the new and improved 
`ExcludeHeaderFilter`...though I worry a bit about this change growing larger 
and larger. What do you think?

https://github.com/llvm/llvm-project/pull/91400
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to