Author: Chuanqi Xu Date: 2024-01-12T14:16:19+08:00 New Revision: 4b99af34199208e82f6a8806bfae1d3dea007936
URL: https://github.com/llvm/llvm-project/commit/4b99af34199208e82f6a8806bfae1d3dea007936 DIFF: https://github.com/llvm/llvm-project/commit/4b99af34199208e82f6a8806bfae1d3dea007936.diff LOG: [docs] Update doc for C++20 Modules after dc4e85b After https://github.com/llvm/llvm-project/commit/dc4e85bd79ff17014cbbe4a9db1d9b91929e91ce, we need to update the examples in the documents. This patch also fix some other places where is no longer relevant. Added: Modified: clang/docs/StandardCPlusPlusModules.rst Removed: ################################################################################ diff --git a/clang/docs/StandardCPlusPlusModules.rst b/clang/docs/StandardCPlusPlusModules.rst index 49704575740303..22d506f0da2b10 100644 --- a/clang/docs/StandardCPlusPlusModules.rst +++ b/clang/docs/StandardCPlusPlusModules.rst @@ -143,7 +143,7 @@ Then we type: .. code-block:: console $ clang++ -std=c++20 Hello.cppm --precompile -o Hello.pcm - $ clang++ -std=c++20 use.cpp -fprebuilt-module-path=. Hello.pcm -o Hello.out + $ clang++ -std=c++20 use.cpp -fmodule-file=Hello=Hello.pcm Hello.pcm -o Hello.out $ ./Hello.out Hello World! @@ -200,15 +200,15 @@ Then we are able to compile the example by the following command: $ clang++ -std=c++20 interface_part.cppm --precompile -o M-interface_part.pcm $ clang++ -std=c++20 impl_part.cppm --precompile -fprebuilt-module-path=. -o M-impl_part.pcm $ clang++ -std=c++20 M.cppm --precompile -fprebuilt-module-path=. -o M.pcm - $ clang++ -std=c++20 Impl.cpp -fmodule-file=M=M.pcm -c -o Impl.o + $ clang++ -std=c++20 Impl.cpp -fprebuilt-module-path=. -c -o Impl.o # Compiling the user $ clang++ -std=c++20 User.cpp -fprebuilt-module-path=. -c -o User.o # Compiling the module and linking it together - $ clang++ -std=c++20 M-interface_part.pcm -c -o M-interface_part.o - $ clang++ -std=c++20 M-impl_part.pcm -c -o M-impl_part.o - $ clang++ -std=c++20 M.pcm -c -o M.o + $ clang++ -std=c++20 M-interface_part.pcm -fprebuilt-module-path=. -c -o M-interface_part.o + $ clang++ -std=c++20 M-impl_part.pcm -fprebuilt-module-path=. -c -o M-impl_part.o + $ clang++ -std=c++20 M.pcm -fprebuilt-module-path=. -c -o M.o $ clang++ User.o M-interface_part.o M-impl_part.o M.o Impl.o -o a.out We explain the options in the following sections. @@ -218,7 +218,6 @@ How to enable standard C++ modules Currently, standard C++ modules are enabled automatically if the language standard is ``-std=c++20`` or newer. -The ``-fmodules-ts`` option is deprecated and is planned to be removed. How to produce a BMI ~~~~~~~~~~~~~~~~~~~~ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits