[clang] [Serialization] Load Specializations Lazily (PR #76774)

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 21 23:44:57 PST 2024


hahnjo wrote:

> > > I tried applying this patch to ROOT/Cling and it fails to build because something is of the opinion that `std::is_integral<int>::value` is not true. I don't have time right now to investigate further, but since this is the only change I did it is highly likely that it's caused by this...
> > 
> > 
> > In that case we need to understand how this patch differs from the one I pasted in phabricator since the one there works for that case I assume.
> 
> I had a guess. `{ClassTemplateDecl, VarTemplateDecl, FunctionTemplateDecl}::specializations()` will iterate all the specializations. However, after this patch, there are maybe some specializations not loaded at the time of invocation. Then during the process of iterating `specializations()`, it may require to complete the redecl chain to trigger the process of loading specializations. Then boom!

This is also the case with https://reviews.llvm.org/D41416 and we have machinery to deal with that (including https://reviews.llvm.org/D154328)

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


More information about the cfe-commits mailing list