[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-24 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE333196: [clangd] Build index on preamble changes instead of the AST changes (authored by ibiryukov, committed by ). Changed prior to commit: https://reviews.llvm.org/D47272?vs=148421&id=148424#toc Re

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-24 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. Thanks for adding the test! Comment at: clangd/index/FileIndex.cpp:37 + std::vector TopLevelDecls( + AST.getTranslationUnitDecl()->decls().begin(), + AST.getTr

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 148421. ilya-biryukov added a comment. - Added a test for preamble rebuilds. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47272 Files: clangd/ClangdServer.cpp clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/TUScheduler.cpp

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Added the test. Comment at: clangd/index/FileIndex.cpp:37 + std::vector TopLevelDecls( + AST.getTranslationUnitDecl()->decls().begin(), + AST.getTranslationUnitDecl()->decls().end()); ioeric wrote: > ilya-biryukov wrote

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/FileIndex.cpp:37 + std::vector TopLevelDecls( + AST.getTranslationUnitDecl()->decls().begin(), + AST.getTranslationUnitDecl()->decls().end()); ilya-biryukov wrote: > ioeric wrote: > > Would this gi

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D47272#1110958, @ioeric wrote: > Would it be possible to add some integration tests for file index plus > preamble? Sure, will do Comment at: clangd/index/FileIndex.cpp:37 + std::vector TopLevelDecls( + AST.ge

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Would it be possible to add some integration tests for file index plus preamble? Comment at: clangd/index/FileIndex.cpp:37 + std::vector TopLevelDecls( + AST.getTranslationUnitDecl()->decls().begin(), + AST.getTranslationUnitDecl()->decls().en

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 148262. ilya-biryukov added a comment. - Added forgotten renames Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47272 Files: clangd/ClangdServer.cpp clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/TUScheduler.cpp clangd/TUS

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. @malaperle, a slight offtopic. I was wondering which completion options do you use for clangd? Defaults? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47272 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-23 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle added a comment. In https://reviews.llvm.org/D47272#1109914, @ilya-biryukov wrote: > In https://reviews.llvm.org/D47272#1109909, @malaperle wrote: > > > > We do not to rely on symbols from the main file anyway, since any info > > > hat those provide can always be taken from the AST. >

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D47272#1109909, @malaperle wrote: > > We do not to rely on symbols from the main file anyway, since any info hat > > those provide can always be taken from the AST. > > I'll be adding those soon for workspace symbols... And also for docu

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-23 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle added a comment. > We do not to rely on symbols from the main file anyway, since any info hat > those provide can always be taken from the AST. I'll be adding those soon for workspace symbols... And also for document symbols. Repository: rCTE Clang Tools Extra https://reviews.llv

[PATCH] D47272: [clangd] Build index on preamble changes instead of the AST changes

2018-05-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added reviewers: ioeric, sammccall. Herald added subscribers: jkorous, MaskRay, javed.absar, klimek. This is more efficient and avoids data races when reading files that come from the preamble. The staleness can occur when reading a file from disk