Skip to content

Conversation

@DougGregor
Copy link
Member

Tag the C functions used by the standard library for Unicode
normalization as being part of a new availability domain called
"UnicodeNormalization". Mark anything else that (transitively) depends
on those functions as requiring UnicodeNormalization, so that we get
the full surface area of the standard library that somehow depends on
the Unicode data tables (for normalization).

This availability domain is always available in non-Embedded Swift. In
Embedded Swift, this availability domain is optional: if it's enabled,
one needs to link against the swiftUnicodeDataTables library. If it's
disabled, the compiler will have rejected any code that depends on the
Unicode tables. This provides better diagnostic experience for Embedded
Swift where one does not have to work backwards from a linker failure
to determine where the Unicode normalization tables occur.

Part of rdar://151212706.

Custom availability serialization is based on serializing the
underlying declaration that describes the availability domain. Those
don't exist yet, so conjure up a VarDecl that we use just for the
name. When deserializing based on one of these declarations, do a
lookup into the module. This is quite gross, but lets us do more
experimentation.
Tag the C functions used by the standard library for Unicode
normalization as being part of a new availability domain called
"UnicodeNormalization". Mark anything else that (transitively) depends
on those functions as requiring UnicodeNormalization, so that we get
the full surface area of the standard library that somehow depends on
the Unicode data tables (for normalization).

This availability domain is always available in non-Embedded Swift. In
Embedded Swift, this availability domain is optional: if it's enabled,
one needs to link against the swiftUnicodeDataTables library. If it's
disabled, the compiler will have rejected any code that depends on the
Unicode tables. This provides better diagnostic experience for Embedded
Swift where one does not have to work backwards from a linker failure
to determine where the Unicode normalization tables occur.

Part of rdar://151212706.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant