[clang] Set ShowInSystemHeader for module-build and module-import remarks
authorDave Lee <davelee.com@gmail.com>
Thu, 8 Dec 2022 18:31:16 +0000 (10:31 -0800)
committerDave Lee <davelee.com@gmail.com>
Fri, 31 Mar 2023 22:56:09 +0000 (15:56 -0700)
commitba6e747f9b05e541e88822e1dbd6bd5424cfe2fb
treeb1d522871946c6ade46c6eb72837b560142abfe9
parent7b86f7c5d4c465cc11746cc3e49c6e0b3d29610b
[clang] Set ShowInSystemHeader for module-build and module-import remarks

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`.

Differential Revision: https://reviews.llvm.org/D139653
clang/include/clang/Basic/DiagnosticFrontendKinds.td
clang/include/clang/Basic/DiagnosticSerializationKinds.td
clang/test/Modules/system-Rmodule-build.m [new file with mode: 0644]