[PATCH] D77664: [clangd] Fix broken assertion
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 8 01:03:03 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG130dbf63ff12: [clangd] Fix broken assertion (authored by kadircet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77664/new/
https://reviews.llvm.org/D77664
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
@@ -795,7 +795,7 @@
// FIXME: It might be better to not reuse this AST. That way queued AST builds
// won't be required for diags.
llvm::Optional<std::unique_ptr<ParsedAST>> AST = IdleASTs.take(this);
- if (!AST) {
+ if (!AST || !InputsAreLatest) {
auto RebuildStartTime = DebouncePolicy::clock::now();
llvm::Optional<ParsedAST> NewAST = buildAST(
FileName, std::move(Invocation), CIDiags, Inputs, LatestPreamble);
@@ -817,8 +817,6 @@
});
AST = NewAST ? std::make_unique<ParsedAST>(std::move(*NewAST)) : nullptr;
} else {
- assert(InputsAreLatest && !RanASTCallback &&
- "forgot to invalidate cached ast?");
log("Skipping rebuild of the AST for {0}, inputs are the same.", FileName);
Status.update([](TUStatus &Status) {
Status.Details.ReuseAST = true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77664.255918.patch
Type: text/x-patch
Size: 1032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200408/2dc5ac4b/attachment.bin>
More information about the cfe-commits
mailing list