[cfe-dev] Adding indexing support to Clangd
David Chisnall via cfe-dev
cfe-dev at lists.llvm.org
Thu Aug 10 03:10:02 PDT 2017
On 8 Aug 2017, at 18:52, Marc-André Laperle via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>
> --ClangdIndexStorage--
> malloc-like interface that allocates/frees data blocks of variable sizes on disk. The blocks can contain ints, shorts, strings, pointers (i.e. file offsets), etc. The data is cached in 4K pieces so that local and repeated accesses are all done quickly, in memory.
> Clangd mallocs and writes its index model objects using this.
>
> --BTree--
> A pretty classic BTree implementation. Used to speed up lookup (symbol names, file names). It allocates its nodes using ClangdIndexStorage therefore it is stored on disk. Keys are actually records in ClangdIndexStorage so you can really think of the BTree as a collection of sorted pointers (sorted according to a provided comparator).
This sounds very like bdb. Is there a reason that we’re reimplementing a large chunk of bdb, rather than just using it (or using something like sqlite for the index storage)?
David
More information about the cfe-dev
mailing list