summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/index
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Simplify code. No functionality change intended.Benjamin Kramer2017-12-287-34/+23
| | | | llvm-svn: 321523
* [clangd] Use Builder for symbol slabs, and use sorted-vector for storageSam McCall2017-12-236-77/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This improves a few things: - the insert -> freeze -> read sequence is now enforced/communicated by the type system - SymbolSlab::const_iterator iterates over symbols, not over id-symbol pairs - we avoid permanently storing a second copy of the IDs, and the string map's hashtable The slab size is now down to 21.8MB for the LLVM project. Of this only 2.7MB is strings, the rest is #symbols * `sizeof(Symbol)`. `sizeof(Symbol)` is currently 96, which seems too big - I think SymbolInfo isn't efficiently packed. That's a topic for another patch! Also added simple API to see the memory usage/#symbols of a slab, since it seems likely we will continue to care about this. Reviewers: ilya-biryukov Subscribers: klimek, mgrang, cfe-commits Differential Revision: https://reviews.llvm.org/D41506 llvm-svn: 321412
* [clangd] Improve packing of Symbol struct. NFCSam McCall2017-12-222-4/+10
| | | | llvm-svn: 321348
* [clangd] Don't re-hash SymbolID in maps, just use the SHA1 dataSam McCall2017-12-212-2/+4
| | | | llvm-svn: 321302
* [clangd] Fix use after free.Benjamin Kramer2017-12-211-3/+4
| | | | | | Found by asan. llvm-svn: 321286
* [clangd] Index symbols share storage within a slab.Sam McCall2017-12-212-11/+30
| | | | | | | | | | | | | | | | | Summary: Symbols are not self-contained - it's only safe to hand them out if you guarantee the lifetime of the underlying data. Before this lands, I'm going to measure the before/after memory usage of the LLVM index loaded into memory in a single slab. Reviewers: hokein Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41483 llvm-svn: 321272
* [clangd] Igore cases in index fuzzy find.Eric Liu2017-12-201-1/+1
| | | | llvm-svn: 321157
* [clangd] Add "../" to Logger.h included from parent directory.Martin Bohme2017-12-201-1/+1
| | | | llvm-svn: 321156
* [clangd] Index-based code completion.Eric Liu2017-12-195-7/+7
| | | | | | | | | | | | | | Summary: Use symbol index to populate completion results for qualfified IDs e.g. "nx::A^". Reviewers: ilya-biryukov, sammccall Reviewed By: ilya-biryukov, sammccall Subscribers: rwols, klimek, mgorny, cfe-commits, sammccall Differential Revision: https://reviews.llvm.org/D41281 llvm-svn: 321083
* [clangd] Support filtering by fixing scopes in fuzzyFind.Eric Liu2017-12-194-13/+50
| | | | | | | | | | | | | | Summary: When scopes are specified, only match symbols from scopes. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41367 llvm-svn: 321067
* [clangd] Build in-memory index on symbols in files.Eric Liu2017-12-152-9/+65
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41276 llvm-svn: 320807
* [clangd] Put all #includes in one block in clangd source files. NFCEric Liu2017-12-145-7/+2
| | | | | | | Clang-format categorizes and sorts #includes with style. It doesn't make sense to manually managing #include blocks. llvm-svn: 320743
* [clangd] Add a FileSymbols container that manages symbols from multiple files.Eric Liu2017-12-142-0/+101
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41232 llvm-svn: 320701
* [clangd] Construct SymbolSlab from YAML format.Haojian Wu2017-12-144-6/+209
| | | | | | | | | | | | | | Summary: This will be used together with D40548 for the global index source (experimental). Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits, ioeric Differential Revision: https://reviews.llvm.org/D41178 llvm-svn: 320694
* [clangd] Symbol index interfaces and an in-memory index implementation.Eric Liu2017-12-143-0/+122
| | | | | | | | | | | | | | | | | | | | Summary: o Index interfaces to support using different index sources (e.g. AST index, global index) for code completion, cross-reference finding etc. This patch focuses on code completion. The following changes in the original patch has been split out. o Implement an AST-based index. o Add an option to replace sema code completion for qualified-id with index-based completion. o Implement an initial naive code completion index which matches symbols that have the query string as substring. Reviewers: malaperle, sammccall Reviewed By: sammccall Subscribers: hokein, klimek, malaperle, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D40548 llvm-svn: 320688
* [clangd] clang-format the source code. NFCIlya Biryukov2017-12-133-19/+10
| | | | llvm-svn: 320577
* [clangd] Remove the const specifier of the takeSymbol methodHaojian Wu2017-12-131-1/+1
| | | | | | otherwise we will copy an object. llvm-svn: 320574
* [clangd] Overload hash_value for SymbolID, fix struct/class warningSam McCall2017-12-131-3/+5
| | | | llvm-svn: 320554
* [clangd] Introduce a "Symbol" class.Haojian Wu2017-12-124-0/+330
Summary: * The "Symbol" class represents a C++ symbol in the codebase, containing all the information of a C++ symbol needed by clangd. clangd will use it in clangd's AST/dynamic index and global/static index (code completion and code navigation). * The SymbolCollector (another IndexAction) will be used to recollect the symbols when the source file is changed (for ASTIndex), or to generate all C++ symbols for the whole project. In the long term (when index-while-building is ready), clangd should share a same "Symbol" structure and IndexAction with index-while-building, but for now we want to have some stuff working in clangd. Reviewers: ioeric, sammccall, ilya-biryukov, malaperle Reviewed By: sammccall Subscribers: malaperle, klimek, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D40897 llvm-svn: 320486
OpenPOWER on IntegriCloud