https://github.com/Decodetalkers updated https://github.com/llvm/llvm-project/pull/200001
>From 9486731fa1c984c27e40dff75c4a0dbee4b55bfe 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/clang-tools-extra/clangd/CompileCommands.cpp b/clang-tools-extra/clangd/CompileCommands.cpp index 4eda330716f21..130eb49c060eb 100644 --- a/clang-tools-extra/clangd/CompileCommands.cpp +++ b/clang-tools-extra/clangd/CompileCommands.cpp @@ -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"); + }); + 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
