SIL: Introduce '@_alwaysEmitIntoClient' attribute for use by standard library

This is like '@inlinable', except that the symbol does not have a public
entry point in the generated binary at all; it is deserialized and a copy
is always emitted into the client binary, with shared linkage.

Just like '@inlinable', if you apply this to an internal declaration it
becomes '@usableFromInline' automatically.

This uses the same mechanism as default arguments ever since Swift 4, so
it should work reasonably well, but there are rough edges with diagnostics
and such. Don't use this if you are not the standard library.

Fixes <rdar://problem/33767512>, <https://bugs.swift.org/browse/SR-5646>.
This commit is contained in:
Slava Pestov
2019-02-15 20:41:59 -05:00
parent c2f8622aa8
commit bd6490b391
13 changed files with 79 additions and 11 deletions

View File

@@ -52,7 +52,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 473; // Last change: assign ownership qualifier
const uint16_t SWIFTMODULE_VERSION_MINOR = 474; // Last change: @_alwaysEmitIntoClient
using DeclIDField = BCFixed<31>;