Rather than storing a mangled name in a Swift protocol descriptor,
which encodes information that is redundant with the context of the
protocol, store an unmangled name as in nominal type descriptors. Update
the various places where this name is used to extract the demangle
tree from the context descriptors.
Reimplement protocol descriptors for Swift protocols as a kind of
context descriptor, dropping the Objective-C protocol compatibility
layout. The new protocol descriptors have several advantages over the
current implementation:
* They drop all of the unused fields required for layout-compatibility
with Objective-C protocols.
* They encode the full requirement signature of the protocol. This
maintains more information about the protocol itself, including
(e.g.) correctly encoding superclass requirements.
* They fit within the general scheme of context descriptors, rather than
being their own thing, which allows us to share more code with
nominal type descriptors.
* They only use relative pointers, so they’re smaller and can be placed
in read-only memory
Implements rdar://problem/38815359.
For now, the accessors have been underscored as `_read` and `_modify`.
I'll prepare an evolution proposal for this feature which should allow
us to remove the underscores or, y'know, rename them to `purple` and
`lettuce`.
`_read` accessors do not make any effort yet to avoid copying the
value being yielded. I'll work on it in follow-up patches.
Opaque accesses to properties and subscripts defined with `_modify`
accessors will use an inefficient `materializeForSet` pattern that
materializes the value to a temporary instead of accessing it in-place.
That will be fixed by migrating to `modify` over `materializeForSet`,
which is next up after the `read` optimizations.
SIL ownership verification doesn't pass yet for the test cases here
because of a general fault in SILGen where borrows can outlive their
borrowed value due to being cleaned up on the general cleanup stack
when the borrowed value is cleaned up on the formal-access stack.
Michael, Andy, and I discussed various ways to fix this, but it seems
clear to me that it's not in any way specific to coroutine accesses.
rdar://35399664
- Standardize on "inlinable" instead of "inlineable", per SE-0193.
- Standardize on "frozen enums" instead of "closed enums", even though
SE-0192 wasn't quite conclusive on this.
- Typealiases are treated as versioned entities for the purpose of
verifying availability.
- Per SE-0193, inlinable functions do not have always-emit-into-client
behavior.
- Rename the fragility attribute for properties and subscripts to
'@inlinableAccess' for now, since '@inlinable' has been implemented
for functions now. (We may still end up choosing to use the same
name for these declarations too.)
- Private and fileprivate entities cannot be '@inlinable' today.
- We implemented the always-emit-into-client change for default
arguments. They also have even stricter restrictions than most
inlinable functions.
- A struct initializer can also assign to 'self' instead of delegating
with `self.init`.
- Disallow adding new associated types to protocols for now.
- Mention that precedence groups exist.
- Mention that '@usableFromInline' exists.
- '@inlinable' can be backdated, even though all the other fragility
attributes cannot.
- Tweak TODO around '@NSManaged'.
- Tweak list of planned proposals.
This document still deserves some more drastic restructuring to
separate the near-term features from the long-term features.
This patch adds SIL-level debug info support for variables whose
static type is rewritten by an optimizer transformation. When a
function is (generic-)specialized or inlined, the static types of
inlined variables my change as they are remapped into the generic
environment of the inlined call site. With this patch all inlined
SILDebugScopes that point to functions with a generic signature are
recursively rewritten to point to clones of the original function with
new unique mangled names. The new mangled names consist of the old
mangled names plus the new substituions, similar (or exactly,
respectively) to how generic specialization is handled.
On libSwiftCore.dylib (x86_64), this yields a 17% increase in unique
source vars and a ~24% increase in variables with a debug location.
rdar://problem/28859432
rdar://problem/34526036
- made the build type consistent across all subprojects
- point out that the release build may crash
- link the Swift compiler and runtime libraries with incremental linking turned off
- suppress expected warnings
- added missing build parameters to the lldb cmake invocation line
- added simple installation instructions
Protocol name mangling didn’t always go through a path that allowed the use
of standard substitutions. Enable standard substitutions for protocol name
manglings where they make sense.
Removes ~277k from the standard library binary size.
Since the mangling scheme and set of standard library types is effectively
fixed now, introduce known mangling substitutions for a number of new
standard library types, filling out the S[A-Za-z] space.
Reduces standard library binary size by ~195k.