[clang] [clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 11 05:42:09 PDT 2025


================
@@ -1573,19 +1574,42 @@ bool MatchASTVisitor::TraverseAttr(Attr *AttrNode) {
 class MatchASTConsumer : public ASTConsumer {
 public:
   MatchASTConsumer(MatchFinder *Finder,
-                   MatchFinder::ParsingDoneTestCallback *ParsingDone)
-      : Finder(Finder), ParsingDone(ParsingDone) {}
+                   MatchFinder::ParsingDoneTestCallback *ParsingDone,
+                   bool SkipSystemHeaders = false)
----------------
Xazax-hun wrote:

I wonder if it would be better to pass the options instead of a single bool. If we want to introduce more features in the future like only processing the main file and skipping the headers that would avoid having to add more parameters here. We just expand the options. 

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


More information about the cfe-commits mailing list