[PATCH] D139653: [clang] Set ShowInSystemHeader for module-build and module-import remarks

Dave Lee via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 8 10:42:34 PST 2022


kastiglione created this revision.
kastiglione added a reviewer: jansvoboda11.
Herald added a project: All.
kastiglione requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Without this change, the use of `-Rmodule-build` and `-Rmodule-import` only produces diagnostics for modules built or imported by non-system code.

For example, if a project source file requires the Foundation module to be built, then `-Rmodule-build` will show a single diagnostic for Foundation, but not in turn for any of Foundation's (direct or indirect) dependencies. This is because the locations of those transitive module builds are initiated from system headers, which are ignored by default. When wanting to observe module building/importing, the system modules can represent a significant amount of module diagnostics, and I think should be shown by default when `-Rmodule-build` and `-Rmodule-import` are specified.

I noticed some other remarks use `ShowInSystemHeader`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139653

Files:
  clang/include/clang/Basic/DiagnosticFrontendKinds.td
  clang/include/clang/Basic/DiagnosticSerializationKinds.td


Index: clang/include/clang/Basic/DiagnosticSerializationKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticSerializationKinds.td
+++ clang/include/clang/Basic/DiagnosticSerializationKinds.td
@@ -75,6 +75,7 @@
 
 def remark_module_import : Remark<
   "importing module '%0'%select{| into '%3'}2 from '%1'">,
+  ShowInSystemHeader,
   InGroup<ModuleImport>;
 
 def err_imported_module_not_found : Error<
Index: clang/include/clang/Basic/DiagnosticFrontendKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticFrontendKinds.td
+++ clang/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -241,6 +241,7 @@
 def note_module_def_undef_here : Note<
   "macro was %select{defined|#undef'd}0 here">;
 def remark_module_build : Remark<"building module '%0' as '%1'">,
+  ShowInSystemHeader,
   InGroup<ModuleBuild>;
 def remark_module_build_done : Remark<"finished building module '%0'">,
   InGroup<ModuleBuild>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139653.481360.patch
Type: text/x-patch
Size: 1032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221208/940d03ca/attachment.bin>


More information about the cfe-commits mailing list