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

2018-07-26 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D49783#1175688, @simark wrote: > Thanks, that's simple and efficient. I'll update > https://reviews.llvm.org/D49267 (to call `reparseOpenFiles` once again) once > this is merged. LG, thanks! Repository: rL LLVM https://reviews.l

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

2018-07-26 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL338012: [clangd] Do not rebuild AST if inputs have not changed (authored by ibiryukov, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D49783 File

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

2018-07-26 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/TUScheduler.cpp:360 std::lock_guard Lock(Mutex); + OldPreamble.reset(); if (NewPreamble) ioeric wrote: > ilya-biryukov wrote: > > ioeric wrote: > > > Why reset? > > We don't need the old p

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

2018-07-26 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 157434. ilya-biryukov added a comment. - Move OldPreamble.reset() out of the lock, add a comment Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49783 Files: clangd/TUScheduler.cpp test/clangd/extra-flags.test unittests/clangd/TU

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

2018-07-25 Thread Simon Marchi via Phabricator via cfe-commits
simark added a comment. Thanks, that's simple and efficient. I'll update https://reviews.llvm.org/D49267 (to call `reparseOpenFiles` once again) once this is merged. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49783 ___ cfe-co

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

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
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 Lock(Mutex); + OldPreamble.reset(); if (NewPreamble) ilya-biryukov wrote: > ioer

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

2018-07-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/TUScheduler.cpp:357 + +bool CanReuseAST = InputsAreTheSame && OldPreamble == NewPreamble; { ioeric wrote: > nit: `(OldPreamble == NewPreamble)` > > Do you intend to compare the shared pointer inste

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

2018-07-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 157269. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. - Use log instead of vlog - Add parens around && Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49783 Files: clangd/TUScheduler.cpp test/clangd

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

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/TUScheduler.cpp:357 + +bool CanReuseAST = InputsAreTheSame && OldPreamble == NewPreamble; { nit: `(OldPreamble == NewPreamble)` Do you intend to compare the shared pointer instead of the values? ===

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

2018-07-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: ioeric. Herald added subscribers: jfb, arphaman, jkorous, MaskRay, javed.absar. If the contents are the same, the update most likely comes from the fact that compile commands were invalidated. In that case we want to avoid rebuil