Commit Graph

21665 Commits

Author SHA1 Message Date
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
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
Karoy Lorentey
487bacabc0 [stdlib] Delete transparent ~= overload; mark the regular one always-inlined instead
The new overload messes up diagnostics too much.
2025-06-04 17:02:54 -07:00
Karoy Lorentey
a59a6cae58 [stdlib] Add a transparent specialization of ~= for Range
Making the generic ~= transparent does not help unoptimized code; adding a specialization does.
2025-06-04 17:02:51 -07:00
Karoy Lorentey
7cd41df5ce [stdlib] Make PartialRangeFrom.contains transparent
Kudos to @benrimmington for spotting this
2025-06-04 17:02:49 -07:00
Karoy Lorentey
d231213987 [stdlib] On second thought, making ClosedRange.contains(Range) transparent is a bad idea 2025-06-04 17:02:48 -07:00
Karoy Lorentey
7a5dbef390 [stdlib] Mark contains methods on Range/ClosedRange transparent
These are really popular shorthands for implementing bounds checks, but currently they aren’t even marked `@inline(__always)`, so in larger functions they tend to remain outlined, defeating optimizations that would otherwise happen.

The corresponding variants on the partial range types are `@_transparent`; that helps unoptimized performance, so let’s apply the same attribute here.

rdar://151177326
2025-06-04 17:02:45 -07:00
Fabrice de Gans
810588b0c5 line-directive: Stop expanding response files
`line-directive` was expanding response files for the swiftc invocation,
which was causing issues on CI when the file list got too long. This
changes the script to stop expanding response files and pass them as-is
to the swiftc invocation instead. The format for the response files was
also incorrect, with each individual file being quoted, so this fixes
the CMake script generating those.
Finally, this changes `line-directive` to dump the command line on
failure.
2025-06-04 13:16:50 -07:00