For resilient classes, we hide method symbols if possible, to
enforce that only resilient access patterns are used to call
and override methods.
Final methods can be referenced directly, however, but we were
incorrectly hiding them anyway if they were overrides. To consider
overrides differently here only makes sense in the non-resilient
case; in fact this was a regression from <rdar://problem/55559104>,
which fixed a bug with non-resilient classes by adding this check.
I tried to add comments and clean up the logic here a bit to be
less confusing in the future.
Fixes <rdar://problem/57864425>.
This was done even for non-public inits because subclasses would always
override the base class's designated initializers, even if they were
inaccessible.
This is an ABI break, however in practice the only affected class
initializer was ManagedBuffer.init(_doNotCallMe:()), and we can just
make it @usableFromInline.
Private methods of non-resilient classes can be referenced from
outside the module, but resilient classes build the vtable at
runtime so we don't need that hack there.
This adds the dllstorage annotations on the tests. This first pass gets
most of the IRGen tests passing on Windows (though has dependencies on
other changes). However, this allows for the changes to be merged more
easily as we cannot regress other platforms here.
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.
Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.
Use the 'swiftself' attribute on self parameters and for closures contexts.
Use the 'swifterror' parameter for swift error parameters.
Change functions in the runtime that are called as native swift functions to use
the swift calling convention.
rdar://19978563
This prevents the linker from trying to emit relative relocations to locally-defined public symbols into dynamic libraries, which gives ld.so heartache.
And include some supplementary mangling changes:
- Give the first generic param (depth=0, index=0) a single character mangling. Even after removing the self type from method declaration types, 'Self' still shows up very frequently in protocol requirement signatures.
- Fix the mangling of generic parameter counts to elide the count when there's only one parameter at the starting depth of the mangling.
Together these carve another 154KB out of a debug standard library. There's some awkwardness in demangled strings that I'll clean up in subsequent commits; since decl types now only mangle the number of generic params at their own depth, it's context-dependent what depths those represent, which we get wrong now. Currying markers are also wrong, but since free function currying is going away, we can mangle the partial application thunks in different ways.
Swift SVN r32896
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK. The driver was defaulting to the
host OS. Thus, we could not run the tests when the standard library was
not built for OS X.
Swift SVN r24504
Methods which go into a vtable must be at least as visible as their classes.
Otherwise derived classes from "outside" cannot reference such base methods in their vtables.
Swift SVN r22889