[PATCH] D59407: [clangd] Add RelationSlab
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 15 06:55:58 PDT 2019
kadircet added inline comments.
Comment at: clang-tools-extra/clangd/index/Index.h:43
+ 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?).
Ah exactly my thoughts, forget to mention this.
I believe current usage is the counter-intuitive one. For example, we will most likely query with something like:
`getRelations(SymbolID, baseOf)` to get all relations where `SymbolID` is `baseOf` something else(which says get children of `SymbolID`)
So that this valueType can be read like,
`SymbolID` is `RelationKind` every `SymbolID inside array`
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits