[PATCH] D108119: Wiring of standard library indexing into clangd.

Christian Kühnel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 17 04:03:23 PDT 2021


kuhnel added inline comments.


================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:180
+  if (Opts.IndexStandardLibrary) {
+    auto SLIndex = indexStandardLibrary(TFS);
+    if (!SLIndex || !SLIndex->get()) {
----------------
I'm not sure if returning a Expected<T> makes sense here. I suppose logging could be done from StandardLibraryIndex just as well.



================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:184
+    }
+    AddIndex(SLIndex->get());
+  }
----------------
sammccall wrote:
> this pointer will dangle after the `if` block finishes (the local `auto` owns the index)
Ah yes, you're right. The other indexes are kept in member variables...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108119



More information about the cfe-commits mailing list