kadircet 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)
----------------
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?


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

Reply via email to