[cfe-dev] Modules TS: binary module interface dependencies
Boris Kolpackov via cfe-dev
cfe-dev at lists.llvm.org
Wed Jun 28 00:55:38 PDT 2017
Richard Smith <richard at metafoo.co.uk> writes:
> Assuming by BMI you mean the .pcm file, this is not true. Clang requires
> both the core and extra .pcm files in this case. However, we found it
> extremely impractical to explicitly pass all such .pcm files to a
> compilation (and indeed on large projects doing so caused us to hit command
> line length limits and generally produce *highly* unwieldy command lines),
> so we do not require .pcm's that are reachable through the dependencies of
> another .pcm file to be explicitly passed to the compiler -- each .pcm
> stores names and relative paths to its dependencies, and we load those
> dependencies as part of loading the .pcm itself.
Got (and tested) it, thanks. I suppose there is no reason for you to
deviate from this once you support module re-export (export import M;)
even though, in a sense, re-export is as-if injecting an implicit import
into the consumer's translation unit?
One thing I noticed is that there is no way to override this embedded
path, at least not with -fmodule-file. This could be useful for
distributed compilation since otherwise the build system will have
to recreate the directory structure on the remote host.
Would there be interest in having a low-level option that specifies
the exact module name to module .pcm mapping and, perhaps, a second
one that can read such mappings from a file? They will then override
module file references in .pcm's.
Thanks,
Boris
More information about the cfe-dev
mailing list