[clang] [Serialization] Fix lazy template loading (PR #133057)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 8 00:19:44 PST 2025
ChuanqiXu9 wrote:
> I'd feel uncomfortable exposing a `noload_redecls` interface because it can potentially break the AST invariants. I think allowing non-modules developers to choose when to complete a redeclaration chain will introduce more bugs than it can fix ;)
>
> I'd propose to move forward with `getMostRecentExistingDecl` if it does the job. We can have a separate PR discussing the ergonomics if there is a strong feeling about going this way.
I'd like it as:
(1) We already have `noload_lookup` and other similar "unpublic" API (e.g., `getOwningModuleID` `invalidateCachedLinkage`) in DeclBase.h.
(2) Merging Redecls is a major performance hurting point of using modules.
(3) In the past, there are many "fix" which just tried to mitigate the bug by loading all redecls without understanding the real problem.
https://github.com/llvm/llvm-project/pull/133057
More information about the cfe-commits
mailing list