[PATCH] D59407: [clangd] Add RelationSlab
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 15 06:35:51 PDT 2019
gribozavr added inline comments.
================
Comment at: clang-tools-extra/clangd/index/Index.cpp:35
+ auto *Array = Arena.Allocate<SymbolID>(Rels.size());
+ std::uninitialized_copy(Rels.begin(), Rels.end(), Array);
+ Result.emplace_back(Entry.first,
----------------
Use `ArrayRef::copy()`, for example: https://reviews.llvm.org/D58782
================
Comment at: clang-tools-extra/clangd/index/Index.h:43
+public:
+ using value_type = std::pair<RelationKey, llvm::ArrayRef<SymbolID>>;
+ using const_iterator = std::vector<value_type>::const_iterator;
----------------
`struct Relation`? And in the comments for it, please explain which way the relationship is directed (is the SymbolID in the key the subtype? or is the SymbolID in the ArrayRef the subtype?).
================
Comment at: clang-tools-extra/clangd/index/Index.h:88
+ size_t NumRelations = 0;
+};
+
----------------
Please move all new declarations into `Relation.h`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59407/new/
https://reviews.llvm.org/D59407
More information about the cfe-commits
mailing list