[clang] [clang] C++20 Modules: document how to perform automated reductions (PR #124997)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 29 16:38:04 PST 2025


https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124997

>From 087997a38f4c64f7c305142ca630777d35b6a126 Mon Sep 17 00:00:00 2001
From: Matheus Izvekov <mizvekov at gmail.com>
Date: Wed, 29 Jan 2025 19:34:24 -0300
Subject: [PATCH] [clang] C++20 Modules: document how to perform automated
 reductions

---
 clang/docs/StandardCPlusPlusModules.rst | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/clang/docs/StandardCPlusPlusModules.rst b/clang/docs/StandardCPlusPlusModules.rst
index 93edce0cf90b76e..c209bc0cc192485 100644
--- a/clang/docs/StandardCPlusPlusModules.rst
+++ b/clang/docs/StandardCPlusPlusModules.rst
@@ -710,7 +710,7 @@ Before Clang 19, a change in BMI of any (transitive) dependency would cause the
 outputs of the BMI to change. Starting with Clang 19, changes to non-direct
 dependencies should not directly affect the output BMI, unless they affect the
 results of the compilations. We expect that there are many more opportunities
-for this optimization than we currently have realized and would appreaciate 
+for this optimization than we currently have realized and would appreciate
 feedback about missed optimization opportunities. For example,
 
 .. code-block:: c++
@@ -2072,3 +2072,25 @@ Interoperability with Clang Modules
 We **wish** to support Clang modules and standard C++ modules at the same time,
 but the mixing them together is not well used/tested yet. Please file new
 GitHub issues as you find interoperability problems.
+
+Finding reduced test cases
+--------------------------
+
+When the user encounters a problem with the implementation of standard modules,
+it's helpful to attach a reduced test case to the issue report.
+
+This reduction is hard, as it can't avoid the dependency on multiple files,
+unlike most issues which can be reproduced within a single translation unit.
+
+If you are familiar with performing automated reductions using tools like
+c-reduce, you can use `cvise <https://github.com/marxin/cvise>`_ to accomplish this
+reduction.
+
+Much in the same way as creduce, cvise takes an interestingness test
+in addition to the source code. In the latter case, you can create an
+interestingness test which uses your project's build system to perform
+the build part, and cvise will accept multiple source files or directories,
+and will take turns reducing each, which is something creduce does not support.
+
+Be aware that this can be highly compute intensive, but on the upside no manual
+intervention is required.



More information about the cfe-commits mailing list