Commit Graph

21434 Commits

Author SHA1 Message Date
Kuba Mracek
249f7e6073 [embedded] Handle retain/retain ops inside deinit in Embedded Swift's swift_release 2024-09-03 14:38:03 -07:00
Allan Shortlidge
29f172f3c1 Concurrency: Suppress a -Wc++23-extensions warning.
Fixes the following warning:

```
warning: label at end of compound statement is a C++23 extension [-Wc++23-extensions]
```
2024-09-03 13:09:28 -07:00
Vera Mitchell
b4529a69eb add build-stdlib-docs flag that generates stdlib symbol graphs 2024-09-03 13:52:42 -06:00
Shreyans Pathak
49d9067d3e feat: add comparable conformance for C++ strings 2024-09-03 13:47:27 -04:00
Konrad `ktoso` Malawski
c86e4a8738 Merge pull request #60057 from nickolas-pohilets/mpokhylets/isolated-deinit
Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
2024-09-04 01:16:56 +09:00
Alejandro Alonso
027a95a1b5 Merge pull request #76097 from jeongHunE/main
[stdlib] Fix the indentation from 1 space to 2 spaces in ArraySlice.s…
2024-09-02 21:22:55 -07:00
Konrad `ktoso` Malawski
c55ad6fa88 Merge branch 'main' into mpokhylets/isolated-deinit 2024-09-02 23:16:17 +09:00
Egor Zhdan
39b8b3c67e Merge pull request #76106 from swiftlang/egorzhdan/cxx-mutable-rac
[cxx-interop] Add `CxxMutableRandomAccessCollection` protocol
2024-09-02 11:35:43 +01:00
Allan Shortlidge
5c30b30947 Merge pull request #76177 from tshortli/availability-visionos
build-script: Copy `libclang_rt.a` from the host toolchain for visionOS
2024-08-31 10:00:13 -07:00
Allan Shortlidge
48f236d09a build-script: Copy libclang_rt.a from the host toolchain for visionOS.
During the toolchain build, when building the Swift standard library for
platforms other than macOS the `libclang_rt.a` needs to be copied out of the
host SDK. That wasn't happening for visionOS.

Resolves rdar://135023111.
2024-08-30 18:15:13 -07:00
Alejandro Alonso
10314365e4 Merge pull request #76144 from Benedicto-H/fix-Dictionary-doc
[stdlib] Fix typos in Dictionary.swift
2024-08-29 21:48:03 -07:00
Allan Shortlidge
a9120c3dc2 Merge pull request #76135 from tshortli/backdeployed-ios-apps-on-macos
SILOptimizer: Allow inlining of transparent functions in `@backDeployed` thunks
2024-08-29 15:06:48 -07:00
Alejandro Alonso
cfd39367a5 Merge pull request #75048 from Benedicto-H/fix/typos-task
[Shims] Fix typos in RefCount.h
2024-08-29 09:28:11 -07:00
Benedicto Hong
5b30f78b53 [stdlib] Fix typos in Dictionary.swift
Hi, I fixed several typos in Dictionary.swift file(#Line: 347, 1194).

- origin comments
```swift
// #347
// Prints "The 'star' image is a glyph.")

// #1194
// Prints "No value found for that key.""
```

- changed comments
```swift
// #347
// Prints "The 'star' image is a glyph.")  // I thought the ' ) ' character was unnecessary, so I removed it.

// #1194
// Prints "No value found for that key.""  // I thought the ' " ' character was unnecessary, so I removed it.
```
2024-08-29 20:31:59 +09:00
Mykola Pokhylets
e0ad7bde82 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/AST/ASTPrinter.cpp
#	lib/AST/FeatureSet.cpp
2024-08-29 11:28:43 +02:00
Allan Shortlidge
51143aa8ea stdlib: Upstream _stdlib_isOSVersionAtLeast_AEIC().
In the standard library shipped in Apple's SDKs and OSes, the implementation of
`_stdlib_isOSVersionAtLeast()` has diverged in order to solve some tricky
issues related to supporting iOS applications running on macOS. It's now time
to bring that change upstream in order to unblock further changes that depend
on it.

Originally introduced to resolve rdar://83378814.
2024-08-28 22:07:59 -07:00
Egor Zhdan
0ab681514b [cxx-interop] Add CxxMutableRandomAccessCollection protocol
This conforms mutable C++ container types, such as `std::vector`, to `MutableCollection` via a new overlay protocol `CxxMutableRandomAccessCollection`.

rdar://134531554
2024-08-28 12:43:42 +01:00
정훈
193a3063dc [stdlib] Fix the indentation from 1 space to 2 spaces in ArraySlice.swift 2024-08-27 09:01:54 +09:00
Alejandro Alonso
cccacd7a08 Merge pull request #76082 from Changhyun-Kyle/fix-collection-doc
[stdlib] Fix grammatical error in Collection.swift
2024-08-26 13:28:28 -07:00
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