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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits