Commit Graph

21821 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
1ea746ec52 Merge branch 'main' into wip-deprecate-extractisolation 2025-06-16 11:37:19 +09:00
Mike Ash
ec6a042831 [Runtime] Remove redundant swift_auth_code_function, use existing swift_auth_code.
rdar://153169049
2025-06-13 18:46:23 -04:00
Egor Zhdan
607dd4a7d4 [cxx-interop] Import nullability of templated function parameters correctly
This teaches ClangImporter to respect the `_Nonnull`/`_Nullable` arguments on templated function parameters.

Previously Swift would only import a non-annotated function overload. Using an overload that has either  `_Nonnull` or `_Nullable` would result in a compiler error. The non-annotated overload would get imported with incorrect nullability: Swift would always assume non-null pointers, which was inconsistent with non-templated function parameters, which are mapped to implicitly unwrapped optionals.

With this change all three possible overloads are imported, and all of them get the correct nullability in Swift.

rdar://151939344
2025-06-13 18:15:52 +01:00
Konrad 'ktoso' Malawski
c00946189c [Concurrency] Deprecate extractIsolation 2025-06-13 11:47:37 +09:00
Alastair Houghton
7a359a5e09 Merge pull request #82202 from al45tair/eng/PR-153152063
[Concurrency] Fix null pointer dereference for task-to-thread model.
2025-06-12 18:32:08 +01:00
Stephen Canon
c24bae70e8 Fixup Observations availability from 9999 to 6.2 (#82198) 2025-06-12 09:10:24 -04:00
Guillaume Lessard
3b9ec94f20 Merge pull request #82102 from valeriyvan/span
Fix parameter, doc comments in Span family
2025-06-12 04:41:50 -07:00
Alastair Houghton
69a2011f4f [Concurrency] Fix null pointer dereference for task-to-thread model.
In task-to-thread concurrency mode, `_getMainExecutorAsSerialExecutor`
returns `SerialExecutorRef::generic()`, which is, give or take, NULL.
Unfortunately we'd declared it as returning `any SerialExecutor`,
rather than `(any SerialExecutor)?`, and then the `getMainExecutor()`
function was calling `asUnownedSerialExecutor()` on it, which then
crashes.

rdar://153152063
2025-06-12 11:36:16 +01:00
Dan Blackwell
665515c781 Merge pull request #82158 from swiftlang/tsan-release-fix
[concurrency] Move tsan_release to point before task gets destroyed
2025-06-12 08:26:49 +01:00
Konrad `ktoso` Malawski
01f911a36b Merge pull request #82179 from ktoso/wip-fix-incorrect-memory-effects-on-task-create 2025-06-12 13:42:32 +09:00
Allan Shortlidge
71eede247f StdlibUnittest: Use @_lifetime instead of @lifetime.
Resolves a warning.
2025-06-11 12:49:43 -07:00
Joe Groff
b3273f700c Merge branch 'main' into rhombicuboctahedron 2025-06-11 06:40:58 -07:00
Konrad 'ktoso' Malawski
3aa28b4de9 [Concurrency] Correct memory effect attributes of task_create
Without this, llvm would sometimes wrongly assume there's no indirect
accesses and the optimizations can lead to a runtime crash, by
optimizing away initializing options properly.

Resolves rdar://152548190
2025-06-11 22:03:52 +09:00
Susana Monteiro
6164af2f46 Merge pull request #81832 from swiftlang/susmonteiro/class-metadata-private-fields
[cxx-interop] Support for printing C++ foreign references
2025-06-11 11:58:45 +01:00
Philippe Hausler
af76f1440c Convert DispatchGlobalExecutor deadline casts to a decltype based cast (which should hold on all platforms) 2025-06-10 22:11:05 -07:00
Mohamed Hegazy
43b49dd6a4 Add explicit cast to non-apple platforms 2025-06-10 19:01:32 -07:00
Saleem Abdulrasool
9f5c090206 Merge pull request #82125 from Steelskin/fabrice/symlink-clang-headers-static-dep
build: Ensure static headers are always symlinked
2025-06-10 12:46:21 -07:00
Saleem Abdulrasool
897fd5a56d Merge pull request #82126 from Steelskin/fabrice/stdlib-add-vcruntime-dep
modulemap: Add missing dependency on vcruntime
2025-06-10 12:41:41 -07:00
Philippe Hausler
d9c73d303e [Observation] Initial implementation of Observed for transactional tracked values over time (#79817)
This is an implementation for the feature
https://github.com/swiftlang/swift-evolution/pull/2726
2025-06-10 12:22:23 -07:00
Dan Blackwell
100a4e096c [concurrency] Move tsan_release to point before task gets destroyed
rdar://152501929
2025-06-10 19:35:46 +01:00
Philippe Hausler
1e0b9148df static cast the tv_sec for the timespec constructions is the dispatch scheduler 2025-06-10 09:11:10 -07:00
susmonteiro
848fad0021 [cxx-interop] Support for printing C++ foreign references 2025-06-10 12:15:21 +01:00
Fabrice de Gans
5d50279c2a build: Ensure static headers are always symlinked
When using the Swift static build on Windows, projects like Foundation
use the clang headers from the toolchain build `lib` directory. No
target in the toolchain build depends on the static clang headers, so
they do not get installed. As a workaround, this makes the static clang
headers symlink target a dependency of the regular dynamic version of
the headers, ensuring they are installed as part of the toolchainb
build.
2025-06-09 15:27:13 -07:00
Fabrice de Gans
4596a04f6a modulemap: Add missing dependency on vcruntime
`stdlib.h` includes `limits.h`, which is defined in the `vcruntime`
module.
2025-06-09 15:20:58 -07:00
Ian Anderson
034bfa1bea Merge pull request #82094 from ian-twilightcoder/builtin-float-embedded
[embedded][overlay] _Builtin_float and Synchronization cannot be imported in embedded Swift mode
2025-06-09 13:45:43 -07:00
Valeriy Van
b1082d400f Update stdlib/public/core/Span/RawSpan.swift
Co-authored-by: Guillaume Lessard <glessard@tffenterprises.com>
2025-06-09 20:14:46 +03:00
Valeriy Van
e49050a42a Update stdlib/public/core/Span/RawSpan.swift
Co-authored-by: Guillaume Lessard <glessard@tffenterprises.com>
2025-06-09 20:14:25 +03:00
Philippe Hausler
694aebb1fb Add an additional case for clocks to sleep with a wallclock deadline (#79139)
This only modifies the runtime function `swift_task_enqueueGlobalWithDeadline` to take new clock primitive to
interoperate with existing dispatch wall clock values.
2025-06-09 09:01:27 -07:00
Valeriy Van
83d3d4b3cb Fix doc comment 2025-06-09 18:01:36 +03:00
Valeriy Van
1c0306871c Revert "Rename parameter count => byteCount to make signature match doc comment and match other methods"
This reverts commit 4129383ba7.
2025-06-09 17:59:13 +03:00
Valeriy Van
43ead66f42 Fix doc comment 2025-06-09 11:56:45 +03:00
Valeriy Van
4129383ba7 Rename parameter count => byteCount to make signature match doc comment and match other methods 2025-06-09 11:56:06 +03:00
Valeriy Van
505d55c4d1 Add type parameter to make code match doc comment 2025-06-09 11:54:44 +03:00
Ian Anderson
8bbee17b88 [embedded][overlay] _Builtin_float and Synchronization cannot be imported in embedded Swift mode
The _Builtin_float and Synchronization modules are getting the SDK_NAME encoded in their embedded modules, preventing them from being used outside of macOS in embedded mode.
2025-06-08 13:53:23 -07:00
Guillaume Lessard
2afb6b5012 Merge pull request #82077 from glessard/issue81931
[stdlib] fix utf8Span accessors for small strings
2025-06-08 03:10:15 -07:00
Valeriy Van
c14699310f Fix typo (#82052) 2025-06-07 23:16:43 -04:00
Guillaume Lessard
c7324389d9 [stdlib] fix small string usage for Substring.utf8Span 2025-06-07 07:48:33 -07:00
Guillaume Lessard
83edacbcc6 [stdlib] fix small-string usage for String.utf8Span 2025-06-07 07:48:33 -07:00
Guillaume Lessard
3a96d085c7 Merge pull request #82064 from glessard/generalize-expectNotNil
[stdlibUnittest] generalize `expectNotNil(_:)`
2025-06-06 22:04:59 -07:00
Jamie
f7560c0189 [docs][NFC]: minor formatting edits to SendableMetatype docs 2025-06-06 21:38:48 -05:00
Guillaume Lessard
d38b961cb7 Merge pull request #82013 from glessard/rdar152615917-addressable-string-types
[stdlib] adjust addressable attribute on String type family
2025-06-06 16:55:57 -07:00
Guillaume Lessard
5895077382 [stdlibUnittest] generalize expectNotNil(_:)
Generalizes it for non-copyable and non-escapable values.
2025-06-06 09:14:27 -07:00
Guillaume Lessard
9e8019a0fe [stdlib] make annotation adjustments 2025-06-06 08:21:48 -07:00
Doug Gregor
89628ab2ec Merge pull request #82040 from DougGregor/sendable-metatype-docs 2025-06-06 08:04:32 -07:00
Karoy Lorentey
e47397730b Merge pull request #81458 from lorentey/range-contains-perf
[stdlib] Mark `contains` methods on `Range/ClosedRange` transparent
2025-06-06 04:12:18 -07:00
Karoy Lorentey
ff3cf98a2d [stdlib] ClosedRange.contains: Leave this force-inlined, not transparent
Making it transparent evidently induces new retain/release traffic in Array’s subscript, even though I can find no indication that `ClosedRange.contains` is ever called by that code path. Oh well.
2025-06-05 19:42:20 -07:00
Doug Gregor
55d5de6218 Fix more typos 2025-06-05 18:10:43 -07:00
Doug Gregor
a5554a4840 Fix typos 2025-06-05 18:10:01 -07:00
Doug Gregor
9ab0c57ee9 Improve SendableMetatype documentation 2025-06-05 16:53:55 -07:00
Saleem Abdulrasool
68524a8a62 Merge pull request #81951 from Steelskin/fabrice/ucrt-modulemap-26100-3916
Platform: Windows SDK 26100.3916 module map update
2025-06-05 10:00:06 -07:00