Commit Graph

21434 Commits

Author SHA1 Message Date
Karoy Lorentey
0c406b89e6 [stdlib] Allow metatype comparisons to work with outdated compilers
Add a new language feature to avoid the stdlib’s swiftinterface becoming unintelligible to outdated compiler builds due to the generalization of Builtin.is_same_metatype.

rdar://149396721
2025-04-16 12:45:09 -07:00
Doug Gregor
d0812a4143 Merge pull request #80838 from DougGregor/relative-witness-tables-isolation-check
[Runtime] Handle relative witness tables in _getIsolationCheckingOptionsFromExecutorWitnessTable
2025-04-16 08:54:08 -07:00
Alejandro Alonso
ace5c20b12 Merge pull request #78248 from Azoy/value-generic-static-member
[NameLookup] Allow value generics to show up as static members
2025-04-16 08:03:46 -07:00
Konrad `ktoso` Malawski
2dd6348898 Merge pull request #80821 from ktoso/wip-refine-scheduling-of-task-start-synchronously
[Concurrency] Improve in order synchronous enqueue of startSynchronously
2025-04-16 16:42:37 +09:00
Doug Gregor
5f0043711c [Conformance cache] Handle missing protocol descriptors
This can happen when running against an older version of a library that
doesn't have the protocol defined.
2025-04-15 21:11:19 -07:00
Doug Gregor
aeb7056991 [Runtime] Don't use the low bit of a WitnessTable pointer in the conformance cache
With relative witness tables, the low bit of a witness table pointer is
an indicator that we need to load from the given pointer. We were also
using the low bit of the witness table pointer in the conformance
cache entry as part of a pointer union. Hilarity ensures [*].

Switch to another low bit by exploding the conformance cache key
into separate fields and taking the low bit of one of those pointers
that isn't reserved.

Fixes the remainder of rdar://149326058, I hope.

[*] No, I am not laughing.
2025-04-15 18:12:18 -07:00
Meghana Gupta
198a802719 Merge pull request #80767 from meg-gupta/reverttransparent
Revert #79707
2025-04-15 15:45:15 -07:00
Doug Gregor
663ef8aa2e [Runtime] Handle relative witness tables in _getIsolationCheckingOptionsFromExecutorWitnessTable
Part of rdar://148687148.
2025-04-15 13:47:26 -07:00
Guillaume Lessard
3670664ce6 [stdlib] use “LifetimeDependenceMutableAccessors” 2025-04-15 10:41:27 -07:00
Konrad 'ktoso' Malawski
a24a28c217 [Concurrency] Improve in order synchronous enqueue of startSynchronously
Previously there was still a sneaky hop which caused ordering issues.
This introduced a specific test startSynchronously_order which checks
that the task enqueues indeed are "immediate" and cleans up how we
handle this.

This also prepares for the being discussed in SE review direction of
this API that it SHOULD be ALLOWED to actually hop and NOT be
synchronous at all IF the isolation is specified on the closure and is
DIFFERENT than the callers dynamic isolation.

This effectively implements "synchronously run right now if dynamically
on the exact isolation as requested by the closure; otherwise enqueue
the task as usual".

