mirror of
https://github.com/apple/swift.git
synced 2026-01-17 12:17:35 +01:00
For example, if a @_fixed_layout struct A contains a resilient struct B from the same module M, then inside M, A can have a fixed size, but outside, A has a dynamic size because B is opaque. In this case, A is not "universally fixed-size". This impacts multi-payload enums, because if A is placed inside a multi-payload enum E which is lowered inside X, we would get a fixed layout with spare bits, but lowering E outside of X would yield a dynamic layout. This is incorrect. Fix this by plumbing through a new predicate IsAlwaysFixedSize, which is similar to IsPOD and IsBitwiseTakable, where a compound type inherits the property if all leaf types exhibit it, and only use spare bits if the original and substituted types have this property.
13 KiB
13 KiB