Commit Graph

3 Commits

Author SHA1 Message Date
Tim Kientzle
f73cfa7396 Reflection tests are incompatible with ASAN 2024-07-26 09:55:08 -07:00
Hiroshi Yamauchi
ed58501ecd Account for the generic zero-sized payload enum cases.
Disable the assert:

    // At least one payload is non-empty (otherwise this                                                                                                                  // would get laid out as a non-payload enum)                                                                                                                          assert(getNumNonEmptyPayloadCases() > 0);

in TaggedMultiPayloadEnumTypeInfo because it fails when you have
generic but zero-sized payload enum cases.

Also remove unnecessary "REQUIRES: objc_interop" lines from the enum
reflection tests.
2023-09-21 09:31:24 -07:00
Tim Kientzle
4d91b45988 [RemoteMirror] Get spare bit info from reflection records (#40906)
This adds a new reflection record type carrying spare bit information for multi-payload enums.

The compiler includes this for any type that might need it in order to accurately reflect the contents of the enum. The RemoteMirror library will use this if present to determine how to project the contents of the enum. If not present (for example, in older binaries), the RemoteMirror library falls back on an internal calculation of the spare bitmask.

A few notes:
 * The internal calculation is not perfect.  In particular, it does not support MPEs that contain other enums (e.g., optionals).  It should accurately refuse to project any MPE that it does not correctly support.
 * The new reflection field is designed to be expandable; this might someday avoid the need for a new section.

Resolves rdar://61158214
2022-02-21 17:06:14 -08:00