resolves rdar://149284186
cc @drexin
2025-04-15 19:59:15 +09:00
Alejandro Alonso
b3f3dd79cf Handle dynamically accessing the static member from type(of:) 2025-04-14 15:32:46 -07:00
QuietMisdreavus
41120da702 [SymbolGraphGen] add flags to filter platforms out of availability metadata (#80778)
* add option to filter availability metadata in symbol graphs

* filter out platform-specific availability in the stdlib docs

rdar://144379124
2025-04-14 15:20:22 -07:00
Alejandro Alonso
c384db5b91 Merge pull request #80658 from Azoy/public-cell
[stdlib] Make _Cell public
2025-04-14 12:07:46 -07:00
Guillaume Lessard
524b717944 [stdlib] work around autoclosure issues
- The move-only checker has issues with the existence of autoclosures.
- These `borrowing` accessors are within the purview of the move-only checker.
2025-04-14 10:48:42 -07:00
Guillaume Lessard
2d50c6cce9 Revert "[temporary] disable small-string support"
This reverts commit ea44ff9fc9.
2025-04-14 10:48:42 -07:00
Konrad `ktoso` Malawski
aaec5aa124 Merge pull request #80794 from ktoso/wip-parent-cancel-must-cancel-group
[Concurrency] Parent task cancellation must cancel task group itself.
2025-04-15 01:02:36 +09:00
Mykola Pokhylets
90cac69a4e Use concrete SwiftStdlib version 2025-04-14 16:58:43 +02:00
Konrad `ktoso` Malawski
cebc4d7269 Merge pull request #80793 from swiftlang/ktoso-patch-19
Avoid unused variable warning
2025-04-14 20:40:21 +09:00
Konrad 'ktoso' Malawski
94423da6d3 [Concurrency] Refactor _swift_taskGroup_cancelAllChildren -> _cancel
This way we do the right thing always when cancelling the group;
and we MAY visit the child tasks if we have to.
2025-04-14 17:30:28 +09:00
Alastair Houghton
352907fc3e Merge pull request #80758 from al45tair/eng/PR-149058236
[Concurrency] Remove -executor-factory option and replace with magic type.
2025-04-14 09:21:25 +01:00
Konrad 'ktoso' Malawski
80f384958a [Concurrency] Parent task cancellation must cancel task group itself.
Seems that during refactorings of child cancellations we somehow missed
also cancelling the group itself. It seems we did not have good test
coverage of the addTaskUnlessCancelled somehow and thus this slipped
through.

This adds a regression test for addTaskUnlessCancelled and fixes how we
handle the cancellation effect in TaskStatus.

resolves #80789
resolves rdar://149177600
2025-04-14 17:06:44 +09:00
Konrad `ktoso` Malawski
7dcdd30fe0 Avoid unused variable warning 2025-04-14 16:00:07 +09:00
Guillaume Lessard
1f93566d69 Merge pull request #80517 from glessard/rdar138440979-MutableSpan-mutableBytes
[SE-0467] add mutableBytes to MutableSpan
2025-04-13 10:33:09 -07:00
Mykola Pokhylets
d8cbaebbd4 Added explicit availability attribute for each protocol requirement
To fix failing test/api-digester/stability-concurrency-abi.test
2025-04-13 13:23:56 +02:00
Mykola Pokhylets
1b2e03189b Added Hashable conformance to Async(Throwing)Stream.Continuation 2025-04-12 14:12:54 +02:00
Alastair Houghton
8310c8aa69 Merge pull request #80761 from al45tair/eng/PR-149067144
[Concurrency] Fix size of AsyncTask::PrivateStorage.
2025-04-12 10:36:14 +01:00
Michael Ilseman
e6e4bd6056 UTF8Span (#78531)
Add support for UTF8Span

Also, refactor validation and grapheme breaking
2025-04-11 16:11:11 -06:00
Max Desiatov
99a4b887f9 NFC: fix comment in WasmImpl.swift (#80760)
Wasm is not an acronym, thus it's not uppercased [per the spec](https://webassembly.github.io/spec/core/intro/introduction.html#wasm).
2025-04-11 12:30:01 -07:00
Meghana Gupta
f462bc5d93 Revert "Merge pull request #79707 from DougGregor/transparent-integer-conversions"
This reverts commit 9c2c4ea07f, reversing
changes made to 829e03c104.
2025-04-11 10:42:17 -07:00
Alastair Houghton
ef3ea9bd27 [Concurrency] Fix size of AsyncTask::PrivateStorage.
Because `TaskAllocator` is not a round multiple of the machine word
size on 64-bit platforms, I think we end up with padding before the
`TaskLocal::Storage` following it, which makes the `PrivateStorage`
structure larger than the calculation in `ABI/Task.h`.

rdar://149067144
2025-04-11 17:12:16 +01:00
Kuba (Brecka) Mracek
c119f3fd76 Merge pull request #80725 from kubamracek/embedded-concurrency-for-non-darwin
[embedded] Start building Concurrency.swiftmodule/.a for non-Darwin target triples too
2025-04-11 07:59:23 -07:00
Alastair Houghton
94b054479b [Concurrency] Remove -executor-factory option and replace with magic type.
We decided that using a magic typealias to set the executor factory was better
than using a compiler option. Remove the `-executor-factory` option, and replace
by looking up the `DefaultExecutorFactory` type, first in the main module, and
then if that fails in Concurrency.

rdar://149058236
2025-04-11 13:55:38 +01:00
Mike Ash
433ca8ea81 Merge pull request #80516 from mikeash/function-cast
[Runtime] Add function_cast, switch from std::bit_cast.
2025-04-11 05:15:25 -04:00
Mike Ash
185b739cf1 [Runtime] Add function_cast, switch from std::bit_cast.
Function types aren't always trivially copyable, e.g. with address-discriminated signed pointers on ARM64e. Introduce a function_cast helper and use that instead.
2025-04-10 20:29:02 -04:00
Kuba (Brecka) Mracek
faefcfd413 [embedded] Also build Concurrency module for x86_64 2025-04-10 16:39:57 -07:00
Kuba Mracek
24507dc37e [embedded] Concurrency/CMakeLists.txt: Use -isystem instead of -I for SDK search paths 2025-04-10 12:22:20 -07:00
Kuba Mracek
08c8b416b4 [embedded] Start building Concurrency.swiftmodule/.a for non-Darwin target triples too 2025-04-10 10:32:33 -07:00
Guillaume Lessard
cb390140d6 [stdlib] correct MutableRawSpan sizing 2025-04-10 10:31:18 -07:00
Guillaume Lessard
53b6b45bda [stdlib] update lifetime annotation syntax 2025-04-10 10:31:18 -07:00
Guillaume Lessard
77431f5217 [stdlib] add MutableSpan.mutableBytes 2025-04-10 10:31:05 -07:00
Meghana Gupta
fc90619254 Add @_transparent to some integer operations in the stdlib
@_transparent will ensure there are inlined in MandatoryInlining which runs before OSLogOptimization.

OSLogOptimization does not look through their calls because they are not marked with
@_semantics("constant_evaluable") which requires them to also be annotated as @_optimize(none)

rdar://148256435
2025-04-10 07:24:02 -07:00
Max Desiatov
cb0e1da0cb Revert "Revert "Concurrency: Move code between Executor{Bridge,Impl}.cpp"" (#80692)
* Revert "Revert "Concurrency: Move code between `Executor{Bridge,Impl}.cpp`""

* Update CMakeLists.txt
2025-04-10 05:35:28 -07:00
Slava Pestov
822083872b Merge pull request #80678 from slavapestov/visionos-stdlib
CompatibilitySpan: Fix stdlib build on visionOS
2025-04-10 07:55:49 -04:00
Guillaume Lessard
5c54e3aea5 Merge pull request #80257 from glessard/rdar137710901-addressable-span-properties
[SE-0456, -0467] enable span properties for inline-storage types
2025-04-09 19:51:46 -07:00
Artem Chikin
ef6cf5785b Revert "Concurrency: Move code between Executor{Bridge,Impl}.cpp (#80601)"
This reverts commit ccd9cf7b5e.
2025-04-09 11:07:31 -07:00
Mike Ash
ee5290a5ee Merge pull request #80600 from mikeash/check-witness-table-isolation-ptrauth
[Runtime] Handle relative witness tables in _checkWitnessTableIsolation.
2025-04-09 13:14:48 -04:00
Mike Ash
4290f0add4 Merge pull request #80447 from mikeash/fix-task-sizes
[Concurrency] Fix task status and private storage sizes.
2025-04-09 13:14:40 -04:00
Kuba Mracek
55f12fe13a [embedded] Add back LosslessStringConvertible to Bool and integer types 2025-04-09 10:08:58 -07:00
Guillaume Lessard
79fb06faf3 [stdlib] update lifetime annotation syntax 2025-04-09 09:56:06 -07:00
Guillaume Lessard
f931d296a2 [stdlib] add InlineArray.mutableSpan 2025-04-09 09:56:06 -07:00