[clang-tools-extra] [clangd][modules] Remove the options that is for gcc, make modules work for clangd when using gcc (PR #200001)

Ben Boeckel via cfe-commits cfe-commits at lists.llvm.org
Sat May 30 15:56:08 PDT 2026


================
@@ -327,6 +327,21 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
     return Elem.starts_with("--save-temps") || Elem.starts_with("-save-temps");
   });
 
+  llvm::erase_if(Cmd, [](llvm::StringRef FModuleTs) {
+    return FModuleTs == "-fmodules-ts";
+  });
+
+  llvm::erase_if(Cmd, [](llvm::StringRef MnoDirectExternalAccess) {
+    return MnoDirectExternalAccess == "-mno-direct-extern-access";
+  });
+
+  llvm::erase_if(Cmd, [](llvm::StringRef FDepFormat) {
+    return FDepFormat.starts_with("-fdeps-format");
----------------
mathstuf wrote:

Probably want the trailing `=` here like `-fmodule-mapper=`.

Also, there are `-fdeps-output=` and `-fdeps-target=` flags. However, IIUC, `clang` intends to move scanning into the frontend and the plan AFAIK is to use the same `-fdeps-*` flags as GCC, so these removals should be removed once they're understood again.

Cc: @Bigcheese (not sure who else is working on that)

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


More information about the cfe-commits mailing list