ilya-biryukov wrote:

> A special handling for `PreferredName` looks slightly add-hoc to me. What I 
> thought is to delay the deserialization of `attributes` after the 
> deserialization of the declaration. If this is too optimistic, I am wondering 
> if we can delay reading of some sorts of attributes only, which is more 
> generic.

I don't have concrete examples in my head, but I would be cautious of doing 
this for **all** attributes. Intuitively, it feels that there must be existing 
attributes that we somehow would depend on in the code during serialization. 
However, it might be worth a try to actually find real examples from running 
tests (even if only to prove that my intuition is wrong).

That being said, having a concept for "sort of attributes that we can delay 
reading" seems like a really good idea. I am now highly suspicious of any 
attribute that stores `TypeSourceInfo`, they should probably hit the same bug 
in certain circumstances; there's no nothing specific to `preferred_name` 
itself other than the fact that it actually tends to end up recursively 
referencing its own type through a typedef more often than others.

https://github.com/llvm/llvm-project/pull/122250
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to