Commit Graph

21665 Commits

Author SHA1 Message Date
Mykola Pokhylets
d6673c78bd Implemented zombie actor state in SWIFT_CONCURRENCY_ACTORS_AS_LOCKS mode using additional reference counter 2024-08-26 19:41:17 +02:00
Holly Borla
d88b7995b5 Merge pull request #76079 from hborla/async-stream-sendable
[Concurrency] Add missing `Sendable` conformances to nested value types in `Async{Throwing}Stream`.
2024-08-26 10:07:56 -07:00
Mykola Pokhylets
a7ac32fc8f Disabled isolated deinit for SWIFT_CONCURRENCY_ACTORS_AS_LOCKS in the runtime 2024-08-26 17:46:47 +02:00
Changhyun-Kyle
1b97c574a4 [stdlib] Fix typo in Collection.swift 2024-08-26 18:53:05 +09:00
Holly Borla
ee4c034d6c [Concurrency] Add missing Sendable conformances to nested value types
in `Async{Throwing}Stream`.
2024-08-25 20:22:29 -07:00
Mike Ash
a3c9ba16d0 [RemoteMirror] Fix generic subclasses of resilient superclasses.
Fix readMetadataBoundsOfSuperclass to recursively apply adjustForSubclass while going through the superclass chain.

Strip indirect descriptor pointers so we can deal with signed pointers here.

Make CMemoryReader assert (in asserts builds) that the addresses being read don't have any signature bits set, which helps track down places where we need to add stripping.

rdar://134448718
2024-08-22 18:12:05 -04:00
Kuba Mracek
555ca3bcec [embedded] Make assert helper functions always inlined to avoid trap basic blocks from merging 2024-08-21 15:03:46 -07:00
Ben Troller
666178fb0f [RemoteMirror] Optimize brute-force search in getCaptureDescriptor() 2024-08-20 17:54:28 -07:00
Ben Troller
6b23b07f56 [RemoteMirror] Optmiize brute-force search in readTypeRef() 2024-08-20 14:19:23 -07:00
Doug Gregor
d9f7d94ae9 Merge pull request #75413 from DougGregor/unsafe
Introduce `@unsafe` and the ability to prohibit use of unsafe entities
2024-08-20 06:14:39 -07:00
Jamie
3bea96a310 [stdlib]: Propagate AsyncStream termination to all consumers
As of the changes in https://github.com/swiftlang/swift/pull/41713 to
enable Sendability for AsyncStream, it has been possible to create
multiple stream consumers operating concurrently. This change fixes
behavior in the case that the underlying stream is terminated while
multiple pending continuations are outstanding. Previously such
consumers would have been leaked (never resumed). Now, they are notified
of the stream's termination and resumed appropriately.

