iana planned changes to this revision.
iana added a comment.

In D140250#4081133 <https://reviews.llvm.org/D140250#4081133>, @iana wrote:

> In D140250#4081119 <https://reviews.llvm.org/D140250#4081119>, @rsmith wrote:
>
>> In D140250#4081102 <https://reviews.llvm.org/D140250#4081102>, @rsmith wrote:
>>
>>> Our builtin header `stddef.h` shouldn't be built as a module. It 
>>> fundamentally needs to be treated as a textual header, because it consumes 
>>> macros defined by the includer. The module map that we provide with our 
>>> builtin headers does not cover `stddef.h` for that reason.
>>
>> That said... the ` __has_feature(modules)` checks throughout `stddef.h` look 
>> pretty wrong to me. They're probably working around the infelicities of the 
>> `-fno-modules-local-submodule-visibility` mode; maybe we can disable them 
>> when not in that mode?
>
> It ends up being covered by `Darwin.C.stddef` on Apple platforms (due to some 
> builtin shenanigans elsewhere in clang). Maybe we could make stddef.h be a 
> `textual` header in a `_Builtin_stddef` module in clang and that would do the 
> trick instead of splitting it into a bunch of different files.

This seems to work in initial testing. I'll probably drop this diff and make a 
new one to make stddef.h be a `textual` header in a new `_Builtin_stddef` 
module in clang when I do some more testing then.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140250

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to