Commit Graph

21803 Commits

Author SHA1 Message Date
Jonathan Grynspan
3195c28b8d Add WinSDK.GDIPlus Clang module. (#83425) 2025-07-31 07:08:51 -07:00
Alastair Houghton
796da7aa08 Merge pull request #83327 from al45tair/eng/PR-156701386
[Concurrency] Fix task switch performance issue.
2025-07-31 12:31:09 +01:00
Allan Shortlidge
04852d0a61 Merge pull request #83437 from tshortli/const-has-no-effect
stdlib: Fix warning about superfluous 'const' on return type
2025-07-30 23:29:14 -07:00
Allan Shortlidge
c82b9ed5ae stdlib: Fix warning about superfluous 'const' on return type.
Resolves the following warnings:

```
stdlib/public/SwiftShims/swift/shims/CoreFoundationShims.h:86:1: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
   86 | const _swift_shims_NSUInteger
      | ^~~~~
stdlib/public/stubs/FoundationHelpers.mm:110:1: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
  110 | const _swift_shims_NSUInteger
      | ^~~~~
```
2025-07-30 12:45:46 -07:00
Guillaume Lessard
f0b454559e Merge pull request #83416 from glessard/also-available-now 2025-07-30 11:48:19 -07:00
Alastair Houghton
a55008066d [Concurrency] Further improve performance.
Remove some reference counting traffic by using `Unowned*Executor`s.

Also, add a test to make sure we stay on the fast path.

rdar://156701386
2025-07-30 13:41:04 +01:00
Guillaume Lessard
f6a7c61245 [stdlib] fix availability of Span.bytes 2025-07-29 17:19:34 -07:00
Egor Zhdan
0266913348 Merge pull request #83395 from egorzhdan/egorzhdan/stl-xsmf-control
[cxx-interop] Modularize xsmf_control on Windows
2025-07-29 21:57:15 +01:00
Alejandro Alonso
19b8bed884 Change the builtin used to get the address for Atomic 2025-07-29 09:33:44 -07:00
Marc Prud'hommeaux
663ec9340d Support 16 KB page sizes on Android (#81596)
Android 15+ requires that native libraries be compiled with a linker
flag to support 16 KB page sizes. See:
https://developer.android.com/guide/practices/page-sizes#compile-r26-lower
2025-07-29 20:42:22 +05:30
Egor Zhdan
a818de1588 [cxx-interop] Modularize xsmf_control on Windows
This adds `xsmf_control.h` into the STL modulemap on Windows.

Fixes the following compiler error emitted by Clang when trying to use `std::variant` from Swift with C++ interop:
```
...\MSVC\14.42.34433\include\variant:923:25: error: missing '#include <xsmf_control.h>'; '_Non_trivial_move_assign' must be defined before it is used
```
2025-07-29 14:30:34 +01:00
Alastair Houghton
2b4082e4f9 [Concurrency] Fix task switch performance issue.
When using the new custom default executors, sometimes we end up
taking a long time to do a task switch.  This is happening because
the path the new code takes sometimes results in a concrete pointer
to the default global executor being in the executor tracking
information in `swift_task_switch()`, and if we try to switch to
a `nil` task executor (which _also_ means the default global executor),
we aren’t spotting that and we’re taking the slow path.

Essentially, we want to take the fast path in cases where we switch
from `nil` to the concrete default global executor and vice-versa.

rdar://156701386
2025-07-28 15:49:46 +01:00
Alastair Houghton
d0cf535664 Merge pull request #83330 from al45tair/eng/PR-156710569
[Concurrency] Update availability of UnimplementedExecutor.
2025-07-28 12:42:12 +01:00
Pavel Yaskevich
da1f8b2f29 Merge pull request #83342 from xedin/remove-startSynchronously
[Concurrency] Remove deprecated `Task.startSynchronously` API
2025-07-26 09:03:41 -07:00
David Smith
cee927e2d5 Fix lengthOfBytes(using:) semantics (#83334)
Fixes rdar://156675395
2025-07-25 16:29:45 -07:00
Guillaume Lessard
bf80c2f90f Merge pull request #83160 from glessard/typedThrows-array-init
[stdlib] Generalize `Array(unsafeUninitializedCapacity:initializingWith:)` for typed throws
2025-07-25 14:54:45 -07:00
Pavel Yaskevich
95d4ef5756 [Concurrency] Remove deprecated Task.startSynchronously API
This is the original spelling which was not accepted. We kept
it for a bit to give adopters time to switch but it's time to
remove it now.
2025-07-25 13:15:02 -07:00
Guillaume Lessard
8b0bde8eb0 [SwiftOnoneSupport] information about the list of symbols 2025-07-25 09:29:25 -07:00
Guillaume Lessard
3a963a6957 [stdlib] generalize Array(unsafeUninitializedCapacity:initializingWith:) 2025-07-25 09:29:19 -07:00
Alastair Houghton
f27e20a3e7 [Concurrency] Update availability of UnimplementedExecutor.
We need it to be `StdlibDeploymentTarget 6.2` rather than
`SwiftStdlib 6.2`, so that we can update the availability definitions.

rdar://156710569
2025-07-25 17:02:48 +01:00
Slava Pestov
ca50986f3a Merge pull request #83308 from slavapestov/fix-rdar156095800
Embedded Swift: Fix === and !== with existential
2025-07-25 08:41:38 -04:00
David Smith
a5e6b8556a Make sure SwiftObject doesn't crash when compared to tagged pointers (#83269)
Fixes rdar://152912840
2025-07-24 17:31:01 -07:00
Slava Pestov
b7766b6361 stdlib: Use the original === and !== operators on embedded
It seems that the restriction preventing these from working was
lifted.

The behavioral difference is that in Swift 5 mode, we don't
actually open AnyObject like this, so the old operator could
not be used with class-bound existentials.

I added a trivial test case just to ensure that calls to ===
type check correctly in both language modes.

Fixes rdar://156095800.
2025-07-24 15:25:30 -04:00
Max Desiatov
31e92db5b2 Executor.swift: only enable MainActor in Embedded Swift for WASI 2025-07-24 16:03:06 +01:00
Max Desiatov
5c5358b5df Enable more MainActor code paths for Embedded Swift 2025-07-24 14:58:21 +01:00
Justice Adams
d454771ee2 [CMAKE] Fix layering issue between Concurrency and Darwin overlay (#82973)
Concurrency from the Core project is importing the Darwin platform
overlay, which in turn depends on SwiftCore from the Core project,
breaking the project layering.

Concurrency only needs the Clang module, but Swift does not have a
mechanism to only import a clang module. For now import the
functionality needed from Darwin by importing and wrapping the
associated functions from `<dlfcn.h>` within `CFExecutor.cpp`

Also remove Darwin import from `AsyncStreamBuffer.swift` because it is
not used
2025-07-23 16:04:14 -07:00
Meghana Gupta
83399f93e0 Merge pull request #83111 from meg-gupta/lifediag
Diagnose @_lifetime on targets that are Escapable
2025-07-22 22:54:35 -07:00
eeckstein
18b02a7c70 Merge pull request #83172 from eeckstein/span-bounds-checking
Improve Span bounds check elimination by adding `_assumeNonNegative` to `count`
2025-07-22 22:00:43 +02:00
Alejandro Alonso
12a4415f28 Merge pull request #82392 from 3405691582/openbsd_mutex_pthread
Use libpthread primitives for OpenBSD mutexes.
2025-07-22 12:48:11 -07:00
Meghana Gupta
222ee7389a Diagnose @_lifetime on targets that are Escapable
Lifetime dependencies can be attached to ~Escapable types only
2025-07-22 06:00:38 -07:00
Max Desiatov
7ada71b7a5 Merge pull request #82331 from swiftlang/maxd/embedded-wasm-concurrency
Enable `MainActor` in embedded concurrency, add `ExecutorImpl.cpp`

`ExecutorImpl.cpp` should be moved from `SWIFT_RUNTIME_CONCURRENCY_NONEMBEDDED_C_SOURCES` to `SWIFT_RUNTIME_CONCURRENCY_C_SOURCES`. This way we can also include `ExecutorImpl.swift` and use `PlatformExecutorCooperative.swift` in embedded concurrency for WASI.
2025-07-22 12:52:38 +01:00
Erik Eckstein
b540204a64 stdlib: specify the count of Span and MutableSpan as _assumeNonNegative 2025-07-22 12:24:58 +02:00
Erik Eckstein
cf16c1b19f stdlib: revert workaround for Span bounds checking 2025-07-22 12:21:37 +02:00
Stephen Canon
ee9b38ca22 Use an explicit unsigned comparison for span index checks (#83150)
LLVM ought to be able to do this transformation for us, but it currently fails to do so. We can code around it easily enough. https://github.com/swiftlang/swift/pull/83172 has a better long-term fix.
2025-07-21 16:06:17 -04:00
Michael Ilseman
bed6408712 Better docs for UTF8Span (#83184)
Co-authored-by: Alex Martini <amartini@apple.com>
2025-07-21 11:02:29 -06:00
Stephen Canon
337b20e8ed Remove some redundant unsafe markings (#83192)
We were getting warnings about these; remove them to cut down on noise.
2025-07-21 11:22:13 -04:00
Max Desiatov
9cdfc28117 Embedded: exclude ExecutorImpl.swift for non-Wasm platforms 2025-07-21 15:57:22 +01:00
Max Desiatov
05f3f1ffc5 Embedded: only include ExecutorImpl.cpp for Wasm 2025-07-21 15:52:59 +01:00
Max Desiatov
5150a6b1eb Only enable MainActor for WASI with Embedded Swift 2025-07-21 15:42:15 +01:00
Max Desiatov
959e75bac0 Enable MainActor in embedded concurrency, add ExecutorImpl.cpp
`ExecutorImpl.cpp` should be moved from `SWIFT_RUNTIME_CONCURRENCY_NONEMBEDDED_C_SOURCES` to `SWIFT_RUNTIME_CONCURRENCY_C_SOURCES`. This way we can also include `ExecutorImpl.swift` and use `PlatformExecutorCooperative.swift` in embedded concurrency for WASI.
2025-07-21 15:21:54 +01:00
Guillaume Lessard
b72c4422b8 Merge pull request #81637 from glessard/rdar147780495-OutputSpan-updates
[SE-0485] OutputSpan and OutputRawSpan
2025-07-17 14:14:52 -07:00
Evan Wilde
48fb7cd874 Merge pull request #83087 from etcwilde/ewilde/op-precedence
Fix warning in DispatchGlobalExecutor
2025-07-17 00:41:02 -07:00
Guillaume Lessard
31235db588 [stdlib] add OutputSpan to backdeployment library 2025-07-16 17:15:28 -07:00
Yuta Saito
af85e061dd Merge pull request #83086 from kateinoigakukun/yt/fix-isolated-conformance-static-link 2025-07-17 08:35:52 +09:00
Konrad `ktoso` Malawski
197530d264 Merge pull request #82943 from ktoso/wip-remove-task-startsynchronously-symbol 2025-07-17 06:48:40 +09:00
Yuta Saito
30e0fa5133 [Concurrency] Fix runtime isolated-conformance checks with static stdlib
Most of linkers pull object files from static archives only if any
symbol from that object file is referenced, even if the object contains
a ctor code. `Setup.cpp` didn't have any symbols referenced from
other code, so it was not linked in when the concurrency runtime was
linked in statically. This commit moves the ctor code to `Task.cpp`
to ensure that it is always linked in.
2025-07-16 06:28:04 +00:00
Evan Wilde
38c3ac1d22 Fix warning in DispatchGlobalExecutor
Fixing "warning: '&&' within '||'" -Wlogical-op-parentheses warning
2025-07-15 20:00:32 -07:00
Guillaume Lessard
2689ef31e1 Merge pull request #82959 from glessard/rdar155474776-extracting
[stdlib] Implementation for SE-0488
2025-07-15 13:59:00 -07:00
Valeriy Van
f85b2c5b97 Fix doc comment of DiscontiguousSlice.swift to make it match the code (#82220) 2025-07-15 13:16:49 -07:00
Mike Ash
67506f5045 Merge pull request #82818 from DmT021/wp/conformance-cache-by-descriptor
Protocol conformance cache for generic types
2025-07-15 11:52:49 -04:00