[clang-tools-extra] [clangd][modules] Remove the options when driver detects that it was unsupported, and log them (PR #200001)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 07:54:16 PDT 2026


================
@@ -273,6 +273,21 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
       SawInput(Cmd[I]);
     Cmd.resize(DashDashIndex);
   }
+
+  llvm::SmallVector<const char *, 16> UnsupportedArgs;
+
+  for (auto *UnknownArg : ArgList.filtered(options::OPT_UNKNOWN)) {
+    unsigned Index = UnknownArg->getIndex();
+    const auto *Argument = UnknownArg->getValue();
+    UnsupportedArgs.push_back(Argument);
+    IndicesToDrop.push_back(Index);
+  }
+
+  if (!UnsupportedArgs.empty()) {
+    std::string UnsupportedArguments = llvm::join(UnsupportedArgs, ", ");
+    log("Warning: detected unsupported Flags {0}", UnsupportedArguments);
----------------
Decodetalkers wrote:

done, and now I also added the unit test, but I do not know if it will work..

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


More information about the cfe-commits mailing list