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

>From 280b5464c742817530c6ca22637e1ad9c906ddc2 Mon Sep 17 00:00:00 2001
From: ShootingStarDragons <[email protected]>
Date: Thu, 28 May 2026 00:16:49 +0900
Subject: [PATCH] feat: allow modules work for gcc

Remove the command options which is for gcc, and this will erase the
wrong error when using gcc, and make modules work
---
 clang-tools-extra/clangd/CompileCommands.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/clang-tools-extra/clangd/CompileCommands.cpp 
b/clang-tools-extra/clangd/CompileCommands.cpp
index 4eda330716f21..80b9cb24a5f00 100644
--- a/clang-tools-extra/clangd/CompileCommands.cpp
+++ b/clang-tools-extra/clangd/CompileCommands.cpp
@@ -327,6 +327,16 @@ 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 FDepFormat) {
+    return FDepFormat.starts_with("-fdeps-format");
+  });
+  llvm::erase_if(Cmd, [](llvm::StringRef Elm) {
+    return Elm.starts_with("-fmodule-mapper=");
+  });
+
   std::vector<std::string> ToAppend;
   if (ResourceDir && !HasExact("-resource-dir") && 
!HasPrefix("-resource-dir="))
     ToAppend.push_back(("-resource-dir=" + *ResourceDir));

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to