[PATCH] D56370: [clangd] Add support for type hierarchy (super types only for now)

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 11 01:58:14 PST 2019


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:925
+    CXXRD = VD->getType().getTypePtr()->getAsCXXRecordDecl();
+  } else if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) {
+    // If this is a method, use the type of the class.
----------------
nridge wrote:
> kadircet wrote:
> > what about member fields ?
> It's not clear what the desired semantics would be for a member field: get the type hierarchy of the enclosing class type, or the type hierarchy of the field's type?
I think it is sensible to go for enclosing type. But up to you, in any case could you add a comment stating how `FieldDecl` are handled?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56370/new/

https://reviews.llvm.org/D56370





More information about the cfe-commits mailing list