[clang-tools-extra] [clang-tidy] Avoid processing declarations in system headers (PR #128150)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 6 05:01:00 PST 2025
Carlos =?utf-8?q?Gálvez?= <carlos.galvez at zenseact.com>,
Carlos =?utf-8?q?Gálvez?= <carlos.galvez at zenseact.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/128150 at github.com>
steakhal wrote:
> That's a good point. @haoNoQ @Xazax-hun @steakhal Do you see any implications on this patch when running clang static analyzer via clang-tidy? Any checks that would stop detecting issues?
>
> TLDR: we are setting the traversal scope to only contain top-level declarations which are not in system headers.
Not analyzing system headers is the desired behavior for the Static Analyzer too. But please note that the `clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp` does it's own `HandleTopLevelDecl` thing, thus the Static Analyzer wouldn't be affected by setting this scope here. That code would need to be patched separately to somehow take this into account.
If we would patch it, we would of course lose issues, but those were not actionable anyway. So, it would be an improvement in that sense. I strongly support the direction.
https://github.com/llvm/llvm-project/pull/128150
More information about the cfe-commits
mailing list