[clang-tools-extra] clangd: Make callHierarchy follow inheritance (PR #163024)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 16 23:49:30 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:

Since we know the relation is `OverriddenBy`, we could make the key of this map just `SymbolID`.

That may be less forward-looking (maybe someone will need reverse relations for a new relation and need to add back the `uint8_t`), but it would save a bit of memory for now.

WDYT?

https://github.com/llvm/llvm-project/pull/163024


More information about the cfe-commits mailing list