[PATCH] D77732: [clangd] Shard preamble symbols in dynamic index
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 14 06:55:05 PDT 2020
sammccall accepted this revision.
sammccall added a comment.
Still LG
================
Comment at: clang-tools-extra/clangd/index/FileIndex.h:165
+ /// Returns absolute paths for all files that has a shard.
+ std::vector<PathRef> getAllFiles() const;
+
----------------
kadircet wrote:
> sammccall wrote:
> > I do find it a little weird not to expose the map-structure of the vast majority of the data here.
> >
> > What steers you away from just making this a function
> > `StringMap<X> shardIndexToFile(IndexFileIn, PathRef)`
> > where X could be `File` with a method to obtain the data, or the more anonymous `unique_function<IndexFileIn()>`?
> because the map structure is just pointers into the `IndexFileIn`, I wanted to make sure those pointers do not outlive the IndexFileIn.
I don't think it's unreasonable to have a non-owning data structure with a comment, but up to you.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77732/new/
https://reviews.llvm.org/D77732
More information about the cfe-commits
mailing list