[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 20 01:47:11 PDT 2018


ioeric added inline comments.
Herald added a subscriber: kadircet.


================
Comment at: clangd/TUScheduler.h:66
+  /// instead.
+  virtual void onMainAST(PathRef Path, ParsedAST &AST) = 0;
+};
----------------
ilya-biryukov wrote:
> hokein wrote:
> > Does the callback get called every time we built an AST? clangd only has 3 idle ASTs, if the AST is not there, we rebuild it when needed (even the source code is not changed), and we will update the dynamic index, which seems unnecessary.
> > 
> > It may rarely happen, 3 idle ASTs  might cover most cases, I think? 
> Currently we only call this when AST is built for diagnostics, so we will have only a single callback, even if the AST will be rebuilt multiple times because it was flushed out of the cash (as long as the file contents didn't change, of course).
> 
> So we do behave optimally in that case and I suggest we keep it this way
is there any overlap between preamble AST and main AST? If so, could you elaborate in the documentation? 


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50847





More information about the cfe-commits mailing list