[PATCH] D143436: [clangd] Apply standard adaptors to CDBs pushed from LSP

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 16 08:47:36 PST 2023


nridge added inline comments.


================
Comment at: clang-tools-extra/clangd/CompileCommands.cpp:222
+  tooling::addExpandedResponseFiles(Cmd, Command.Directory, Tokenizer, *FS);
+  tooling::addTargetAndModeForProgramName(Cmd, Cmd.front());
   auto &OptTable = clang::driver::getDriverOptTable();
----------------
nridge wrote:
> The target needs to be added **after** the call to `SystemIncludeExtractor` later in this function (this is what D138546 is trying to fix). The reason is that `SystemIncludeExtractor` includes any `--target` flag in the compiler driver being queried for system includes, which may be gcc, which does not support `--target`.
(I guess we could make that change separately in D138546, but if we're changing the place where the `--target` is added in this patch, I figure we might as well move it directly to the desired place.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143436/new/

https://reviews.llvm.org/D143436



More information about the cfe-commits mailing list