summaryrefslogtreecommitdiff
path: root/clang/docs/StandardCPlusPlusModules.rst
AgeCommit message (Collapse)Author
2025-08-19[clang] Proofread StandardCPlusPlusModules.rst (#154474)Kazu Hirata
2025-07-21Fix indendation in StandardCPlusPlusModules.rst (#149901)Devon Loehr
The CI is complaining about unexpected indentation. It seems multiple-line list entries must start at the beginning of each line.
2025-07-21[C++20] [Modules] Enable reduced BMI by defaultChuanqi Xu
As documented in 20.x, we'd like to keep reduced BMI off by default for 1~2 versions. And now we're in 22.x. I rarely receive bug reports for reduced BMI. I am not sure about the reason. Maybe not a lot of people are using it. Or it is really stable enough. And also, we've been enabling the reduced BMI internally for roughly half a year. So I think it's the time to move on. See the document changes for other information.
2025-05-16[clang] Fix typos in documentation (#140211)Kazu Hirata
2025-04-23[docs] Fix the use of word "dependent" and other typos in the C++ Modules ↵Arseniy Zaostrovnykh
Doc (#136719) "Dependant BMI" / "Dependent BMI" was used incorrectly in the documentation: "Dependent BMI" refers to a BMI that depends on the current TU, but it was used for the BMI that current TU depends on. I replaced all the mentions with "BMI dependency".
2025-02-17Revert "[clang][Modules] Remove a resloved issue from ↵Haojian Wu
StandardCPlusPlusModules.rst" This reverts commit 82dc2d403066a84ef0051b06f1d179e00331f319. The fix has been reverted in f63e8ed16ef1fd2deb80cd88b5ca9d5b631b1c36
2025-02-17[clang][Modules] Remove a resloved issue from StandardCPlusPlusModules.rstHaojian Wu
The issue has been fixed in https://github.com/llvm/llvm-project/pull/122726
2024-12-10[C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to ↵Chuanqi Xu
'-fmodules-reduced-bmi' (#114382) According to our previous consensus in https://clang.llvm.org/docs/StandardCPlusPlusModules.html#reduced-bmi, the reduced BMI will be the default and recommend users to use the new option. The `-fexperimental-modules-reduced-bmi ` option is introduced in https://github.com/llvm/llvm-project/pull/85050 in Mar13 and released in 19.x. And now we are in 20's release cycle. Also I rarely receive issue reports about reduced BMI. No matter it is due to the quality of reduced BMI is really good or no one uses it. This patch literally did the second point in https://clang.llvm.org/docs/StandardCPlusPlusModules.html#reduced-bmi
2024-09-20[C++20] [Modules] Offer -fmodules-embed-all-files option (#107194)Chuanqi Xu
See https://discourse.llvm.org/t/rfc-modules-should-we-embed-sources-to-the-bmi/81029 for details. Close https://github.com/llvm/llvm-project/issues/72383
2024-08-26[doc] [C++20] [Modules] Add docs and release notes for ↵Chuanqi Xu
'-Wdecls-in-multiple-modules' As the title shows.
2024-08-22[clang][NFC] remove resolved issue from StandardCPlusPlusModules.rst (#105610)h-vetinari
This landed as https://github.com/llvm/llvm-project/pull/102287 for main & https://github.com/llvm/llvm-project/pull/102561 for 19.x CC @ChuanqiXu9
2024-08-13[Doc] [C++20] [Modules] Clarify the reachability of internal partition units ↵Chuanqi Xu
(#102572) Motivated by https://github.com/llvm/llvm-project/issues/101348 Although I don't want the tool's doc to explain the standard's wording, the wording itself has some unspecified thing. So I feel it will be helpful to make it clear. At least it may help us receive less invalid issue reports.
2024-08-06[clang][driver][clang-cl] Support `--precompile` and `-fmodule-*` options in ↵Sharadh Rajaraman
Clang-CL (#98761) This PR is the first step in improving the situation for `clang-cl` detailed in [this LLVM Discourse thread](https://discourse.llvm.org/t/clang-cl-exe-support-for-c-modules/72257/28). There has been some work done in #89772. I believe this is somewhat orthogonal. This is a work-in-progress; the functionality has only been tested with the [basic 'Hello World' example](https://clang.llvm.org/docs/StandardCPlusPlusModules.html#quick-start), and proper test cases need to be written. I'd like some thoughts on this, thanks! Partially resolves #64118.
2024-07-19[Doc] Update documentation for no-transitive-change (#96453)Chuanqi Xu
(Some backgrounds, not required to read: https://discourse.llvm.org/t/rfc-c-20-modules-introduce-thin-bmi-and-decls-hash/74755) This is the document part for the no-transitive-change (https://github.com/llvm/llvm-project/pull/86912, https://github.com/llvm/llvm-project/pull/92083, https://github.com/llvm/llvm-project/pull/92085, https://github.com/llvm/llvm-project/pull/92511) to provide the ability for build system to skip some unnecessary recompilations. See the patch for examples.
2024-07-10[docs] [C++20] [Modules] Add a workaround document for missing vtablesChuanqi Xu
Due to https://github.com/llvm/llvm-project/pull/75912 is reverted and https://github.com/llvm/llvm-project/issues/70585 is reopened. It looks riskful to fix the issue correctly before 19. So we provide a workaround here to help people in this trouble as much as possible.
2024-05-08Revise the modules document for clarity (#90237)Aaron Ballman
The intention isn't to add or change the information provided, but to improve clarity through some grammar fixes, improvements to the markdown, and so forth.
2024-04-18[docs] [C++20] [Modules] Mentioning Module InitializerChuanqi Xu
Although we want to treat the module initializer as a transparent concept to users, but it shows that people need to understand the concept to understand how to understand and distribute modules. So it is better to mention this too.
2024-04-17[C++20] [Modules] Add Release Notes and Documents for Reduced BMIChuanqi Xu
See https://discourse.llvm.org/t/rfc-c-20-modules-introduce-thin-bmi-and-decls-hash/74755, https://github.com/llvm/llvm-project/pull/75894 and https://github.com/llvm/llvm-project/pull/85050 for the background.
2024-02-23[NFC] [doc] Mentioning to include the guard headers from imported modulesChuanqi Xu
2024-02-20[docs] [C++20] [Modules] Ideas for transitioning to modules (#80687)Chuanqi Xu
This patch tries to provide some ideas to transform an existing libraries to modules. I feel this is helpful for users who is interested in modules from my observation. While the syntax of modules look easy to understand, the practice gets harder if the users want to make compatible work with headers. Especially the `std` module can be installed in clang18, I think such document may be helpful. I tried to not be too wordy in this document and I don't want the users to have impressions that they have to follow this or this is the best practice. So I tried to use the term `idea` imply the users this is not compulsory. I add some regular reviewers for modules, but review opinions from users are highly recommended. I want to land this before the releasing of clang18 (in the early March). We can and should improve this continuously.
2024-02-01[C++20] [Modules] Introduce -fskip-odr-check-in-gmf (#79959)Chuanqi Xu
Close https://github.com/llvm/llvm-project/issues/79240 Cite the comment from @mizvekov in //github.com/llvm/llvm-project/issues/79240: > There are two kinds of bugs / issues relevant here: > > Clang bugs that this change hides > Here we can add a Frontend flag that disables the GMF ODR check, just > so > we can keep tracking, testing and fixing these issues. > The Driver would just always pass that flag. > We could add that flag in this current issue. > Bugs in user code: > I don't think it's worth adding a corresponding Driver flag for > controlling the above Frontend flag, since we intend it's behavior to > become default as we fix the problems, and users interested in testing > the more strict behavior can just use the Frontend flag directly. This patch follows the suggestion: - Introduce the CC1 flag `-fskip-odr-check-in-gmf` which is by default off, so that the every existing test will still be tested with checking ODR violations. - Passing `-fskip-odr-check-in-gmf` in the driver to keep the behavior we intended. - Edit the document to tell the users who are still interested in more strict checks can use `-Xclang -fno-skip-odr-check-in-gmf` to get the existing behavior.
2024-01-24[docs] [C++20] [Modules] Document how to import modules in clang-replChuanqi Xu
We support to import C++20 named modules now in in clang-repl in https://github.com/llvm/llvm-project/commit/dd3e6c87f3f4affd17d05a4d25fa77d224a98d94. Then we should document how can we do that.
2024-01-22[docs] Update StandardCPlusPlusModules.rst with clang18Chuanqi Xu
Changed Things: - Mentioning we need to specify BMIs for indirectly dependent BMIs too. - Remove the note for `delayed-template-parsing` since https://github.com/llvm/llvm-project/issues/61068 got closed. - Add a note for https://github.com/llvm/llvm-project/issues/78850 since we've seen it for a lot of times. - Add a note for https://github.com/llvm/llvm-project/issues/78173 since we've seen it for a lot of times.
2024-01-12[docs] Update doc for C++20 Modules after dc4e85bChuanqi Xu
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.
2023-10-30[docs] [C++20] [Modules] Add document for the case of duplicated ↵Chuanqi Xu
'-fmodule-file=<module-name>=' This patch clarifies that in case there are multiple '-fmodule-file=<module-name>=' optins for the same `<module-name>`, the last '-fmodule-file=<module-name>=' will override the previous '-fmodule-file=<module-name>=' option.
2023-10-16[docs] [C++20] [Modules] Mentioning that -fdelayed-template-parsing is not ↵Chuanqi Xu
working with modules Catched in https://github.com/llvm/llvm-project/issues/61068. Add this to the document to avoid further misunderstandings.
2023-08-23[clang][doc] Mentions -Wno-reserved-module-identifiersMark de Wever
This is a nicer way to suppress the diagnostic instead of using the pre-processor work-around. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D158523
2023-08-11[NFC] Document the solution to pr61006 and a test for itChuanqi Xu
Address https://github.com/llvm/llvm-project/issues/61006. The actual reason for the issue is about the usage of clang-scan-deps instead of its functionalities since clang-scan-deps has already considered the problem before for clang modules. So this patch tries to document the corresponding solution and add a test case for it to address the issue.
2023-07-26[docs] [C++20] [Modules] Mark the compatiblity issue within clang-cl.exeChuanqi Xu
See https://discourse.llvm.org/t/clang-cl-exe-support-for-c-modules/72257 for details. Simply, the user of clang-cl.exe can't get a good experience with C++20 modules now. While we don't have resources to support it well now, we should make it clear in the documentation.
2023-07-19[NFC] Add a blank line after directives in StandardCPlusPlusModules.rstChuanqi Xu
2023-07-19[NFC] [C++20] [Modules] Add a performance tip to the documentChuanqi Xu
It is a known problem that the compiler isn't efficiency when there are a lot of duplications in the modules to developers. But it may not be verbose to the (potential) new users of C++20 modules. It may be necessary to mention this in the document.
2023-06-26[clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docsNikolas Klauser
A lot of editors remove trailing whitespaces. This patch removes any trailing whitespaces and makes sure that no new ones are added. Reviewed By: erichkeane, paulkirth, #libc, philnik Spies: wangpc, aheejin, MaskRay, pcwang-thead, cfe-commits, libcxx-commits, dschuff, nemanjai, arichardson, kbarton, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, s.egerton, sameer.abuasal, apazos, luismarques, martong, frasercrmck, steakhal, luke Differential Revision: https://reviews.llvm.org/D151963
2023-05-12[clang] Fix typos in documentationKazu Hirata
2023-05-10[docs] [C++20] [Modules] Remove the section 'Source content consistency'Chuanqi Xu
Since the C++20 named modules won't check source files consistency after 5b388f8, it would be better to remove this section in the document.
2023-05-04[clang] Use -std=c++23 instead of -std=c++2bMark de Wever
During the ISO C++ Committee meeting plenary session the C++23 Standard has been voted as technical complete. This updates the reference to c++2b to c++23 and updates the __cplusplus macro. Drive-by fixes c++1z -> c++17 and c++2a -> c++20 when seen. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D149553
2023-04-21[doc] [C++20] [Modules] Document that the interfaces of header units is ↵Chuanqi Xu
experimental Close https://github.com/llvm/llvm-project/issues/62241 In tooling group (SG15), it is still unclear how tools should support header units. Add a warning in the documentation to avoid further confusions.
2023-03-28[C++20] [Modules] Don't create duplicated deduction guides for duplicated ↵Chuanqi Xu
classes Close https://github.com/llvm/llvm-project/issues/56916 Within C++20 modules, we may have multiple same constructors in multiple same RecordDecls. And it doesn't make sense naturally to create duplicated deduction guides for the duplicated constructors.
2023-03-17[Modules] [doc] Document the problem that we can't include headers before ↵Chuanqi Xu
import declarations
2023-03-13[doc] [Modules] Document how to implement ABI compatible code in module unitsChuanqi Xu
2023-03-09[doc] Deprecate the '-fmodule-file=<module-name>=<path-BMI>' for named ↵Chuanqi Xu
modules in the document The option '-fmodule-file=<module-name>=<path-BMI>' is already deprecated now. This patch mentions it in the document.
2023-02-28[clang] Documents clang-scan-deps requirements.Mark de Wever
This was discussed in https://llvm.org/PR61006. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D144894
2023-02-22[clang][doc] Removes obsolete comment.Mark de Wever
After reading about the documentation improvements on LLVM weekly this part seems obsolete. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D144497
2023-02-14[docs] Add document for clang-scan-deps -format=p1689Chuanqi Xu
The patches for `clang-scan-deps` have been landed. And we need to document the behavior then.
2023-02-08[C++20] [Modules] Allow -fmodule-file=<module-name>=<BMI-Path> for ↵Chuanqi Xu
implementation unit and document the behavior Close https://github.com/llvm/llvm-project/issues/57293. Previsouly we can't use `-fmodule-file=<module-name>=<BMI-Path>` for implementation units, it is a bug. Also the behavior of the above option is not tested nor documented for C++20 Modules. This patch addresses the 2 problems.
2023-01-22[clang][doc] Fixes formatting of a text block.Mark de Wever
2023-01-16Add Release Notes and Doc for -fmodule-outputChuanqi Xu
As the summary explained in https://reviews.llvm.org/D137058, the design of `-fmodule-output` changes relatively frequently so I skipped the release notes and docs for -fmodule-output in the the patches. And the patches get accepted and landed. The patch adds the related release notes and docs.
2022-11-15[NFC] Fix the typo and the format in the StandardCPlusPlusModulesChuanqi Xu
document
2022-11-10[C++20] [Modules] Document the behavior about reserved module namesChuanqi Xu
We would diagnose about the reserved names in b8ceb9f4e4bd. And the patch documents about the related behaviors.
2022-10-31[docs] Add the description about mixing use of clang modules and c++Chuanqi Xu
modules From the discussion in https://discourse.llvm.org/t/how-should-we-support-dependency-scanner-for-c-20-modules/66027, we get a consensus that we want to support clang modules and c++ modules at the same time. This patch documents this intention. Reviewed By: bruno Differential Revision: https://reviews.llvm.org/D136221
2022-09-05[NFC] fix incorrect indentation in docsChuanqi Xu