@@ -305,17 +305,17 @@ Therefore, none of the following names are valid by default:
305
305
Using a reserved module name is strongly discouraged, but
306
306
``-Wno-reserved-module-identifier `` can be used to suppress the warning.
307
307
308
- Specifying dependent BMIs
309
- ~~~~~~~~~~~~~~~~~~~~~~~~~
308
+ Specifying BMI dependencies
309
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
310
310
311
- There are 3 ways to specify a dependent BMI:
311
+ There are 3 ways to specify a BMI dependency :
312
312
313
313
1. ``-fprebuilt-module-path=<path/to/directory> ``.
314
314
2. ``-fmodule-file=<path/to/BMI> `` (Deprecated).
315
315
3. ``-fmodule-file=<module-name>=<path/to/BMI> ``.
316
316
317
317
The ``-fprebuilt-module-path `` option specifies the path to search for
318
- dependent BMIs . Multiple paths may be specified, similar to using ``-I `` to
318
+ BMI dependencies . Multiple paths may be specified, similar to using ``-I `` to
319
319
specify a search path for header files. When importing a module ``M ``, the
320
320
compiler looks for ``M.pcm `` in the directories specified by
321
321
``-fprebuilt-module-path ``. Similarly, when importing a partition module unit
@@ -337,9 +337,8 @@ When these options are specified in the same invocation of the compiler, the
337
337
``-fmodule-file=<module-name>=<path/to/BMI> ``, which takes precedence over
338
338
``-fprebuilt-module-path=<path/to/directory> ``.
339
339
340
- Note: all dependant BMIs must be specified explicitly, either directly or
341
- indirectly dependent BMIs explicitly. See
342
- https://github.com/llvm/llvm-project/issues/62707 for details.
340
+ Note: all BMI dependencies must be specified explicitly, either directly or
341
+ indirectly. See https://github.com/llvm/llvm-project/issues/62707 for details.
343
342
344
343
When compiling a ``module implementation unit ``, the BMI of the corresponding
345
344
``primary module interface unit `` must be specified because a module
@@ -380,7 +379,7 @@ For example, the traditional compilation processes for headers are like:
380
379
hdr2.h --, |
381
380
src2.cpp -+> clang++ src2.cpp --> src2.o ---'
382
381
383
- And the compilation process for module units are like:
382
+ And the compilation processes for module units are like:
384
383
385
384
.. code-block :: text
386
385
@@ -435,7 +434,7 @@ non-module-unit uses need to be consistent. Consider the following example:
435
434
$ clang++ -std=c++23 Use.cpp -fprebuilt-module-path=.
436
435
437
436
Clang rejects the example due to the inconsistent language standard modes. Not
438
- all compiler options are language dialect options, though. For example:
437
+ all compiler options are language- dialect options, though. For example:
439
438
440
439
.. code-block :: console
441
440
@@ -465,7 +464,7 @@ translation units.
465
464
Source Files Consistency
466
465
^^^^^^^^^^^^^^^^^^^^^^^^
467
466
468
- Clang may open the input files\ :sup: `1`` of a BMI during the compilation. This implies that
467
+ Clang may open the input files [ 1 ]_ of a BMI during the compilation. This implies that
469
468
when Clang consumes a BMI, all the input files need to be present in the original path
470
469
and with the original contents.
471
470
@@ -477,21 +476,21 @@ When the ``-fmodules-embed-all-files`` flag are enabled, Clang explicitly emits
477
476
code into the BMI file, the contents of the BMI file contain a sufficiently verbose
478
477
representation to reproduce the original source file.
479
478
480
- :sup: `1`` Input files: The source files which took part in the compilation of the BMI.
481
- For example:
479
+ .. [ 1 ] Input files: The source files which took part in the compilation of the BMI.
480
+ For example:
482
481
483
- .. code-block :: c++
482
+ .. code-block :: c++
484
483
485
- // M.cppm
486
- module;
487
- #include "foo.h"
488
- export module M;
484
+ // M.cppm
485
+ module;
486
+ #include "foo.h"
487
+ export module M;
489
488
490
- // foo.h
491
- #pragma once
492
- #include "bar.h"
489
+ // foo.h
490
+ #pragma once
491
+ #include "bar.h"
493
492
494
- The ``M.cppm ``, ``foo.h `` and ``bar.h `` are input files for the BMI of ``M.cppm ``.
493
+ The ``M.cppm ``, ``foo.h `` and ``bar.h `` are input files for the BMI of ``M.cppm ``.
495
494
496
495
Object definition consistency
497
496
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -781,8 +780,8 @@ for the BMI being produced. This ensures that build systems are not required to
781
780
transitively imported modules when deciding whether to recompile.
782
781
783
782
What is considered to be a potential contributory BMIs is currently unspecified.
784
- However, it is a severe bug for a BMI to remain unchanged following an observable change
785
- that affects its consumers.
783
+ However, it is a severe bug for a BMI to remain unchanged following an
784
+ observable change in the module source files that affects the module consumers.
786
785
787
786
Build systems may utilize this optimization by doing an update-if-changed operation to the BMI
788
787
that is consumed from the BMI that is output by the compiler.
@@ -1192,14 +1191,14 @@ them to ``your_library_imported.h`` too.
1192
1191
Importing modules
1193
1192
~~~~~~~~~~~~~~~~~
1194
1193
1195
- When there are dependent libraries providing modules, they should be imported
1196
- in your module as well. Many existing libraries will fall into this category
1197
- once the ``std `` module is more widely available.
1194
+ When there are library dependencies providing modules, the module dependencies
1195
+ should be imported in your module as well. Many existing libraries will fall
1196
+ into this category once the ``std `` module is more widely available.
1198
1197
1199
- All dependent libraries providing modules
1200
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1198
+ All library dependencies providing modules
1199
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1201
1200
1202
- Of course, most of the complexity disappears if all the dependent libraries
1201
+ Of course, most of the complexity disappears if all the library dependencies
1203
1202
provide modules.
1204
1203
1205
1204
Headers need to be converted to include third-party headers conditionally. Then,
@@ -1260,8 +1259,8 @@ Non-exported ``using`` declarations are unnecessary if using implementation
1260
1259
module units. Instead, third-party modules can be imported directly in
1261
1260
implementation module units.
1262
1261
1263
- Partial dependent libraries providing modules
1264
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1262
+ Partial library dependencies providing modules
1263
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1265
1264
1266
1265
If the library has to mix the use of ``include `` and ``import `` in its module,
1267
1266
the primary goal is still the removal of duplicated declarations in translation
@@ -1562,17 +1561,17 @@ file as a header. For example:
1562
1561
$ clang++ -std=c++20 -fmodule-header=system -xc++-header iostream -o iostream.pcm
1563
1562
$ clang++ -std=c++20 -fmodule-file=iostream.pcm use.cpp
1564
1563
1565
- How to specify dependent BMIs
1566
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1564
+ How to specify BMI dependencies
1565
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1567
1566
1568
- ``-fmodule-file `` can be used to specify a dependent BMI (or multiple times for
1569
- more than one dependent BMI).
1567
+ ``-fmodule-file `` can be used to specify a BMI dependency (or multiple times for
1568
+ more than one BMI dependency ).
1570
1569
1571
1570
With the existing implementation, ``-fprebuilt-module-path `` cannot be used for
1572
1571
header units (because they are nominally anonymous). For header units, use
1573
1572
``-fmodule-file `` to include the relevant PCM file for each header unit.
1574
1573
1575
- This is expect to be solved in a future version of Clang either by the compiler
1574
+ This is expected to be solved in a future version of Clang either by the compiler
1576
1575
finding and specifying ``-fmodule-file `` automatically, or by the use of a
1577
1576
module-mapper that understands how to map the header name to their PCMs.
1578
1577
0 commit comments