Resolves #66541 & #71412
2024-08-20 07:26:18 -05:00
Mykola Pokhylets
0412597731 Added swift_retainCount to EmbeddedRuntime.swift
Fixes test/embedded/concurrency-actors.swift
2024-08-19 23:41:33 +02:00
Doug Gregor
8378562e12 Adopt @unsafe throughout the standard library
Annotate all of the `Unsafe*` types and `unsafe` functions in the standard
library (including concurrency, synchronization, etc.) as `@unsafe`. Add a
few tests to ensure that we detect uses of these types in clients that
have disabled unsafe code.
2024-08-19 14:33:09 -07:00
Alex Lorenz
c8fa166e58 [cxx][windows] fix the CxxStdlib build for recent MSVC versions after recent regression
The build regressed after cbaef38968 as newer versions of MSVC that aren't used in the OSS CI yet fail to build CxxStdlib now
2024-08-19 10:55:22 -07:00
Egor Zhdan
28078d65be Merge pull request #75608 from CrazyFanFan/crazy_fan/75110
[c++-interop] Improve performance of creating a C++ `std::string` from a contiguous UTF-8 `Swift.String`
2024-08-19 15:40:43 +01:00
Rose
ea2b116764 Specify atomicity for compare_exchange_strong
waitQueue only needs to atomically be set to nullptr
2024-08-18 18:28:45 -04:00
Doug Gregor
73ecefd1e6 Merge pull request #75913 from DougGregor/typed-throws-with-unsafe-buffer-ptr
Adopt typed throws in withUnsafe(Mutable)BufferPointer
2024-08-17 09:16:49 -07:00
Yuta Saito
ba63b9f628 Merge pull request #75821 from kateinoigakukun/pr-680047d2b871e809cf13f27c8a4a5abc2f5c31d2
[wasm] Annotate errno as SwiftPrivate by apinotes
2024-08-17 14:35:42 +09:00
Doug Gregor
f8d483da0e Restore comment accidentally removed in typed throws adoption 2024-08-16 14:10:08 -07:00
Doug Gregor
8760b7caad Consistently use @usableFromInline and remove redundant @inlinables 2024-08-16 13:03:07 -07:00
Ian Anderson
fa72680d28 Merge pull request #75926 from ian-twilightcoder/lgamma_r-fix
[Shims] Don't redeclare lgamma_r in macOS 15.0 and associated SDKs
2024-08-16 12:51:44 -07:00
Doug Gregor
45a44a7d01 Use @_alwaysEmitIntoClient for new entrypoints 2024-08-16 11:13:19 -07:00
Doug Gregor
4d037ce6ef Adopt typed throws for withUnsafeMutableBufferPointer 2024-08-16 11:13:19 -07:00
Doug Gregor
5c07fd9502 Adopt typed throws in withUnsafeBufferPointer.
Part of rdar://131405937.
2024-08-16 11:13:18 -07:00
Evan Wilde
9fe62a832a Merge pull request #75870 from etcwilde/ewilde/main-add-musl-sdk-target-library
Fix add_swift_target_library for the static SDK
2024-08-16 09:51:44 -07:00
Ian Anderson
07a639ca9c [Shims] Don't redeclare lgamma_r in macOS 15.0 and associated SDKs
macOS 15.0, iOS 18.0, et al has started unconditionally declaring `lgamma_r` in <math.h>, add a __has_include in SwiftShims to detect that and not redeclare it when building against those SDK versions.

rdar://115192929
2024-08-16 09:00:09 -07:00
Yuta Saito
be08ebb12a [wasm] Annotate errno as SwiftPrivate by apinotes
This patch adds an apinotes file for SwiftWASILibc clang module to mark
`errno` macro hidden from Swift code. This resolves ambiguity between
the C macro definition and the Swift wrapper in WASILibc overlay module.

