[clang-tools-extra] [clangd] [C++20] [Modules] Don't reuse prebuilt module files on windows (PR #193426)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 21:08:51 PDT 2026


================
@@ -29,6 +29,23 @@ llvm::cl::opt<bool> DebugModulesBuilder(
                    "Remember to remove them later after debugging."),
     llvm::cl::init(false));
 
+// Disable reusing prebuilt module files on windows by default.
+// As clangd may lock these module files on windows to prevent
+// these module files to be updated by buiild system on windows.
+//
+// See https://github.com/clangd/clangd/issues/2497 for details.
+#ifdef _WIN32
+constexpr bool DisablePrebuiltModuleFileReuseDefault = true;
+#else
+constexpr bool DisablePrebuiltModuleFileReuseDefault = false;
+#endif
+
+llvm::cl::opt<bool> DisablePrebuiltModuleFileReuse(
+    "disable-prebuilt-module-file-reuse",
----------------
HighCommander4 wrote:

nit: I prefer flag names to have a positive directionality, i.e. `--enable-blah=true` in place of `--disable-blah=false`. This is easier to interpret (`--disable...=false` is a double negative that our brains need to cancel out).

https://github.com/llvm/llvm-project/pull/193426


More information about the cfe-commits mailing list