[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE341242: [clangd] Implement findOccurrences interface in dynamic index. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D51279?vs=163539=163580#toc Repository:

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163539. hokein marked 3 inline comments as done. hokein added a comment. address review comments: - build memindex with symbol slab and occurrence slab - remove withAllCode in TestTU Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: unittests/clangd/TestTU.h:41 + static TestTU withAllCode(llvm::StringRef HeaderCode, llvm::StringRef Code, +llvm::StringRef Filename = "") { hokein wrote: > sammccall wrote: > > We've

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163532. hokein added a comment. Minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/Index.h clangd/index/MemIndex.cpp clangd/index/MemIndex.h

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/MemIndex.cpp:35 std::unique_ptr MemIndex::build(SymbolSlab Slab) { auto Idx = llvm::make_unique(); sammccall wrote: > This is still implicitly creating an index with no occurrences. Did you mean > to

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163531. hokein marked 4 inline comments as done. hokein added a comment. - rebase - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked 3 inline comments as done. hokein added a comment. Sorry! Just realised I messed up this patch with https://reviews.llvm.org/D50385 (mostly SymbolCollector changes), all the comments about `SymbolCollector` are fixed in https://reviews.llvm.org/D50385. Repository: rCTE Clang

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. This basically looks good to go (some fixes needed but they're pretty clear I think let me know if not!) Comment at: clangd/index/FileIndex.cpp:63 + auto Occurrences

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/index/FileIndex.cpp:48 + if (TopLevelDecls) { // index main AST, set occurrence flag. +CollectorOpts.OccurrenceFilter = SymbolOccurrenceKind::Declaration | hokein wrote: > ilya-biryukov wrote: > >

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163066. hokein added a comment. Minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/Index.cpp clangd/index/Index.h clangd/index/MemIndex.cpp

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the comments. Comment at: clangd/index/FileIndex.cpp:48 + if (TopLevelDecls) { // index main AST, set occurrence flag. +CollectorOpts.OccurrenceFilter = SymbolOccurrenceKind::Declaration | ilya-biryukov wrote: > There

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163064. hokein marked 16 inline comments as done. hokein added a comment. Herald added a subscriber: mgrang. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-28 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In https://reviews.llvm.org/D51279#1214268, @ilya-biryukov wrote: > Just noticed I'm not on the reviewers list, sorry for chiming in without > invitation. Was really excited about the change :-) fixed :-) Comment at: clangd/index/FileIndex.cpp:58

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D51279#1214268, @ilya-biryukov wrote: > Just noticed I'm not on the reviewers list, sorry for chiming in without > invitation. Was really excited about the change :-) Comments are always welcome :) Comment at:

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Just noticed I'm not on the reviewers list, sorry for chiming in without invitation. Was really excited about the change :-) Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 ___ cfe-commits

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-27 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. The memory usage looks good. Some NITs and a major consideration wrt to the implementation of merging occurences from dynamic and static index. Comment at: clangd/index/FileIndex.cpp:48 + if (TopLevelDecls) { // index main AST, set occurrence

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Some numbers of memory usage from running this on my machine: | File | Preamble AST | Main AST | | SemaDecl.cpp | 14.5MB | 108.1KB (symbols) + 16.5KB (occurrences) | | CodeComplete.cpp | 15.4MB | 53.9KB (symbols)

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Implement the interface in - FileIndex - MemIndex - MergeIndex Depends on https://reviews.llvm.org/D50385. Repository: rCTE Clang Tools