[clang] [clang-tools-extra] clangd: Extend reference search with constructor calls through forwarding (PR #169742)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 22 22:47:13 PST 2025


================
@@ -230,6 +242,9 @@ class SymbolCollector : public index::IndexDataConsumer {
   std::unique_ptr<HeaderFileURICache> HeaderFileURIs;
   llvm::DenseMap<const Decl *, SymbolID> DeclToIDCache;
   llvm::DenseMap<const MacroInfo *, SymbolID> MacroToIDCache;
+  llvm::DenseSet<const FunctionTemplateDecl *> LikelyForwardingFunctionCached;
----------------
HighCommander4 wrote:

Not really sure I understand the point of this cache. Most function templates are not likely-forwarding-functions, and the cache only saves work for the minority that are, so are we really gaining much here?

(If we made it as a `DenseMap<FunctionTemplateDecl*, bool>` and also saved the cases where the outcome of the computation is `false` then the cache would make more sense, though it would now be a fair bit larger and I'm still unsure whether the time/memory tradeoff for it is there.)

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


More information about the cfe-commits mailing list