This is an archive of the discontinued LLVM Phabricator instance.

[clangd] clangd-indexer gathers refs and stores them in index files.
ClosedPublic

Authored by sammccall on Sep 26 2018, 12:46 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Sep 26 2018, 12:46 AM
hokein added a comment.Oct 4 2018, 2:06 AM

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)?

clangd/index/Serialization.cpp
301 ↗(On Diff #167063)

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?

333 ↗(On Diff #167063)

We are adding a new section in the RIFF, the comment needs update.

clangd/indexer/IndexerMain.cpp
81 ↗(On Diff #167063)

nit: this comment needs update.

sammccall marked 2 inline comments as done.Oct 4 2018, 2:28 AM

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)?

We indeed need to include them somehow. Added a fixme to IndexAction, because I'm not totally sure at what level we should address this.

clangd/index/Serialization.cpp
301 ↗(On Diff #167063)

Yes, there's a TODO on line 250. I opted not to do so in this patch, as it's a more invasive change and I wasn't sure about the exact representation.
It should be straightforward to add later and bump the version.

sammccall updated this revision to Diff 168245.Oct 4 2018, 2:32 AM

Address review comments.

hokein accepted this revision.Oct 4 2018, 2:44 AM

looks good.

clangd/index/Serialization.cpp
301 ↗(On Diff #167063)

SG.

This revision is now accepted and ready to land.Oct 4 2018, 2:44 AM
This revision was automatically updated to reflect the committed changes.