[clang] [WIP] [Modules] Delay reading type source info of the preferred_name attribute. (PR #122250)
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 13 06:36:57 PST 2025
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
More information about the cfe-commits
mailing list