Skip to content

Commit 9411347

Browse files
[clang] Proofread StandardCPlusPlusModules.rst (#154474)
1 parent fab0860 commit 9411347

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

clang/docs/StandardCPlusPlusModules.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ one-phase compilation model is simpler for build systems to implement while the
226226
two-phase compilation has the potential to compile faster due to higher
227227
parallelism. As an example, if there are two module units ``A`` and ``B``, and
228228
``B`` depends on ``A``, the one-phase compilation model needs to compile them
229-
serially, whereas the two-phase compilation model is able to be compiled as
230-
soon as ``A.pcm`` is available, and thus can be compiled simultaneously as the
229+
serially, whereas the two-phase compilation model can be compiled as
230+
soon as ``A.pcm`` is available, and thus can be compiled simultaneously with the
231231
``A.pcm`` to ``A.o`` compilation step.
232232

233233
File name requirements
@@ -391,7 +391,7 @@ And the compilation processes for module units are like:
391391
As the diagrams show, we need to compile the BMI from module units to object
392392
files and then link the object files. (However, this cannot be done for the BMI
393393
from header units. See the section on :ref:`header units <header-units>` for
394-
more details.
394+
more details.)
395395

396396
BMIs cannot be shipped in an archive to create a module library. Instead, the
397397
BMIs(``*.pcm``) are compiled into object files(``*.o``) and those object files
@@ -403,15 +403,15 @@ clang-cl
403403
``clang-cl`` supports the same options as ``clang++`` for modules as detailed above;
404404
there is no need to prefix these options with ``/clang:``. Note that ``cl.exe``
405405
`options to emit/consume IFC files <https://devblogs.microsoft.com/cppblog/using-cpp-modules-in-msvc-from-the-command-line-part-1/>` are *not* supported.
406-
The resultant precompiled modules are also not compatible for use with ``cl.exe``.
406+
The resulting precompiled modules are also not compatible for use with ``cl.exe``.
407407

408408
We recommend that build system authors use the above-mentioned ``clang++`` options with ``clang-cl`` to build modules.
409409

410410
Consistency Requirements
411411
~~~~~~~~~~~~~~~~~~~~~~~~
412412

413413
Modules can be viewed as a kind of cache to speed up compilation. Thus, like
414-
other caching techniques, it is important to maintain cache consistency which
414+
other caching techniques, it is important to maintain cache consistency, which
415415
is why Clang does very strict checking for consistency.
416416

417417
Options consistency
@@ -472,8 +472,8 @@ To overcome these requirements and simplify cases like distributed builds and sa
472472
builds, users can use the ``-fmodules-embed-all-files`` flag to embed all input files
473473
into the BMI so that Clang does not need to open the corresponding file on disk.
474474

475-
When the ``-fmodules-embed-all-files`` flag are enabled, Clang explicitly emits the source
476-
code into the BMI file, the contents of the BMI file contain a sufficiently verbose
475+
When the ``-fmodules-embed-all-files`` flag is enabled, Clang explicitly emits the source
476+
code into the BMI file; the BMI file contains a sufficiently verbose
477477
representation to reproduce the original source file.
478478

479479
.. [1] Input files: The source files which took part in the compilation of the BMI.
@@ -578,7 +578,7 @@ handle the dynamic initialization of non-inline variables in the module unit.
578578
The importable module unit has to emit the initializer even if there is no
579579
dynamic initialization; otherwise, the importer may call a nonexistent
580580
function. The initializer function emits calls to imported modules first
581-
followed by calls to all to of the dynamic initializers in the current module
581+
followed by calls to all of the dynamic initializers in the current module
582582
unit.
583583

584584
Translation units that explicitly or implicitly import a named module must call
@@ -689,17 +689,17 @@ ensure it is reachable, e.g. ``using N::g;``.
689689

690690
As of Clang 22.x, the Reduced BMI is enabled by default. You may still want to
691691
use Full BMI with ``-fno-modules-reduced-bmi`` in the following case:
692-
1. Your build system uses two-phase compilation but it haven't adjusted the
692+
1. Your build system uses two-phase compilation, but it hasn't adjusted the
693693
implementation for reduced BMI.
694-
2. You meet a regression with Reduced BMI that you cannot work around. Please
694+
2. You encounter a regression with Reduced BMI that you cannot work around. Please
695695
report an issue for this case.
696696

697697
Experimental Non-Cascading Changes
698698
----------------------------------
699699

700700
This section is primarily for build system vendors. For end compiler users,
701701
if you don't want to read it all, this is helpful to reduce recompilations.
702-
We encourage build system vendors and end users try this out and bring feedback.
702+
We encourage build system vendors and end users to try this out and bring feedback.
703703

704704
Before Clang 19, a change in BMI of any (transitive) dependency would cause the
705705
outputs of the BMI to change. Starting with Clang 19, changes to non-direct
@@ -786,7 +786,7 @@ We encourage build systems to add an experimental mode that
786786
reuses the cached BMI when **direct** dependencies did not change,
787787
even if **transitive** dependencies did change.
788788

789-
Given there are potential compiler bugs, we recommend that build systems
789+
Given that there are potential compiler bugs, we recommend that build systems
790790
support this feature as a configurable option so that users
791791
can go back to the transitive change mode safely at any time.
792792

@@ -813,7 +813,7 @@ With reduced BMI, non-cascading changes can be more powerful. For example,
813813
$ md5sum B.pcm
814814
6c2bd452ca32ab418bf35cd141b060b9 B.pcm
815815
816-
And let's change the implementation for ``A.cppm`` into:
816+
And let's change the implementation for ``A.cppm`` to:
817817

818818
.. code-block:: c++
819819

@@ -830,7 +830,7 @@ and recompile the example:
830830
$ md5sum B.pcm
831831
6c2bd452ca32ab418bf35cd141b060b9 B.pcm
832832
833-
We should find the contents of ``B.pcm`` remains the same. In this case, the build system is
833+
We should find the contents of ``B.pcm`` remain the same. In this case, the build system is
834834
allowed to skip recompilations of TUs which solely and directly depend on module ``B``.
835835

836836
This only happens with a reduced BMI. With reduced BMIs, we won't record the function body
@@ -845,7 +845,7 @@ Reduce duplications
845845

846846
While it is valid to have duplicated declarations in the global module fragments
847847
of different module units, it is not free for Clang to deal with the duplicated
848-
declarations. A translation unit will compile more slowly if there is a lot of
848+
declarations. A translation unit will compile more slowly if there are a lot of
849849
duplicated declarations between the translation unit and modules it imports.
850850
For example:
851851

@@ -937,7 +937,7 @@ possible. However, it may be a breaking change for existing code or libraries
937937
to switch to modules. As a result, many existing libraries need to provide
938938
both headers and module interfaces for a while to not break existing users.
939939

940-
This section suggests some suggestions on how to ease the transition process
940+
This section provides some suggestions on how to ease the transition process
941941
for existing libraries. **Note that this information is only intended as
942942
guidance, rather than as requirements to use modules in Clang.** It presumes
943943
the project is starting with no module-based dependencies.
@@ -1140,7 +1140,7 @@ module unit which is internal to the module itself.
11401140
Providing a header to skip parsing redundant headers
11411141
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11421142

1143-
Many redeclarations shared between translation units causes Clang to have
1143+
Many redeclarations shared between translation units cause Clang to have
11441144
slower compile-time performance. Further, there are known issues with
11451145
`include after import <https://github.com/llvm/llvm-project/issues/61465>`_.
11461146
Even when that issue is resolved, users may still get slower compilation speed
@@ -1408,8 +1408,8 @@ P1857R3 is implemented. This is tracked by
14081408
Until then, it is recommended not to mix macros with module declarations.
14091409

14101410

1411-
In consistent filename suffix requirement for importable module units
1412-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1411+
Inconsistent filename suffix requirement for importable module units
1412+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14131413

14141414
Currently, Clang requires the file name of an ``importable module unit`` to
14151415
have ``.cppm`` (or ``.ccm``, ``.cxxm``, ``.c++m``) as the file extension.
@@ -1484,7 +1484,7 @@ How to build projects using header units
14841484
.. warning::
14851485

14861486
The support for header units, including related command line options, is
1487-
experimental. There are still many unanswered question about how tools
1487+
experimental. There are still many unanswered questions about how tools
14881488
should interact with header units. The details described here may change in
14891489
the future.
14901490

@@ -1881,7 +1881,7 @@ Individual command line options can be specified after ``--``.
18811881
options. Note that the path to the compiler executable needs to be specified
18821882
explicitly instead of using ``clang++`` directly.
18831883

1884-
Users may want the scanner to get the transitional dependency information for
1884+
Users may want the scanner to get the transitive dependency information for
18851885
headers. Otherwise, the project has to be scanned twice, once for headers and
18861886
once for modules. To address this, ``clang-scan-deps`` will recognize the
18871887
specified preprocessor options in the given command line and generate the
@@ -1912,7 +1912,7 @@ Possible Issues: Failed to find system headers
19121912

19131913
If encountering an error like ``fatal error: 'stddef.h' file not found``,
19141914
the specified ``<path-to-compiler-executable>/clang++`` probably refers to a
1915-
symlink instead a real binary. There are four potential solutions to the
1915+
symlink instead of a real binary. There are four potential solutions to the
19161916
problem:
19171917

19181918
1. Point the specified compiler executable to the real binary instead of the

0 commit comments

Comments
 (0)