Commit Graph

21434 Commits

Author SHA1 Message Date
Doug Gregor
8be6286332 Merge pull request #74368 from DougGregor/task-group-iterator-next-isolation
Add a proper `TaskGroup.Iterator.next(isolation:)`
2024-06-13 16:16:24 -07:00
Tim Kientzle
c20ef6de2a Remove RemoteInspection code to fetch no-longer-used reflection metadata
without relying on spare bit information in the reflection metadata
(which was added in #40906).  As a result, we can remove the
code from #40906.

This is the first step in such removal.  It removes the RemoteMirror
code for looking up such metadata.  It leaves behind:

* Sufficient stubs for LLDB to continue to build.  Once LLDB is updated, these stubs can be removed as well.

* The compiler code to emit such metadata.  This allows new binaries to still reflect MPEs on older runtimes.  This will need to be kept for a transitional period.
2024-06-13 09:34:43 -07:00
Alejandro Alonso
79f111a827 Merge pull request #74381 from Azoy/synchronization-build-stuff
[stdlib] Adjust Synchronization module dependencies for macCatalyst
2024-06-13 08:57:42 -07:00
Alex Lorenz
a49eb8eba6 Merge pull request #74348 from hyp/eng/android-stdatomiccxx23
[android] do not import stdatomic from android's libc++
2024-06-13 08:40:01 -07:00
Alejandro Alonso
49e8a73027 Adjust Synchronization module dependencies for macCatalyst 2024-06-12 23:55:51 -07:00
eeckstein
6debc33128 Merge pull request #74332 from eeckstein/swift_dynamiccastclass
embedded: add swift_dynamicCastClass runtime function
2024-06-13 07:31:44 +02:00
Kavon Farvardin
9eba052ab2 Merge pull request #74322 from kavon/se427-noimplicit-for-invertible
SE-427: Make conditional conformances to Copyable more explicit.
2024-06-12 22:03:49 -07:00
Doug Gregor
c5a77fcce5 Add a proper TaskGroup.Iterator.next(isolation:)
Implement this function to pass the isolation through to the task group's
`next(isolation:)`. Fixes rdar://129690995.
2024-06-12 15:57:40 -07:00
Kavon Farvardin
ec4a125f3e NCGenerics: ext's might not infer invertible req's
If the extension adds conformance to an invertible protocol, it's
confusing for people to also infer conditional requirements on the
generic parameters for those invertible protocols. This came up in the
review of SE-427.
2024-06-12 14:44:22 -07:00
Mike Ash
1eed24a9ab Merge pull request #74267 from mikeash/invertible-protocol-checking-key-args-index
[Runtime] Fix key argument indexing when checking invertible protocols.
2024-06-12 15:39:11 -04:00
Alex Lorenz
98b74d8010 [android] do not import stdatomic from android's libc++
android's libc++ uses an older module map that requires C++23 for stdatomic, and thus it fails to compile with anything else
2024-06-12 10:04:14 -07:00
Erik Eckstein
13ecb51612 embedded: add swift_dynamicCastClass runtime function
To enable dynamic class casts

rdar://129672994
2024-06-12 18:23:38 +02:00
Konrad `ktoso` Malawski
8a88569c6b [Distributed] remoteCallVoid is a new requirement in Swift 6.0
And it is handled compatibly because all existing implementations must
have already implemented it before -- it was an ad-hoc requirement
before Swift 6.0, and now it has become a real requirement - the same as
all the other ad-hoc requirements relying on the Serialization
Requirement
2024-06-12 16:32:30 +09:00
Konrad `ktoso` Malawski
3b95855a28 [Distributed] Reword docs since we no longer have ad-hoc requirements 2024-06-12 16:32:30 +09:00
Konrad `ktoso` Malawski
b5dc34984d [Distributed] Typed throws for whenLocal: func must be @_AEIC 2024-06-12 16:32:27 +09:00
Konrad `ktoso` Malawski
fe66c47b8a [docs] Provide more documentation on custom executors with global actors
It could be confusing to adopters who were led to believe by the types
that they should "just" implement the sharedUnownedExecutor property,
but insead they have to implement the unownedExecutor on the specific
actor type.

Adding documentation clarify this as well as a simple test that
exercises this explicitly; We seem to have much coverage of main actor,
but not so much of custom executor global actors.
2024-06-12 12:28:55 +09:00
Kuba (Brecka) Mracek
f97134ca98 Merge pull request #73873 from kubamracek/embedded-mirror-unavailable
[embedded] Make Mirror present but unavailable
2024-06-11 14:37:18 -07:00
Mike Ash
b86fe88c43 [Runtime] Fix key argument indexing when checking invertible protocols.
Track the key argument index separately from the generic parameter index when performing the invertible protocol checking in _checkGenericRequirements. This keeps the indexing correct when a non-key argument is followed by a key argument.

rdar://128774651
2024-06-11 12:39:23 -04:00
Konrad `ktoso` Malawski
bfbceb81c6 Merge pull request #74246 from ktoso/wip-docs 2024-06-11 10:34:17 +09:00
Kuba Mracek
5e1721dd4a [embedded] Make Mirror present but unavailable 2024-06-10 13:40:36 -07:00
Alejandro Alonso
e3a53abe13 Don't use aarch64 hint for arm targets 2024-06-10 09:23:21 -07:00
Konrad `ktoso` Malawski
f245ecf45c [TaskGroup] Fix typo in code snippet 2024-06-10 18:29:38 +09:00
Konrad `ktoso` Malawski
0135623d9a [docs] fix typo in type name in code snippet 2024-06-10 17:21:47 +09:00
Konrad `ktoso` Malawski
d8cba034b3 [docs] remove swift style code highlighting on non-swift snippet 2024-06-10 17:20:57 +09:00
Konrad `ktoso` Malawski
cd0b3f0d4d [docs] Remove line in Task docs that is an error in Swift 6 mode 2024-06-10 17:19:57 +09:00
Karoy Lorentey
ab51f1630c [stdlib] API additions for basic noncopyable primitives
- Add `exchange(_:with:)`
- Add `Optional.take()`
- Add `Unsafe[Mutable]BufferPointer.extracting(_:)`
- Finish generalizing `withExtendedLifetime`
- Radically simplify the implementation of `swap(_:_:)`
2024-06-07 14:09:53 -07:00
Alex Lorenz
c8b5344d3e Merge pull request #72014 from compnerd/android
utils: support building android SDKs on Windows
2024-06-07 12:37:00 -07:00
Alejandro Alonso
73b0ad3622 Merge pull request #74122 from Azoy/dict-builder-condition
[stdlib] Guard for empty singleton in dictionary builder
2024-06-06 15:36:31 -07:00
Alejandro Alonso
b1ceb9b947 Update MutexUnavailable.swift (#74182)
Fixes the availability syntax for minimal platforms.
Resolves: rdar://129345303
2024-06-06 12:46:28 -07:00
Alex Lorenz
30dbf3a4aa do not add ObjectIdentifier+DebugDescription.swift for android builds 2024-06-06 11:19:44 -07:00
Alejandro Alonso
4f8181dde6 Merge pull request #74143 from Azoy/mutex-minimal-thing
[stdlib] Condition Mutex.swift on platform
2024-06-06 07:54:36 -07:00
Tim Kientzle
6c2b772b86 Merge pull request #74145 from tbkka/tbkka-remotemirror-mpe-fixes
Expand the work from #73491 to support more MPE layouts.
2024-06-06 07:31:20 -07:00
Yuta Saito
da6f015e3c Merge pull request #74171 from kateinoigakukun/yt/fix-mutex-wasm-test
[Synchronization] Fix wasm atomic intrinsic declarations
2024-06-06 16:58:32 +09:00
Alex Lorenz
bffb878476 Merge pull request #74160 from hyp/eng/fix-android-synchro
[android] Fix Synchronization Android build
2024-06-05 23:38:47 -07:00
Yuta Saito
2dbbbcf646 [Synchronization] Skip atomic operations in single-threaded mode on WebAssembly
Use of atomics instructions requires the support of threads proposal and
it's not widely supported yet. So we should enable actual atomic
operations only when targeting wasm32-uknown-wasip1-threads.
2024-06-06 04:18:13 +00:00
Yuta Saito
0536c9ac65 [Synchronization] Fix wasm atomic intrinsic declarations
Otherwise, isel will not be able to select the desired atomic
instructions.
2024-06-06 04:18:13 +00:00
Michael Gottesman
db66a207e1 Merge pull request #74151 from gottesmm/pr-89c1f2ab73ad928c312b9bdddb9e2c5cb550439c
[concurrency] Update withUnsafe{,Throwing}Continuation to have a sending result.
2024-06-05 20:06:09 -07:00
Alex Lorenz
5aa63fc93e Merge pull request #72634 from hyp/eng/android/ndk-overlay
[android] add an Android NDK Swift overlay
2024-06-05 19:35:13 -07:00
Alex Lorenz
46502f9249 Merge pull request #72161 from hyp/eng/android-ndk-modulemap
[android] add a module map for Android NDK
2024-06-05 19:35:00 -07:00
Alex Lorenz
74d2a66a27 [androd] Fix Synchronization Android build
Add Android import for Mutex implementation
2024-06-05 16:58:05 -07:00
Tim Kientzle
3895908c67 Sanity: Don't spend too much time (or memory) on rediculously large enums
RemoteMirror gets called on lots of malformed type information,
due to memory corruption bugs or even clients that ask RemoteMirror
to decode a chunk of memory to test whether or not it might be
valid type data.  In any case, we need to be a little cautious here.

In this case, I've chosen to ignore any enum whose in-memory size
(according to the metadata) is over 1 MiB.  We can easily adjust
this limit up if experience shows there really are legitimate enums
this large in the wild.
2024-06-05 16:00:05 -07:00
Tim Kientzle
346d5b22c4 Correct handling of nonsensical Int types
If an Int type makes no sense (it has a nonsensical number
of extra inhabitants, for example), ignore it rather than
treating it as a non-Int type.

Rename `isIntType()` to `intTypeBitSize()` to better document
what this function actually returns.
2024-06-05 14:58:46 -07:00
Alejandro Alonso
fcfbf068a5 Add a special file for mutex on unavailable platforms 2024-06-05 13:51:55 -07:00
Michael Gottesman
5db3b70c65 [concurrency] Update withUnsafe{,Throwing}Continuation to have a sending result.
rdar://129299180
2024-06-05 12:50:59 -07:00
Michael Gottesman
7e8daa80cd [concurrency] Mark the global _emptyDequeStorage as nonisolated(unsafe).
We just use it as a way to initialize values. We will always just read from it
and copy from it.
2024-06-05 12:03:57 -07:00
Alex Lorenz
743a501d1b comment cleanup 2024-06-05 10:53:15 -07:00
Tim Kientzle
40eb3c084d Expand the work from #73491 to support more MPE layouts. This also switches the
MPE layout code to exclusively use the new code.  The key observation: existing
reflection metadata seems to already provide enough information in all cases, so
we can abandon an earlier effort to add spare bitmask data.

Resolves rdar://129281368
2024-06-05 10:15:58 -07:00
Yuta Saito
3b1791a638 [Synchronization] Fix Wasm mutex build
This change fixes the following build error happening on Wasm:
```
error: referencing instance method '_wait(expected:)' on 'Atomic' requires the types '_MutexHandle.State' and 'UInt32' be equivalent
```
2024-06-05 17:15:43 +00:00
Alejandro Alonso
bc0e6ab392 Conditionalize Mutex.swift 2024-06-05 09:20:59 -07:00
Alejandro Alonso
643c2771e2 Merge pull request #71383 from Azoy/mutex
[stdlib] Implement Mutex in Synchronization
2024-06-04 18:38:50 -07:00