This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Make use of URIs in FileShardedIndex
ClosedPublic

Authored by kadircet on Apr 29 2020, 3:13 AM.

Details

Summary

This makes FileShardedIndex more robust and gets rid of the need for a
URIToFileCache, as it is done by the callers now and it is only once per file,
rather than once per symbol.

Diff Detail

Event Timeline

kadircet created this revision.Apr 29 2020, 3:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 29 2020, 3:13 AM
kadircet updated this revision to Diff 260878.Apr 29 2020, 3:50 AM
  • Return None and change PathRef to auto since it is URI now.

LG but I think we can skip one lot of conversion, let me know what you think.

clang-tools-extra/clangd/index/Background.cpp
183

is this really important enough to be worth saying twice :-)

clang-tools-extra/clangd/index/FileIndex.cpp
388

I don't actually think it's important that we use filenames as the PreambleSymbols sharding key. We can skip the whole resolving thing and just use the URIs. We should go through and update docs to change "path" to "key" in FileSymbols I guess. Am I missing something?

Sorry I think I alluded to this a bit cryptically...

kadircet updated this revision to Diff 261061.Apr 29 2020, 3:34 PM
kadircet marked 2 inline comments as done.
  • Update FileSymbols to express keys are not necessarily file paths.
  • Use Uri for keys of PreambleSymbols
kadircet marked an inline comment as done.Apr 29 2020, 3:34 PM
kadircet added inline comments.
clang-tools-extra/clangd/index/Background.cpp
183

copy pasta is the worst kind of pasta :D

sammccall accepted this revision.Apr 29 2020, 3:51 PM
sammccall added inline comments.
clang-tools-extra/clangd/index/FileIndex.h
61

may want to mention that keys are typically files, up to you

This revision is now accepted and ready to land.Apr 29 2020, 3:51 PM
This revision was automatically updated to reflect the committed changes.
kadircet marked an inline comment as done.