[PATCH] D148088: [RFC][clangd] Move preamble index task to a seperate task

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 27 07:55:08 PDT 2023


ilya-biryukov added a comment.

> We would like to move the preamble index out of the critical path

Could you provide motivation why you need to do it? What is the underlying problem that this change is trying to solve?
We rely on preamble being indexed at that particular time for correct results in future steps, it's definitely not a no-op change even if the threading issues are resolved (see the other comment).



================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:88
+    if (PreambleIndexTask)
+      PreambleIndexTask->runAsync("task:" + Path + Version,
+                                  std::move(Task));
----------------
This definitely does not work. After `onPreambleAST` returns, the AST will be destroyed and async tasks may access it afterwards.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148088



More information about the cfe-commits mailing list