[clang-tools-extra] clangd: Make callHierarchy follow inheritance (PR #163024)
Nathan Ridge via cfe-commits
cfe-commits at lists.llvm.org
Sun Oct 19 22:17:49 PDT 2025
================
@@ -94,6 +106,9 @@ class MemIndex : public SymbolIndex {
static_assert(sizeof(RelationKind) == sizeof(uint8_t),
"RelationKind should be of same size as a uint8_t");
llvm::DenseMap<std::pair<SymbolID, uint8_t>, std::vector<SymbolID>> Relations;
+ // Reverse relations, currently only for OverridenBy
+ llvm::DenseMap<std::pair<SymbolID, uint8_t>, std::vector<SymbolID>>
----------------
HighCommander4 wrote:
After giving this some more thought, let's keep things generic, i.e. keep the key `std::pair<SymbolID, uint8_t>`. As our numbers show, the memory footprint of this data structure is sufficiently small that any additional savings don't give us much.
(I can think of use cases for wanting reverse relations even for the other already-existing `RelationKind`, `BaseOf`: it would allow us to show base classes in type hierarchy when invoked on a forward declaration.)
https://github.com/llvm/llvm-project/pull/163024
More information about the cfe-commits
mailing list