summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/index/Index.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Simplify code. No functionality change intended.Benjamin Kramer2017-12-281-7/+1
| | | | llvm-svn: 321523
* [clangd] Use Builder for symbol slabs, and use sorted-vector for storageSam McCall2017-12-231-18/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | 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] Don't re-hash SymbolID in maps, just use the SHA1 dataSam McCall2017-12-211-1/+1
| | | | llvm-svn: 321302
* [clangd] Index symbols share storage within a slab.Sam McCall2017-12-211-2/+10
| | | | | | | | | | | | | | | | | 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] Put all #includes in one block in clangd source files. NFCEric Liu2017-12-141-2/+1
| | | | | | | Clang-format categorizes and sorts #includes with style. It doesn't make sense to manually managing #include blocks. llvm-svn: 320743
* [clangd] Construct SymbolSlab from YAML format.Haojian Wu2017-12-141-6/+12
| | | | | | | | | | | | | | 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] clang-format the source code. NFCIlya Biryukov2017-12-131-12/+5
| | | | llvm-svn: 320577
* [clangd] Introduce a "Symbol" class.Haojian Wu2017-12-121-0/+49
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