<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 24, 2016 at 4:58 PM, Bruno Cardoso Lopes via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Oct 24, 2016 at 4:17 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> On Mon, Oct 24, 2016 at 3:30 PM, Bruno Cardoso Lopes<br>
> <<a href="mailto:bruno.cardoso@gmail.com">bruno.cardoso@gmail.com</a>> wrote:<br>
>><br>
>> > Sure, go ahead.<br>
>><br>
>> I committed in r284797 and r284801 (libcxx). There's one minor issue<br>
>> I've found: the changes for the builtins affecting non submodule local<br>
>> visibility broke current users of plain "-fmodules" against our<br>
>> frameworks in public SDKs, in 10.11 & 10.12. I've attached a patch to<br>
>> work around that for the time being: make the new behavior dependent<br>
>> on local vis. Can you take a look?<br>
><br>
><br>
> What's the nature of the breakage? Generally I'd be fine with your patch,<br>
> but I wonder if there's something better we could do here.<br>
<br>
</span>I haven't entirely isolated the problem, but they are all related to<br>
definitions from stdint.h. In one example below, uint32_t doesn't<br>
leak, requiring an explicit "#include <stdint.h>" to make it work.<br>
<br>
-- example.m<br>
#import <IOKit/IODataQueueClient.h><br>
--<br>
$ clang -arch x86_64 -isysroot<br>
/Applications/Xcode.app/<wbr>Contents/Developer/Platforms/<wbr>MacOSX.platform/Developer/<wbr>SDKs/MacOSX10.12.sdk<br>
-fmodules-cache-path=tmpcache example.m -E -o /dev/null  -fmodules<br>
<br>
While building module 'IOKit' imported from example.m:1:<br>
In file included from <module-includes>:2:<br>
/Applications/Xcode.app/<wbr>Contents/Developer/Platforms/<wbr>MacOSX.platform/Developer/<wbr>SDKs/MacOSX10.12.sdk/System/<wbr>Library/Frameworks/IOKit.<wbr>framework/Headers/<wbr>IODataQueueClient.h:62:71:<br>
error: de<br>
      'Darwin.POSIX._types._uint32_<wbr>t' before it is required<br>
IOReturn IODataQueueDequeue(<wbr>IODataQueueMemory *dataQueue, void *data,<br>
uint32_t *dataSize);<br>
                                                                      ^<br>
/Applications/Xcode.app/<wbr>Contents/Developer/Platforms/<wbr>MacOSX.platform/Developer/<wbr>SDKs/MacOSX10.12.sdk/usr/<wbr>include/_types/_uint32_t.h:31:<wbr>22:<br>
<span class="">note: previous declaration is here<br>
</span>typedef unsigned int uint32_t;<br>
                     ^<br>
bot.m:1:9: fatal error: could not build module 'IOKit'<br>
#import <IOKit/IODataQueueClient.h><br>
 ~~~~~~~^</blockquote><div><br></div><div>This change also broke local submodule visibility builds with modular glibc (see PR30778 for details). I have an idea for how to fix this; running it through bootstrap now.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
>> > Hmm. Ideally, we should try to pick something that captures the spirit<br>
>> > of<br>
>> > "only non-modular headers and headers from used modules". Something like<br>
>> > "ignore_modules_not_declared_<wbr>used", but less wordy?<br>
>><br>
>> Right. It's gonna be hard to shrink this to a meaningful short name.<br>
>> What about a more generic "no_escape"?  "no_undeclared_headers"?<br>
><br>
><br>
> Hmm. Maybe we could allow the existing [exhaustive] attribute to be<br>
> specified on a use-declaration:<br>
><br>
>   use [exhaustive] a, b, c<br>
<br>
</span>I don't understand, the 'Darwin' module map doesn't use the 'use'<br>
keyword in any of its modules, how do you suggest we would use that to<br>
express the 'ignore_modules_not_declared_<wbr>used' idea?</blockquote><div><br></div><div>Hah, right, this would only work if your module has dependencies. Maybe an [exhaustive_uses] attribute on the module itself then? </div></div></div></div>