[PATCH] D56841: [clangd] Filter out plugin related flags.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 17 05:42:54 PST 2019


kadircet marked 3 inline comments as done.
kadircet added a comment.

It seems like the most relevant place in tooling is ArgumentsAdjuster as @ioeric pointed out. Happy to move it to there if @sammccall and @klimek agrees as well.

As a side note `ArgumentsAdjuster`s unfortunately causes a copy of the original command line arguments. Not sure how important this factor is compared to spinning up a compiler instance, just wanted to point it out.



================
Comment at: clangd/ClangdUnit.cpp:433
+    // <arbitrary-argument>
+    if (I + 4 < E && CommandLine[I] == "-Xclang" &&
+        (CommandLine[I + 1] == "-load" || CommandLine[I + 1] == "-plugin" ||
----------------
ilya-biryukov wrote:
> Maybe move this code into `ClangdServer::getCompileCommand` to keep **all** argument adjustments that we do in clangd in one place.
> We add `-resource-dir` there.
As mentioned in the change description, we also have a different compiler invocation in `BackgroundIndex` which is not aware of `ClangdServer::getCompileCommand`


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D56841





More information about the cfe-commits mailing list