[PATCH] D52531: [clangd] clangd-indexer gathers refs and stores them in index files.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 4 02:08:03 PDT 2018
hokein added a comment.
Looks great! I played around this patch a bit on LLVM. The output size is 50MB (binary)/1.2G (YAML).
The ref output is not complete (missing all refs in headers, since we only collect refs from main file), I think we will add an option to `SymbolCollector` to allow collecting refs in header (but this option is only used for building static index)?
================
Comment at: clangd/index/Serialization.cpp:301
+// A refs section has data grouped by Symbol. Each symbol has:
+// - SymbolID: 20 bytes
+// - NumRefs: varint
----------------
Looks like we can improve the size further, we are storing SymbolID twice (one in `symb` section), I think we could optimize it by introducing a `symi` section or using `stri` section?
================
Comment at: clangd/index/Serialization.cpp:333
// - stri: string table
// - symb: symbols
----------------
We are adding a new section in the RIFF, the comment needs update.
================
Comment at: clangd/indexer/IndexerMain.cpp:81
+ virtual void consumeRefs(RefSlab Refs) = 0;
/// Produce a resulting symbol slab, by combining occurrences of the same
/// symbols across translation units.
----------------
nit: this comment needs update.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D52531
More information about the cfe-commits
mailing list