[PATCH] D82606: [clangd] Config: config struct propagated through Context

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 25 23:59:08 PDT 2020


kadircet added a comment.

Thanks, LGTM. Just a question around the order of config vs other mangling.



================
Comment at: clang-tools-extra/clangd/CompileCommands.cpp:187
+  // FIXME: remove const_cast once unique_function is const-compatible.
+  for (auto &Edit : const_cast<Config &>(Config::current()).CompileFlags.Edits)
+    Edit(Cmd);
----------------
what's the rationale behind applying this before any other mangling?

I can see that the rest of the mangling happens to make sure clangd works out-of-the-box for "more" users, so should be safe to apply as a final step.
But on the other hand, applying config after those would give the user full control over the final command, which I believe is equally important.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82606





More information about the cfe-commits mailing list