[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
================
@@ -576,6 +576,50 @@ SymbolCollector::getRefContainer(const Decl *Enclosing,
return Enclosing;
}
+bool SymbolCollector::isLikelyForwardingFunctionCached(
+ const FunctionTemplateDecl *FT) {
+ if (LikelyForwardingFunctionCached.contains(FT))
+ return true;
+ if (isLikelyForwardingFunction(FT)) {
+ LikelyForwardingFunctionCached.insert(FT);
+ return true;
+ }
+ return false;
+}
+
+bool SymbolCollector::potentiallyForwardInBody(const Decl *D) {
+ if (auto *FD = llvm::dyn_cast<clang::FunctionDecl>(D);
----------------
HighCommander4 wrote:
This first part of the function, which pertains to function template instantiations, can be dropped, as it's not applicable.
(The optimization we're trying to avoid is to skip **parsing** function bodies. Function template instantiations' bodies aren't parsed, they're synthesized from the primary template's body, so we should never get here for them.)
https://github.com/llvm/llvm-project/pull/169742
More information about the cfe-commits
mailing list