Commit Graph

4 Commits

Author SHA1 Message Date
Tim Kientzle
40eb3c084d Expand the work from #73491 to support more MPE layouts. This also switches the
MPE layout code to exclusively use the new code.  The key observation: existing
reflection metadata seems to already provide enough information in all cases, so
we can abandon an earlier effort to add spare bitmask data.

Resolves rdar://129281368
2024-06-05 10:15:58 -07:00
Tim Kientzle
febc128330 Whitespace 2024-05-07 14:21:16 -07:00
Tim Kientzle
ea87a273d7 Redesign the spare bit mask calculation
This adds a `getSpareBits` method to all the TypeInfo classes
that returns a suitable bitmask indicating the spare bits available
in values of this type.  This gives us a way to recursively explore
the type tree and build up a full spare bit mask for an arbitrary type.

Happily, it appears we actually do have enough information to do this
calculation entirely from first principles, without requiring additional
reflection information.  So once this is stable, we should remove my
earlier incomplete effort to publish spare bit mask info in the reflection
data, as that adds unnecessary metadata to every binary.

This doubtless still has plenty of holes, but seems sufficient
to handle a few basic enum types, including the stdlib DecodingError
which was used as an example to work out some key issues.
2024-05-07 14:17:00 -07:00
Tim Kientzle
e546684e9a Extract the BitMask support to a separate file 2024-04-29 16:50:58 -07:00