[PATCH] D159483: [Modules] Add a flag to control builtin headers being in system modules

Ian Anderson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 23:48:28 PDT 2023


iana updated this revision to Diff 556627.
iana added a comment.

__stddef_max_align_t.h always needs a header guard, because the type merger can't handle struct's. If it has a header guard then it always needs to have a module too, even if `-fbuiltin-headers-in-system-modules` is passed.

Change ModuleMap to not ignore the builtin modules completely, but rather to just skip their top level headers (which is isBuiltinHeaderName + inttypes.h and stdnoreturn.h). With that change, the implementation headers are always modular, and `__has_feature(builtin_headers_in_system_modules)` is no longer necessary anywhere.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159483/new/

https://reviews.llvm.org/D159483

Files:
  clang/include/clang/Basic/Features.def
  clang/include/clang/Basic/LangOptions.def
  clang/include/clang/Driver/Options.td
  clang/include/clang/Lex/ModuleMap.h
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/lib/Lex/ModuleMap.cpp
  clang/test/Driver/Inputs/MacOSX99.0.sdk/SDKSettings.json
  clang/test/Driver/darwin-builtin-modules.c
  clang/test/Modules/Werror-Wsystem-headers.m
  clang/test/Modules/context-hash.c
  clang/test/Modules/crash-vfs-include-pch.m
  clang/test/Modules/cstd.m
  clang/test/Modules/pch-used.m
  clang/test/Modules/shadowed-submodule.m
  clang/test/Modules/stddef.c
  clang/test/Modules/stddef.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159483.556627.patch
Type: text/x-patch
Size: 21016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230913/5f584358/attachment-0001.bin>


More information about the cfe-commits mailing list