diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-30 08:45:59 +0000 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-30 08:45:59 +0000 |
commit | 7a71b4b6584fd70f43b88049174f8894cab3a4d2 (patch) | |
tree | f5b82d4b250eaeb6ee5d3838d470f1bf8a707271 /clang/docs/Modules.rst | |
parent | be5b60f735587104d1fe580bcabd1e011ac0c566 (diff) | |
download | bcm5719-llvm-7a71b4b6584fd70f43b88049174f8894cab3a4d2.tar.gz bcm5719-llvm-7a71b4b6584fd70f43b88049174f8894cab3a4d2.zip |
[modules] Add ability to specify module name to module file mapping
Extend the -fmodule-file option to support the [<name>=]<file> value format.
If the name is omitted, then the old semantics is preserved (the module file
is loaded whether needed or not). If the name is specified, then the mapping
is treated as just another prebuilt module search mechanism, similar to
-fprebuilt-module-path, and the module file is only loaded if actually used
(e.g., via import). With one exception: this mapping also overrides module
file references embedded in other modules (which can be useful if module files
are moved/renamed as often happens during remote compilation).
This override semantics requires some extra work: we now store the module name
in addition to the file name in the serialized AST representation.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D35020
llvm-svn: 312105
Diffstat (limited to 'clang/docs/Modules.rst')
-rw-r--r-- | clang/docs/Modules.rst | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst index ed6f8171573..96502792613 100644 --- a/clang/docs/Modules.rst +++ b/clang/docs/Modules.rst @@ -213,8 +213,14 @@ Command-line parameters ``-fno-implicit-modules`` All modules used by the build must be specified with ``-fmodule-file``. -``-fmodule-file=<file>`` - Load the given precompiled module file. +``-fmodule-file=[<name>=]<file>`` + Specify the mapping of module names to precompiled module files. If the + name is omitted, then the module file is loaded whether actually required + or not. If the name is specified, then the mapping is treated as another + prebuilt module search mechanism (in addition to ``-fprebuilt-module-path``) + and the module is only loaded if required. Note that in this case the + specified file also overrides this module's paths that might be embedded + in other precompiled module files. ``-fprebuilt-module-path=<directory>`` Specify the path to the prebuilt modules. If specified, we will look for modules in this directory for a given top-level module name. We don't need a module map for loading prebuilt modules in this directory and the compiler will not try to rebuild these modules. This can be specified multiple times. @@ -945,4 +951,3 @@ PCHInternals_ .. [#] The preprocessing context in which the modules are parsed is actually dependent on the command-line options provided to the compiler, including the language dialect and any ``-D`` options. However, the compiled modules for different command-line options are kept distinct, and any preprocessor directives that occur within the translation unit are ignored. See the section on the `Configuration macros declaration`_ for more information. .. _PCHInternals: PCHInternals.html - |