This change introduces a new compilation target platform to the Swift compiler - visionOS.
- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
An extension on a class creates a conformance record that's always visible even when that class is not present at runtime. In that case, the type pointer in the conformance record is NULL. The runtime did not like this, and crashed. This fixes it to ignore such records instead.
rdar://problem/54054895
When importing C functions with availability attributes, we don't
properly use that information to decide whether a symbol should be
weak_extern, causing load failures in dylibs that reference these
symbols when deployed to an older OS.
This is a very targeted fix and we need a better architecture for
deciding this.
rdar://problem/26359452
This is needed if we compile StdlibUnittest with -sil-serialize-all
So far I added the imports only in files which needed them. But this may change, depending on the optimizer (inlining).
Adding them in all files doesn't harm and avoids confusion if someone makes an unrelated change which would result in such a linker error.
Add tests that would access Objective-C class metadata by casting and
generic type parameters. Also run these tests with the optimizer turned on.
Swift SVN r30299
This fixes a test failure when appletvos is not enabled. Also, stop trying to
link against a swift source file. This was causing the linker to emit a scary
warning.
Swift SVN r30158
Change ProtocolConformanceRecord::getCanonicalTypeMetadata() to return null if
the class metadata in the protocol conformance record is null. This fixes a
runtime crash in swift_conformsToProtocol when there is a protocol extension of
a missing weakly-linked class.
rdar://problem/21541766
Swift SVN r30012
The goal is to test that we can safely cast to an Objective-C protocol that is
defined in a missing weakly-linked framework, even when the protocol
declaration is missing an availability annotation (this is common in
Objective-C frameworks).
Swift SVN r30010
These tests emulate deploying back to an older OS where newer APIs are not
available by linking to an Objective-C framework where APIs have been
annotated to only be available in the far future and then moving the famework
aside so that it can't be found at run time.
These tests include some basics (global variables and classes), but the focus
is on Objective-C protocols to validate the change allowing types to
conform to protocols less available than the types themselves.
Swift SVN r30005