[PATCH] D77664: [clangd] Fix broken assertion

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 11:55:51 PDT 2020


kadircet updated this revision to Diff 255746.
kadircet added a comment.

- Delete the assertion too


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.255746.patch
Type: text/x-patch
Size: 1032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200407/bdb9b8fd/attachment.bin>


More information about the cfe-commits mailing list