[PATCH] D131569: [clangd] Allow updates to be canceled after compile flags retrieval
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 10 07:35:09 PDT 2022
kadircet created this revision.
kadircet added a reviewer: ilya-biryukov.
Herald added subscribers: usaxena95, arphaman, javed.absar.
Herald added a project: All.
kadircet requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang-tools-extra.
Retrieving compile flags might invalidate the environment of an update
request (e.g. generating build artifacts that wasn't captured at the time of
AddDocument notification). This enables clients with such behavior to optimize
away these intermediate AST builds.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D131569
Files:
clang-tools-extra/clangd/TUScheduler.cpp
Index: clang-tools-extra/clangd/TUScheduler.cpp
===================================================================
--- clang-tools-extra/clangd/TUScheduler.cpp
+++ clang-tools-extra/clangd/TUScheduler.cpp
@@ -894,6 +894,14 @@
FileInputs = Inputs;
}
+ if (isCancelled()) {
+ log("ASTWorker skipping update {0} for file {1}", Inputs.Version,
+ FileName);
+ // Don't even emplace a preamble, as we still want the first valid update
+ // to block any further reads.
+ return;
+ }
+
log("ASTWorker building file {0} version {1} with command {2}\n[{3}]\n{4}",
FileName, Inputs.Version, Inputs.CompileCommand.Heuristic,
Inputs.CompileCommand.Directory,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131569.451453.patch
Type: text/x-patch
Size: 719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220810/289df0c6/attachment.bin>
More information about the cfe-commits
mailing list