This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix broken assertion
ClosedPublic

Authored by kadircet on Apr 7 2020, 11:20 AM.

Details

Summary

This assertion was bad. It will show up once we start running preamble
thread async. Think about the following case:

  • Update 1 builds a preamble, and an AST. Caches the AST.
  • Update 2 Invalidates the cache, preamble hasn't changed.
  • Update 3 Invalidates the cache, preamble hasn't changed
  • Read builds AST using preamble v1, and caches it. preamble for v2 gets build, cache isn't invalidated since preamble is same. generateDiags tries to reuse cached AST but latest version is 3 not 2, so assertion fails.

Diff Detail

Event Timeline

kadircet created this revision.Apr 7 2020, 11:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2020, 11:20 AM
kadircet updated this revision to Diff 255746.Apr 7 2020, 11:29 AM
  • Delete the assertion too
sammccall accepted this revision.Apr 7 2020, 6:03 PM
This revision is now accepted and ready to land.Apr 7 2020, 6:03 PM
This revision was automatically updated to reflect the committed changes.