[clang] [clang-tools-extra] [clang-tidy] [Modules] Skip checking decls in clang-tidy (PR #145630)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 25 22:57:39 PDT 2025
================
@@ -1469,6 +1470,12 @@ bool MatchASTVisitor::TraverseDecl(Decl *DeclNode) {
return true;
}
+ if (Options.SkipDeclsInModules && DeclNode->isFromASTFile()) {
+ auto *M = DeclNode->getOwningModule();
+ if (M && (M->isInterfaceOrPartition() || M->isGlobalModule()))
+ return true;
+ }
+
----------------
ChuanqiXu9 wrote:
Yes, I think this is fine. `isFromASTFile` means this is deserialized. `(M->isInterfaceOrPartition() || M->isGlobalModule())` means it is from named modules. There are other kinds of modules but they are header modules, which have headers semantics. While the C++20 named modules is another TU, not a header. So I think it is proper here.
https://github.com/llvm/llvm-project/pull/145630
More information about the cfe-commits
mailing list