[PATCH] D134269: [docs] Document the one-phase style compilation to c++ standard modules

Tom Honermann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 10:12:15 PDT 2022


tahonermann added inline comments.


================
Comment at: clang/docs/StandardCPlusPlusModules.rst:228-229
+
+Also if when we compile an importable module unit to an object file,
+the compiler will generate the corresponding BMI implicitly.
+
----------------
When an importable module unit is compiled to an object file,
a corresponding BMI is implicitly generated.


================
Comment at: clang/docs/StandardCPlusPlusModules.rst:233-234
+
+* (1) If the name of the BMI is specified by `-fmodule-bmi-output={BMI-destination-path}` flag,
+  `{BMI-destination-path}` will be the destination for the implicitly generated BMI.
+* (2) If the name of the BMI is not specified, the file name of the BMI will be
----------------
* (1) If a file name is specified with the `-fmodule-bmi-output={BMI-destination-path}` option,
  then the BMI will be written to `{BMI-destination-path}`.



================
Comment at: clang/docs/StandardCPlusPlusModules.rst:235-237
+* (2) If the name of the BMI is not specified, the file name of the BMI will be
+  the same with the name with source file except with the different suffix `.pcm`.
+  For example, if the source file is `M.cppm`, then the name of the implicitly
----------------
tahonermann wrote:
> * (2) Otherwise, the BMI will be written to a file within the module cache with a name constructed from the source file name with a `.pcm` extension.
>   For example, if the source file is `M.cppm`, then the BMI will be implicitly written to a file named `M.pcm` in the module cache.
>   See :ref:`Module Cache Path<Module Cache Path>` for the rules about the module cache.
> 
What happens if the source file name does not have an extension? E.g., for `clang -c -std=c++20 -xc++-module file`?


================
Comment at: clang/docs/StandardCPlusPlusModules.rst:235-239
+* (2) If the name of the BMI is not specified, the file name of the BMI will be
+  the same with the name with source file except with the different suffix `.pcm`.
+  For example, if the source file is `M.cppm`, then the name of the implicitly
+  generated BMI in this manner will be `M.pcm`. And the BMI will live in the module cache.
+  See :ref:`Module Cache Path<Module Cache Path>` for the rules about the module cache.
----------------
* (2) Otherwise, the BMI will be written to a file within the module cache with a name constructed from the source file name with a `.pcm` extension.
  For example, if the source file is `M.cppm`, then the BMI will be implicitly written to a file named `M.pcm` in the module cache.
  See :ref:`Module Cache Path<Module Cache Path>` for the rules about the module cache.



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

https://reviews.llvm.org/D134269



More information about the cfe-commits mailing list