[all-commits] [llvm/llvm-project] 130dbf: [clangd] Fix broken assertion

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Wed Apr 8 00:58:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 130dbf63ff12271be9451e259447c5fab768dce6
      https://github.com/llvm/llvm-project/commit/130dbf63ff12271be9451e259447c5fab768dce6
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2020-04-08 (Wed, 08 Apr 2020)

  Changed paths:
    M clang-tools-extra/clangd/TUScheduler.cpp

  Log Message:
  -----------
  [clangd] Fix broken assertion

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.

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77664


  Commit: 2a6eedbb51fd612d3386b0379938036b17511ae0
      https://github.com/llvm/llvm-project/commit/2a6eedbb51fd612d3386b0379938036b17511ae0
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2020-04-08 (Wed, 08 Apr 2020)

  Changed paths:
    M clang-tools-extra/clangd/TUScheduler.cpp

  Log Message:
  -----------
  [clangd] Destroy context before resetting CurrentReq

Summary:
Our tests stash callbacks into request context and rely on it being
invoked before threads going idle.

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77671


Compare: https://github.com/llvm/llvm-project/compare/aa034867f1dd...2a6eedbb51fd


More information about the All-commits mailing list