This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Store source file hash in IndexFile{In,Out}
ClosedPublic

Authored by kadircet on Nov 19 2018, 2:15 AM.

Details

Summary

Puts the digest of the source file that generated the index into
serialized index and stores them back on load, if exists.

Diff Detail

Repository
rL LLVM

Event Timeline

kadircet created this revision.Nov 19 2018, 2:15 AM

Hi Kadir, I have one small nit otherwise LGTM.

clangd/index/Serialization.cpp
368 ↗(On Diff #174572)

Nit: Maybe we could use Result.Digest.size() and avoid having 20 hardcoded here?

kadircet updated this revision to Diff 174608.Nov 19 2018, 7:01 AM
kadircet marked an inline comment as done.
  • Use digest size instead of hardcoding it.
sammccall accepted this revision.Nov 19 2018, 9:28 AM
sammccall added inline comments.
clangd/index/Serialization.cpp
330 ↗(On Diff #174608)

update

366 ↗(On Diff #174608)

I'd call this chunk "srcs" or so - I suspect we may want to include path info and/or dependencies in the future.

368 ↗(On Diff #174572)

It's still in a couple of places in Serialization.h. Could we add an alias there e.g. using FileDigest = std::array<uint8_t, 20>?

This revision is now accepted and ready to land.Nov 19 2018, 9:28 AM
kadircet updated this revision to Diff 174635.Nov 19 2018, 10:07 AM
kadircet marked 3 inline comments as done.
  • Address comments.
This revision was automatically updated to reflect the committed changes.