Skip to content

Commit b54568d

Browse files
committed
[clang] C++20 Modules: document how to perform automated reductions
1 parent dddfd77 commit b54568d

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

clang/docs/StandardCPlusPlusModules.rst

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ Before Clang 19, a change in BMI of any (transitive) dependency would cause the
710710
outputs of the BMI to change. Starting with Clang 19, changes to non-direct
711711
dependencies should not directly affect the output BMI, unless they affect the
712712
results of the compilations. We expect that there are many more opportunities
713-
for this optimization than we currently have realized and would appreaciate
713+
for this optimization than we currently have realized and would appreciate
714714
feedback about missed optimization opportunities. For example,
715715

716716
.. code-block:: c++
@@ -2072,3 +2072,33 @@ Interoperability with Clang Modules
20722072
We **wish** to support Clang modules and standard C++ modules at the same time,
20732073
but the mixing them together is not well used/tested yet. Please file new
20742074
GitHub issues as you find interoperability problems.
2075+
2076+
Reducing test cases
2077+
-------------------
2078+
2079+
When the user encounters a problem with the implementation of standard modules,
2080+
it's helpful to attach a reduced test case to the issue report.
2081+
2082+
Reducing modules issues is complicated by the need to reduce multiple files at
2083+
the same time, unlike non-modules issues which can generally be reproduced within
2084+
a single translation unit.
2085+
2086+
If you are familiar with performing automated reductions using tools like
2087+
c-reduce, you can use `cvise <https://github.com/marxin/cvise>`_ to accomplish this
2088+
reduction.
2089+
2090+
Much in the same way as creduce, cvise takes an interestingness test
2091+
in addition to the source code. In the latter case, you can create an
2092+
interestingness test which uses your project's build system to perform
2093+
the build part, and cvise will accept multiple source files or directories,
2094+
and will take turns reducing each, which is something creduce does not support.
2095+
2096+
Be aware that this can be highly compute intensive, but on the upside no manual
2097+
intervention is required.
2098+
2099+
Some initial low-effort manual reduction might be helpful, such as removing unneeded
2100+
files and targets from the build, as cvise doesn't know what to prioritize in
2101+
order to reduce build times.
2102+
2103+
Setting up a build caching solution from within the interestingness test, such
2104+
as ccache, is helpful as well.

0 commit comments

Comments
 (0)