[PATCH] Add stopgap option -fmodule-implementation-of

Richard Smith richard at metafoo.co.uk
Wed May 28 23:32:55 PDT 2014


On 28 May 2014 23:01, "Ben Langmuir" <blangmuir at apple.com> wrote:
>
>
>>>
>>> What’s unexpected to me is that changing a header whose contents are
not usually visible may still require rebuilding all of my .cpp files.
>>> module Foo { module One { header “One.h” } module Two { header “Two.h”
} }
>>>
>>> // One.cpp - I don’t want to rebuild when Two.h changes
>>> #import <Foo/One.h>
>>>
>>> Do we agree that this is unnecessary if submodules cannot accidentally
be affected by changes in other submodules they don’t import (and we have
some way to get the set of dependency files for just the submodule)?
>>
>>
>> No, I don't agree with that. One.cpp might inline some function
definitions from Two.h, for instance. Or it might fail to build because it
declares something that conflicts with something in Two.h.
>
>
> I feel like I”m missing something - how is that different from One.cpp
having conflicts with some completely different header or module that is
not imported into that particular TU?

If you import any part of a module, you have the whole module as part of
your translation unit, even though only some of it might be visible. Thus
we will diagnose your declarations that conflict with unimported portions
of an imported module.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140528/b5598933/attachment.html>


More information about the cfe-commits mailing list