[clang] [clang][DependencyScanning] Reset options generated for named module compilations. (PR #161486)

Naveen Seth Hanig via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 13:02:19 PDT 2025


================
@@ -263,6 +263,10 @@ makeCommonInvocationForModuleBuild(CompilerInvocation CI) {
   // units.
   CI.getFrontendOpts().Inputs.clear();
   CI.getFrontendOpts().OutputFile.clear();
+  CI.getFrontendOpts().GenReducedBMI = false;
+  CI.getFrontendOpts().ModuleOutputPath.clear();
+  CI.getHeaderSearchOpts().ModulesSkipHeaderSearchPaths = false;
+  CI.getHeaderSearchOpts().ModulesSkipDiagnosticOptions = false;
----------------
naveen-seth wrote:

I hope I added the changes in the place you intended, but I wasn’t completely sure.

I didn’t reset the options that are explicitly set for the scanning optimizations:
https://github.com/llvm/llvm-project/blob/78c65545d4694e043b593e4cca7c7281a639247b/clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp#L496-L497

For the other two, I am not sure if they can have any effect when we’re not building a module, but it is probably safer.
https://github.com/llvm/llvm-project/blob/78c65545d4694e043b593e4cca7c7281a639247b/clang/lib/Tooling/DependencyScanning/DependencyScannerImpl.cpp#L389-L389

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


More information about the cfe-commits mailing list