<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 16, 2015, at 5:13 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" class="">richard@metafoo.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 16, 2015 at 4:48 PM, Adrian Prantl via cfe-commits<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On Oct 16, 2015, at 3:27 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank" class="">richard@metafoo.co.uk</a>> wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 15, 2015 at 11:14 AM, Adrian Prantl<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><span class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 14, 2015, at 5:07 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank" class="">richard@metafoo.co.uk</a>> wrote:</div><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">Ack, there are non-modular headers in the Darwin module. =( I seem to recall that they're not version-locked to your compiler, so we've got to support them as-is?</div><div class=""><br class=""></div><div class="">If we can't turn on local submodule visibility, then we need a module map for libc++ that covers all of its headers. I'll look into pruning the include path when building a module from an implicitly-loaded module map.</div></div></div></div></div></blockquote></div><br class=""></span><div class="">The attached patch implements this in the most hacky way; with it I can successfully compile the first few hundred files of LLVM.</div></div></blockquote><div class=""><br class=""></div><div class="">Slightly less hacky approach attached, does this also unstick you? </div></div></div></div></div></div><span class=""><no-undeclared-includes.diff></span></div></blockquote><br class=""></div><div class="">Unfortunately, no. After looking at it in the debugger, I believe the problem is that HeaderSearch looks at RequestingModule->NoUndeclaredIncludes, but the RequestingModule is a nullptr (while looking for cdefs.h included via assert.h, for example).</div></div></blockquote><div class=""><br class=""></div><div class="">I see; can you try changing the call to getModuleForLocation at the start of Preprocessor::LookupFile to call getModuleContainingLocation instead? (That change will break decl/use checking, but that's not hard to fix.)</div></div></div></div></div></blockquote><div><br class=""></div>This seems to break other things, but I do get a different result:<br class=""><br class=""></div><div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">In file included from <module-includes>:71:</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><b class="">/Volumes/Data/llvm/_build.ninja.release/bin/../lib/clang/3.8.0/include/stddef.h:118:10: </b><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class=""><b class="">fatal error: </b></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><b class=""> '__stddef_max_align_t.h' file not found</b></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">#include "__stddef_max_align_t.h"</div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(52, 189, 38);" class=""><b class=""> ^</b></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">In file included from test.cpp:2:</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">In file included from /Volumes/Data/llvm/_build.ninja.release/bin/../include/c++/v1/cassert:21:</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><b class="">/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/assert.h:42:10: </b><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class=""><b class="">fatal error: </b></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><b class=""> could not build module 'Darwin'</b></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">#include <sys/cdefs.h></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(52, 189, 38);" class=""><b class=""> ~~~~~~~~^</b></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">2 errors generated.</div></div><br class=""></body></html>