[clang-tools-extra] 036a1b2 - [clangd] Always run preamble indexing on a separate thread

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 23:51:09 PDT 2023


Author: Kadir Cetinkaya
Date: 2023-07-19T08:48:14+02:00
New Revision: 036a1b2202cb71aacfa72ef15145a88dc50a02cf

URL: https://github.com/llvm/llvm-project/commit/036a1b2202cb71aacfa72ef15145a88dc50a02cf
DIFF: https://github.com/llvm/llvm-project/commit/036a1b2202cb71aacfa72ef15145a88dc50a02cf.diff

LOG: [clangd] Always run preamble indexing on a separate thread

This has been the default in our production setup for weeks now,
showing great improvements to latency and no problems around stability or
correctness of the results.

Differential Revision: https://reviews.llvm.org/D155619

Added: 
    

Modified: 
    clang-tools-extra/clangd/ClangdServer.cpp
    clang-tools-extra/clangd/ClangdServer.h

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index 1451adcbf4d4fe..52731222ed8264 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -94,7 +94,7 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
                              ASTCtx.getPreprocessor(), *CanonIncludes);
     };
 
-    if (Opts.AsyncPreambleIndexing && Tasks) {
+    if (Tasks) {
       Tasks->runAsync("Preamble indexing for:" + Path + Version,
                       std::move(Task));
     } else

diff  --git a/clang-tools-extra/clangd/ClangdServer.h b/clang-tools-extra/clangd/ClangdServer.h
index 88b6d2f11d9a0b..2bc8f02ff38a4b 100644
--- a/clang-tools-extra/clangd/ClangdServer.h
+++ b/clang-tools-extra/clangd/ClangdServer.h
@@ -185,10 +185,6 @@ class ClangdServer {
     /// regions in the document.
     bool PublishInactiveRegions = false;
 
-    /// Whether to run preamble indexing asynchronously in an independent
-    /// thread.
-    bool AsyncPreambleIndexing = false;
-
     explicit operator TUScheduler::Options() const;
   };
   // Sensible default options for use in tests.


        


More information about the cfe-commits mailing list