[PATCH] D64613: [clangd] Type hierarchy: don't resolve parents if the client only asked for children
Nathan Ridge via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 12 21:09:59 PDT 2019
nridge marked 2 inline comments as done.
nridge added inline comments.
================
Comment at: clang-tools-extra/clangd/XRefs.cpp:1238
Optional<TypeHierarchyItem> Result =
- getTypeAncestors(*CXXRD, AST.getASTContext(), RPSet);
+ getTypeAncestors(*CXXRD, AST.getASTContext(), RPSet, ResolveParents);
if (!Result)
----------------
kadircet wrote:
> having a function named `getTypeAncestors` with a parameter `ResolveParents` doesn't make much sense. maybe move the check to caller side and simply don't call it if we are not interested in parents?
>
> I think it makes sense to make this part also similar to subtypes:
> - let's generate the item in here with `Optional<TypeHierarchyItem> Result = declToTypeHierarchyItem(ASTCtx, CXXRD);`, which is used by both parents and children.
> - bail out if we couldn't get the item.
> - fill in parents if need be
> - fill in children if need be
>
> WDYT?
Agreed, this makes the code cleaner.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64613/new/
https://reviews.llvm.org/D64613
More information about the cfe-commits
mailing list