This change installs the apinotes file to the resource directories for
both lib/swift/apinotes and lib/swift_static/apinotes.
2024-08-16 10:57:24 +00:00
Harlan Haskins
a721ef63f6 Un-deprecate Task.startOnMainActor (#75544) 2024-08-16 06:36:18 +09:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Mykola Pokhylets
66871b922d Deterministically crash in DefaultActorImpl::destroy() when self escapes in deinit 2024-08-15 12:43:48 +02:00
Egor Zhdan
8e2f0e2d50 Merge pull request #75877 from swiftlang/egorzhdan/std-map-init
[cxx-interop] Allow initializing `std::map` from Swift Dictionary
2024-08-14 21:49:56 +01:00
Egor Zhdan
9fe13ece49 [cxx-interop] Allow initializing std::map from Swift Dictionary
This adds initializers for `std::map` and `std::unordered_map` that take a Swift dictionary as a single parameter.

rdar://133691563
2024-08-14 13:32:30 +01:00
Egor Zhdan
915b5312ba Merge pull request #75662 from ADKaster/disable-tbb-execution-on-newer-libstdcxx
[cxx-interop] Disable c++ execution header with libstdcxx versions >= 11
2024-08-14 13:15:19 +01:00
Evan Wilde
cae88d3344 Fix add_swift_target_library for the static SDK
add_swift_target_library was missing pieces for passing sources and
flags to the static SDK build. As a result, the static SDK was missing
pieces (specifically Mutex).

Also adding the Musl import to the Linux Mutex implementation.
2024-08-13 15:59:31 -07:00
Mykola Pokhylets
6151731d26 Updated implementation to handle SWIFT_CONCURRENCY_ACTORS_AS_LOCKS 2024-08-13 12:30:21 +02:00
Crazy凡
cbaef38968 [c++-interop] Improve performance of creating a C++ std::string from a contiguous UTF-8 Swift.String 2024-08-13 13:58:56 +08:00
Alex Lorenz
d35af38ce4 Merge pull request #75721 from hyp/eng/75691
[windows] split out complex module from ucrt module, to allow new swi…
2024-08-12 08:30:47 -07:00
Yuta Saito
90799cfdf7 Revert "[wasm] Fix ambiguous errno error when importing WASILibc module"
This reverts commit 164ec0adaa.
2024-08-10 13:29:48 +00:00
Alastair Houghton
a95b69cdb8 Merge pull request #75709 from al45tair/eng/PR-132710670
[Build][Backtracing] Make sure the target for OS X is at least 10.14.4.
2024-08-09 18:48:21 +01:00
Guillaume Lessard
79bf5d51ca Merge pull request #75782 from glessard/rdar133343460-incorrectly-sendable
[stdlib] fix sendability of ManagedBufferPointer
2024-08-08 16:28:19 -07:00
Kuba (Brecka) Mracek
f9631e121c Merge pull request #75768 from kubamracek/embedded-string-switch
[embedded] Add StringSwitch.swift to the embedded stdlib
2024-08-08 15:28:22 -07:00
Guillaume Lessard
f9eb3223fe [stdlib] mark ManagedBufferPointer non-Sendable 2024-08-08 11:26:30 -07:00
Alex Martini
906efcbe93 Merge pull request #75625 from amartini51/param_132944086
Match parameter names in documentation to declaration

Fixes: rdar://132944086
2024-08-08 09:22:11 -07:00
Kuba Mracek
3c9f1ebb55 [embedded] Add StringSwitch.swift to the embedded stdlib 2024-08-07 21:37:01 -07:00
Alex Martini
d0d15167d3 Add missing "parameters" directive
Co-authored-by: Ben Rimmington <me@benrimmington.com>
2024-08-07 11:07:54 -07:00
Yuta Saito
164ec0adaa [wasm] Fix ambiguous errno error when importing WASILibc module
This commit fixes an ambiguous `errno` error when importing WASILibc
module and SwiftWASILibc Clang module.

The error is caused by the fact that we define a shim for `errno` in
`Platform.swift` file, but wasi-libc defines `errno` in a way
ClangImporter can understand. We don't need to define shims for it,
otherwise we get two candidates for `errno` identifier.
2024-08-07 04:28:29 +00:00
Guillaume Lessard
29a4b8abff Merge pull request #75622 from glessard/rdar132941798-aEIC-private-consternation 2024-08-06 20:31:04 -07:00
Richard L Zarth III
e2c9541537 Allow TaskGroup's ChildTaskResult Type To Be Inferred (#74517)
Co-authored-by: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
2024-08-07 11:11:33 +09:00
Alex Lorenz
b62eafd866 [windows] split out complex module from ucrt module, to allow new swift-foundation to import ucrt when C++ interoperability is enabled
Fixes https://github.com/swiftlang/swift/issues/75691
2024-08-06 11:33:03 -07:00
Alastair Houghton
02f87e3d8e [Build][Backtracing] Make sure the deployment target for OS X is over 10.14.4.
We need to make sure that we build swift-backtrace with a deployment target
newer than 10.14.4 in order that we get linked against
`/usr/lib/swift/libswiftCore.dylib` rather than using an `@rpath`-based
path.

If we fail to do that, dyld becomes confused and we end up crashing with
weird errors about missing method implementations on `Swift.__StringStorage`.

To make this work, add support for `DEPLOYMENT_VERSION_*` in the
`add_swift_target_executable()` CMake function.  And since I spotted a bug
in it, fix the existing support in `add_swift_target_library()` while I'm
there.

rdar://132710670
2024-08-06 15:03:01 +01:00