[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
Mon Jun 8 08:45:38 PDT 2026


================
@@ -273,6 +273,21 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
       SawInput(Cmd[I]);
     Cmd.resize(DashDashIndex);
   }
+
+  llvm::SmallVector<const char *, 16> UnknownArgs;
+
+  for (auto *UnknownArg : ArgList.filtered(options::OPT_UNKNOWN)) {
+    unsigned Index = UnknownArg->getIndex();
+    const auto *Argument = UnknownArg->getValue();
+    UnknownArgs.push_back(Argument);
----------------
ArcsinX wrote:

`Argument` and `Index` variables are used only once, so we can remove these variables and use `getIndex()` and  `getValue()` return values directly in `push_back()` calls

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


More information about the cfe-commits mailing list