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

Daniel Ruoso via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 08:29:27 PDT 2022


ruoso added inline comments.


================
Comment at: clang/docs/CPlusPlus20Modules.rst:225
+
+It is possible to generate a module file for an importable module unit by specifying the ``--precompile`` option.
+
----------------
Likewise, here the term "Built Module Interface file", with the acronym "BMI" is what we're generally using when talking about the generated file.


================
Comment at: clang/docs/CPlusPlus20Modules.rst:238
+
+If the file names use different extensions, Clang may fail to build the module.
+
----------------
Is that actually true? Or does it require explicit arguments to explain how the compiler needs to translate the file?


================
Comment at: clang/docs/CPlusPlus20Modules.rst:243-244
+
+The option ``-fprebuilt-module-interface`` tells the compiler the path where to search for dependent module files.
+It may be used multiple times just like ``-I`` for specifying paths for header files.
+
----------------
Is that the case for C++20 named modules as well? I thought this was just for clang modules. How does the lookup work?


================
Comment at: clang/docs/CPlusPlus20Modules.rst:250-253
+When we compile a ``module implementation unit``, we must pass the module file of the corresponding
+``primary module interface unit`` by ``-fmodule-file``.
+Again, this option may occur multiple times. For example, the command line to compile ``M.cppm`` in
+the above example could be rewritten into:
----------------
I wonder if it's easier to explain that a module implementation unit implicitly imports the primary module interface unit, and therefore it needs the BMI for that interface to be provided, just like it's the case for every other import statement.


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

https://reviews.llvm.org/D131388



More information about the cfe-commits mailing list