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

Aleksandr Platonov via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 07:39:11 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();
----------------
ArcsinX wrote:

Sorry, I gave your the wrong suggestion here. getValue() returns the option value (e.g. for `--foo=bar` it gives `bar`)

It looks like we can use getAsString(). Usage example can be found here https://github.com/llvm/llvm-project/blob/main/llvm/lib/Option/OptTable.cpp#L599

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


More information about the cfe-commits mailing list