[clang-tools-extra] 92c0546 - Revert "[clangd] Always run preamble indexing on a separate thread"

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 01:38:38 PDT 2023


Author: Kadir Cetinkaya
Date: 2023-07-19T10:38:23+02:00
New Revision: 92c0546941190973e9201a08fa10edf27cb6992d

URL: https://github.com/llvm/llvm-project/commit/92c0546941190973e9201a08fa10edf27cb6992d
DIFF: https://github.com/llvm/llvm-project/commit/92c0546941190973e9201a08fa10edf27cb6992d.diff

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

This reverts commit 036a1b2202cb71aacfa72ef15145a88dc50a02cf.

Triggering failures under tsan, https://lab.llvm.org/buildbot/#/builders/131/builds/48349

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 763fea68360ac9..cbcc90258f34eb 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -93,7 +93,7 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
                              ASTCtx.getPreprocessor(), *CanonIncludes);
     };
 
-    if (Tasks) {
+    if (Opts.AsyncPreambleIndexing && 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 2bc8f02ff38a4b..88b6d2f11d9a0b 100644
--- a/clang-tools-extra/clangd/ClangdServer.h
+++ b/clang-tools-extra/clangd/ClangdServer.h
@@ -185,6 +185,10 @@ 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