[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
Sat Jun 6 00:11:22 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();
----------------
Decodetalkers wrote:

getValue return the const char* and getAsString return it as string. But I do not want to make a clone of the value, I can get the information after using llvm::join, so I do not need to clone the data here, I think it is safe to use the char * here

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


More information about the cfe-commits mailing list