Kuba (Brecka) Mracek
e8bbedbd08
Merge pull request #68829 from kubamracek/embedded-sdk2
...
[embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2
2023-09-29 12:39:03 -07:00
Tim Kientzle
b35987fdcd
Merge pull request #68720 from tbkka/tbkka-SwiftValue-Equatable
...
Make ObjC isEqual: delegate to Equatable when Hashable isn't available
2023-09-29 12:28:56 -07:00
Kuba Mracek
b9613368f6
[embedded] Check for refcount underflow in embeddded runtime
2023-09-28 09:50:25 -07:00
Kuba Mracek
a1a48b5c83
[embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2
2023-09-28 09:17:32 -07:00
Kuba Mracek
0962d826b3
Revert "[embedded] Resolve empty -sdk path warning in embedded stdlib build"
...
This reverts commit 1b1db053d5 .
2023-09-27 23:10:31 -07:00
Kuba Mracek
bcd7d3f9ec
[embedded] Implement retain_n and release_n in the embedded runtime
2023-09-27 22:55:43 -07:00
Kuba Mracek
85f3b240cf
[embedded] Add swift_initStaticObject to the embedded runtime
2023-09-27 22:21:03 -07:00
Kuba Mracek
7704674620
[embedded] Use -1 as the swift_once predicate indicator, to match Darwin expectations in the compiler
2023-09-27 19:53:38 -07:00
Kuba Mracek
1b1db053d5
[embedded] Resolve empty -sdk path warning in embedded stdlib build
2023-09-27 14:50:25 -07:00
Kuba (Brecka) Mracek
d04741937c
Merge pull request #68790 from kubamracek/embedded-toolchain
...
[embedded] Enable installing the embedded stdlib into the toolchain
2023-09-27 10:03:57 -07:00
Kuba Mracek
da7321af0c
[embedded] Enable installing the embedded stdlib into the toolchain
2023-09-26 20:15:07 -07:00
Kuba Mracek
3cacb3659d
[embedded] Do not emit .swiftinterface files for fragile modules (embedded stdlib, Cxx.swiftmodule)
2023-09-26 17:59:19 -07:00
Kuba Mracek
bb455ddf8b
[embedded] Fix a warning in stdlib build about never executed switch case
2023-09-26 17:16:05 -07:00
Kuba Mracek
b718c506da
[embedded] Fix arm64e pointer signing in embedded heap object destruction
2023-09-26 16:13:03 -07:00
Kuba Mracek
01298a0ddd
[embedded] Expand embedded runtime to handle stack promoted refcounted objects
2023-09-26 09:48:40 -07:00
Kuba Mracek
a835c6ba1f
[embedded] -O and -Osize embedded runtime
2023-09-25 21:28:37 -07:00
Kuba Mracek
cf1d19eb89
[embedded] Add immortalRefCount constant and add TODO comments about refcounting
2023-09-25 19:51:19 -07:00
Kuba Mracek
0758e7da85
[embedded] Use posix_memalign from shims instead of manual declaration
2023-09-25 19:51:19 -07:00
Kuba Mracek
86ad378928
[embedded] Add a simple Swift runtime, written in embedded Swift
2023-09-25 19:51:19 -07:00
Kuba (Brecka) Mracek
67b68d1d87
Merge pull request #68739 from kubamracek/embedded-arm64e
...
[embedded] Start building arm64e embedded stdlib
2023-09-25 19:51:02 -07:00
Kuba Mracek
e82929f65b
[embedded] Add a test showcasing a small runtime handling refcounting and class allocations written in embedded Swift
2023-09-25 13:27:34 -07:00
Kuba Mracek
d8f10f54d4
[embedded] Start building arm64e embedded stdlib
2023-09-25 10:18:49 -07:00
Kuba Mracek
0f1dff40b7
[embedded] Make Unmanaged available in embedded Swift, add a test for various types from the stdlib
2023-09-24 21:21:39 -07:00
Guillaume Lessard
4481cbd864
Merge pull request #68715 from glessard/rdar115912430
2023-09-23 13:11:41 -07:00
Tim Kientzle
659d1cfb13
Make ObjC isEqual: delegate to Equatable when Hashable isn't available
...
When a Swift struct gets bridged to Obj-C, we box it into an opaque
`_SwiftValue` Obj-C object. This object previously supported the
Obj-C `isEqual:` and `hash` selectors by dispatching to the Swift
Hashable conformance, if present.
This does not work if the Swift struct conforms to Equatable but
does not conform to Hashable. This case seems to have been
overlooked in PR #4124 .
This PR extends the earlier work to support `isEqual:` by
first checking for a Hashable conformance, then falling back
on an Equatable conformance if there is no Hashable conformance.
Resolves rdar://114294889
2023-09-22 17:58:22 -07:00
Guillaume Lessard
61080e1f46
[stdlib] remove pointer conversion from inlined runtime code
...
This removes an inout-to-pointer conversion for runtime code that is completely expressed in Swift.
2023-09-22 15:39:00 -07:00
Kuba (Brecka) Mracek
96ef644e04
Merge pull request #68658 from kubamracek/embedded-pointer-conversions
...
[embedded] Un-fatalError array to pointer conversion APIs, add test
2023-09-21 14:52:14 -07:00
Kavon Farvardin
a69bcf8a61
Merge pull request #67930 from kavon/copyable-requirement
...
Copyable as a Requirement Against the Machine
2023-09-21 11:49:23 -07:00
Kavon Farvardin
cc7a41fc2c
[stdilb] introduce Copyable protocol
...
This replaces the old, unavailable `_Copyable`.
rdar://110420673
2023-09-21 00:55:17 -07:00
Kuba Mracek
9898fc2a27
[embedded] Un-fatalError array to pointer conversion APIs, add test
2023-09-20 15:31:46 -07:00
Kuba Mracek
a56a4875c2
[embedded] Make StaticString versions assert/precondition/fatalError available in embedded Swift
2023-09-20 09:35:34 -07:00
Kuba (Brecka) Mracek
d6a8845633
Merge pull request #68614 from kubamracek/embedded-arrays
...
[embedded] Avoid use of a metatype in array implementation for embedded Swift
2023-09-20 07:07:28 -07:00
Kuba (Brecka) Mracek
ad9f316599
Merge pull request #68613 from kubamracek/embedded-exec-tests-on-x86
...
[embedded] Build the stdlib for x86_64 too, and run executable tests on x86_64
2023-09-20 07:02:32 -07:00
Philippe Hausler
029e296b34
Allow Identifiable and correct ObjectIdentifier for embedded variants ( #68597 )
2023-09-19 13:25:32 -07:00
Kuba Mracek
65d706db0d
[embedded] Avoid use of a metatype in array implementation for embedded Swift
2023-09-18 20:36:53 -07:00
Kuba Mracek
e898a9a4fd
[embedded] Build the stdlib for x86_64 too, and run executable tests on x86_64
2023-09-18 20:25:32 -07:00
Guillaume Lessard
469a614eef
Merge pull request #68606 from kubamracek/embedded-int128
...
[embedded] Workaround a build failure in non-assertion embedded stdlib builds, unblock CI
2023-09-18 19:59:41 -07:00
Kuba Mracek
d0cbd893b9
[embedded] Workaround a build failure in non-assertion embedded stdlib builds, unblock CI
2023-09-18 17:37:54 -07:00
Kuba Mracek
5616368f06
[embedded] To unblock failing CI jobs, only build the embedded stdlib when building the compiler for now
2023-09-18 17:06:27 -07:00
Kuba Mracek
89bdcb8dc6
[embedded] Ifdef newly added _assertionFailure + isKnownUniquelyReferenced variants to avoid exposing new APIs outside of embedded Swift
2023-09-17 19:58:15 -07:00
Kuba Mracek
169ed58bee
[embedded] Revert change on FixedWidthInteger protocol requirements, use an empty protocol instead
2023-09-17 17:23:08 -07:00
Kuba Mracek
aa9a881211
[embedded] Drop unintentional change in AssertCommon.swift
2023-09-16 13:45:03 -07:00
Kuba Mracek
c0735eee75
[embedded] Drop unnecessary #if in _makeCollectionDescription
2023-09-16 13:43:43 -07:00
Kuba Mracek
65a57c7811
[embedded] Add an explaining message into StaticString's fatalError
2023-09-16 13:40:43 -07:00
Kuba Mracek
92b075b518
[embedded] Drop several #ifs and fatalError()s by adding an unavailable ExpressibleByStringInterpolation String conformance
2023-09-16 13:40:25 -07:00
Kuba Mracek
cba7cdfad6
[embedded] Drop an unnecessary change in Integers.swift
2023-09-16 13:25:21 -07:00
Kuba Mracek
829967436e
[embedded] Simplify AnyObject/Builtin.NativeObject split in arrays by using a typealias
2023-09-16 13:21:46 -07:00
Kuba Mracek
544ee14c47
[embedded] Provide alternate === and !== implementations instead of trying to switch away from existentials in a unified way
2023-09-16 12:47:34 -07:00
Kuba Mracek
ae2e903574
[embedded] Build an initial embedded Swift standard library
...
This isn't a "complete" port of the standard library for embedded Swift, but
something that should serve as a starting point for further iterations on the
stdlib.
- General CMake logic for building a library as ".swiftmodule only" (ONLY_SWIFTMODULE).
- CMake logic in stdlib/public/core/CMakeLists.txt to start building the embedded stdlib for a handful of hardcoded target triples.
- Lots of annotations throughout the standard library to make types, functions, protocols unavailable in embedded Swift (@_unavailableInEmbedded).
- Mainly this is about stdlib functionality that relies on existentials, type erasure, metatypes, reflection, string interpolations.
- We rely on function body removal of unavailable functions to eliminate the actual problematic SIL code (existentials).
- Many .swift files are not included in the compilation of embedded stdlib at all, to simplify the scope of the annotations.
- EmbeddedStubs.swift is used to stub out (as unavailable and fatalError'd) the missing functionality.
2023-09-16 12:38:46 -07:00
Kuba Mracek
b625bf9e25
[stdlib] Remove the essential/non-essential file split in the stdlib
2023-09-13 16:31:58 -07:00