[PATCH] D133756: [clangd] Introduce CompileCommandsAdjuster

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 13:10:35 PDT 2022


nridge added inline comments.


================
Comment at: clang-tools-extra/clangd/indexer/IndexerMain.cpp:150-151
       clang::tooling::ArgumentsAdjuster(
-          clang::clangd::CommandMangler::detect()));
+          [Mangler = std::shared_ptr<clang::clangd::CommandMangler>(
+               clang::clangd::CommandMangler::detect().release())](
+              const std::vector<std::string> &Args, llvm::StringRef File) {
----------------
tom-anders wrote:
> Just wondering, why do you need to convert to a shared_ptr here? Couldn't the lambda just take ownership of the unique_ptr?
ArgumentsAdjuster is a typedef for std::function which needs to be copyable, not move-only


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133756



More information about the cfe-commits mailing list