summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/index/dex/Dex.h
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Add bool return type to Index::refs API.Haojian Wu2019-11-131-1/+1
| | | | | | | | | | | | | | | | Summary: Similar to fuzzyFind, the bool indicates whether there are more xref results. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70139
* [clangd] Use our own relation kind.Haojian Wu2019-10-171-4/+7
| | | | | | | | | | | | | | | | Summary: Move the RelationKind from Serialization.h to Relation.h. This patch doesn't introduce any breaking changes. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68981 llvm-svn: 375117
* [clangd] Index API and implementations for relationsNathan Ridge2019-06-151-7/+19
| | | | | | | | | | | | | | | | | Summary: This builds on the relations support added in D59407, D62459, and D62471 to expose relations in SymbolIndex and its implementations. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62839 llvm-svn: 363481
* [clangd] Add type boost to fuzzy find in Dex.Eric Liu2019-02-061-0/+4
| | | | | | | | | | | | | | | | | | Summary: No noticeable impact on code completions overall except some improvement on cross-namespace completion. Reviewers: sammccall, ilya-biryukov Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57815 llvm-svn: 353310
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clangd] Cleanup: stop passing around list of supported URI schemes.Eric Liu2018-11-221-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of passing around a list of supported URI schemes in clangd, we expose an interface to convert a path to URI using any compatible scheme that has been registered. It favors customized schemes and falls back to "file" when no other scheme works. Changes in this patch are: - URI::create(AbsPath, URISchemes) -> URI::create(AbsPath). The new API finds a compatible scheme from the registry. - Remove URISchemes option everywhere (ClangdServer, SymbolCollecter, FileIndex etc). - Unit tests will use "unittest" by default. - Move "test" scheme from ClangdLSPServer to ClangdMain.cpp, and only register the test scheme when lit-test or enable-lit-scheme is set. (The new flag is added to make lit protocol.test work; I wonder if there is alternative here.) Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D54800 llvm-svn: 347467
* [clangd] auto-index stores symbols per-file instead of per-TU.Eric Liu2018-11-061-3/+1
| | | | | | | | | | | | | | | | | Summary: This allows us to deduplicate header symbols across TUs. File digests are collects when collecting symbols/refs. And the index store deduplicates file symbols based on the file digest. Reviewers: sammccall, hokein Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53433 llvm-svn: 346221
* [clangd] Optionally use dex for the preamble parts of the dynamic index.Sam McCall2018-10-161-1/+3
| | | | | | | | | | | | | | | Summary: Reuse the old -use-dex-index experiment flag for this. To avoid breaking the tests, make Dex deduplicate symbols, addressing an old FIXME. Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53288 llvm-svn: 344594
* [clangd] Simplify Dex query tree logic and fix missing-posting-list bugSam McCall2018-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The bug being fixed: when a posting list doesn't exist in the index, it was previously just dropped from the query rather than being treated as empty. Now that we have the FALSE iterator, we can use it instead. The query tree logic previously had a bunch of special cases to detect whether subtrees are empty. Now we just naively build the whole tree, and rely on the query optimizations to drop the trivial parts. Finally, there was a bug in trigram generation: the empty query would generate a single trigram "$$$" instead of no trigrams. This had no effect (there was no posting list, so the other bug cancelled it out). But we now have to fix this bug too. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52796 llvm-svn: 343802
* [clangd] Support refs() in dex. Largely cloned from MemIndex.Sam McCall2018-10-041-15/+15
| | | | | | | | | | Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52726 llvm-svn: 343760
* Reland r343589 "[clangd] Dex: add Corpus factory for iterators, rename, fold ↵Sam McCall2018-10-021-1/+2
| | | | | | | | constant. NFC"" This reverts commit r343610. llvm-svn: 343622
* Revert r343589 "[clangd] Dex: add Corpus factory for iterators, rename, fold ↵Reid Kleckner2018-10-021-2/+1
| | | | | | | | | | | | | | constant. NFC" Declaring a field with the same name as a type causes GCC to error out: Dex.h:104:10: error: declaration of 'clang::clangd::dex::Corpus clang::clangd::dex::Dex::Corpus' [-fpermissive] Corpus Corpus; ^ Iterator.h:127:7: error: changes meaning of 'Corpus' from 'class clang::clangd::dex::Corpus' [-fpermissive] class Corpus { llvm-svn: 343610
* [clangd] Dex: add Corpus factory for iterators, rename, fold constant. NFCSam McCall2018-10-021-1/+2
| | | | | | | | | | | | | | | | | | | Summary: - Corpus avoids having to pass size to the true iterator, and (soon) any iterator that might optimize down to true. - Shorten names of factory functions now they're scoped to the Corpus. intersect() and unionOf() rather than createAnd() or createOr() as this seems to read better to me, and fits with other short names. Opinion wanted! - DEFAULT_BOOST_SCORE --> 1. This is a multiplier, don't obfuscate identity. - Simplify variadic templates in Iterator.h Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52711 llvm-svn: 343589
* [clangd] NFC: Simplify code, enforce LLVM Coding StandardsKirill Bobyrev2018-09-251-9/+10
| | | | | | | | | | | | | | | | For consistency, functional-style code pieces are replaced with their simple counterparts to improve readability. Also, file headers are fixed to comply with LLVM Coding Standards. `static` member of anonymous namespace is not marked `static` anymore, because it is redundant. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D52466 llvm-svn: 342974
* [clangd] Introduce PostingList interfaceKirill Bobyrev2018-09-131-0/+1
| | | | | | | | | | | | | | | | This patch abstracts `PostingList` interface and reuses existing implementation. It will be used later to test different `PostingList` representations. No functionality change is introduced, this patch is mostly refactoring so that the following patches could focus on functionality while not being too hard to review. Reviewed By: sammccall, ioeric Differential Revision: https://reviews.llvm.org/D51982 llvm-svn: 342155
* [clangd] Add symbol slab size to index memory consumption estimatesKirill Bobyrev2018-09-101-2/+8
| | | | | | | | | | | | | Currently, `SymbolIndex::estimateMemoryUsage()` returns the "overhead" estimate, i.e. the estimate of the Index data structure excluding backing data (such as Symbol Slab and Reference Slab). This patch propagates information about paired data size where necessary. Reviewed By: ioeric, sammccall Differential Revision: https://reviews.llvm.org/D51539 llvm-svn: 341800
* [clangd] NFC: Rename DexIndex to DexKirill Bobyrev2018-09-101-0/+113
Also, cleanup some redundant includes. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D51774 llvm-svn: 341784
OpenPOWER on IntegriCloud