[PATCH] D131388: [docs] Add "Standard C++ Modules"

Bret Brown via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 05:59:47 PDT 2022


bbrown105 added a comment.

Nice writeup! I appreciate the work that went into this.



================
Comment at: clang/docs/StandardCPlusPlusModules.rst:27
+
+standard C++ Named modules
+==========================
----------------
Just matching the capitalization of the other sections and subsections.


================
Comment at: clang/docs/StandardCPlusPlusModules.rst:87
+``export module module_name:partition_name;``. The ``partition_name`` should be
+unique to the module.
+
----------------
This is a small tweak but it should clarify that using the same `partition_name` with entirely different `module_names` is fine.


================
Comment at: clang/docs/StandardCPlusPlusModules.rst:89
+
+A internal module partition unit is a module unit whose module declaration
+is ``module module_name:partition_name;``. The ``partition_name`` should be
----------------



================
Comment at: clang/docs/StandardCPlusPlusModules.rst:91
+is ``module module_name:partition_name;``. The ``partition_name`` should be
+unique to the module.
+
----------------



================
Comment at: clang/docs/StandardCPlusPlusModules.rst:243-244
+since ``--precompile`` option now would only run preprocessor, which is equal to `-E` now.
+If we still want the filename of an ``importable module unit`` ends with ``.cpp`` instead of ``.cppm``,
+we could put ``-x c++-module`` in front of the file. For example,
+
----------------
Is there a tracking issue to revise this choice? I seem to recall that we settled on recommending a different file extension, `*.ixx`, for at least primary module interface units.

We didn't really discuss extensions for other units, but maybe we should if different toolchains are going to have different expectations. Of course, build systems can work around this sort of thing. But if the expectation of clang is that, practically speaking, you'll probably be using a build system, maybe the docs should clarify as much. We could document that parts of this document are intended for people configuring or implementing build systems.

FYI @Bigcheese 


================
Comment at: clang/docs/StandardCPlusPlusModules.rst:744
+
+How module speed up compilation
+-------------------------------
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131388/new/

https://reviews.llvm.org/D131388



More information about the cfe-commits mailing list