[PATCH] D49783: [clangd] Do not rebuild AST if inputs have not changed

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 25 08:47:11 PDT 2018


ioeric accepted this revision.
ioeric added a comment.
This revision is now accepted and ready to land.

lg



================
Comment at: clangd/TUScheduler.cpp:360
       std::lock_guard<std::mutex> Lock(Mutex);
+      OldPreamble.reset();
       if (NewPreamble)
----------------
ilya-biryukov wrote:
> ioeric wrote:
> > Why reset?
> We don't need the old preamble at this point, so we give it a chance to die (if there are no more references).
> Note that there's an expensive operation that follows (building the AST), so removing the preamble before it seems like a win
sg. and do we guard this with mutex because the same old preamble data can be accessed  by other threads? might worth a comment.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49783





More information about the cfe-commits mailing list