Commit Graph

21665 Commits

Author SHA1 Message Date
Karoy Lorentey
209c66cf74 [stdlib] UnsafePointer: Add @_preInverseGenerics to stored properties 2024-03-18 11:03:49 -07:00
Karoy Lorentey
0a676db16f [stdlib] Generalize swap(_:_:) for noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
805f94b5a8 [stdlib] OpaquePointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
d6296ab966 [stdlib] UnsafeRawPointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
baa317c29a [stdlib] Optional: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
56ddafb0a0 [stdlib] UnsafePointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
bfd2b068c1 [stdlib] MemoryLayout: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
7d87ad5a8a [stdlib] OpaquePointer: new interactions with noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
0568dbf903 [stdlib] UnsafeRawPointer: new interactions with noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
85a6b97e7a [stdlib] Optional: Initial support for noncopyable payloads
- Enable BorrowingSwitch feature within the stdlib
- ExpressibleByNilLiteral: Add retroactive support for noncopyable conforming types
- Optional: draft an API surface for noncopyable payloads

[stdlib] Oops, the ExpressibleByNilLiteral conformance kept its implicit copyability
2024-03-18 11:03:49 -07:00
Karoy Lorentey
d0b39ac8db [stdlib] Unsafe[Mutable]Pointer: Add support for non-copyable Pointee types
[stdlib] Pull back @_aeic on pointer → integer conversions

[stdlib] UnsafeMutablePointer.allocate: Fix thinko

[stdlib] Disable support for noncopyable pointees on some pointer operations

We have to temporarily pull back support for noncopyable pointees for UnsafeMutablePointer.initialize(to:), .moveInitialize, .moveUpdate, as the builtins they’re calling are no longer accepting such types.

These will return following a builtin audit.

[stdlib] Remove workarounds for certain builtins not supporting noncopyable use

https://github.com/apple/swift/pull/71733 fixed this!

[stdlib] Update FIXME

[stdlib] UnsafePointer: Update Swift version numbers

[stdlib] UnsafePointer: Actually hide legacy ABI

[stdlib] Remove workaround for U[M]BP.withMemoryRebound
2024-03-18 11:03:49 -07:00
Karoy Lorentey
7fc54cab80 [stdlib] MemoryLayout: Add support for non-copyable type arguments
[stdlib] MemoryLayout: Update Swift version numbers

[stdlib] MemoryLayout: Actually hide legacy ABI
2024-03-18 11:03:48 -07:00
Kavon Farvardin
76c6510519 Merge pull request #72276 from kavon/ncgenerics-xfails-3 2024-03-16 04:18:35 -07:00
John McCall
8d8b91dfb2 Merge pull request #72325 from rjmccall/isolated-any-task-creation
Use `@isolated(any)` function types in task creation
2024-03-16 02:02:23 -04:00
Guillaume Lessard
d00866aa3c Merge pull request #72365 from glessard/rethrowing-disappearing-act
[stdlib] preserve untyped-throws versions of functions
2024-03-15 19:36:19 -07:00
Guillaume Lessard
8459d0616d [stdlib] make swiftinterfaces compatible with older toolchains 2024-03-15 16:50:12 -07:00
John McCall
a86b76a3e9 Use @isolated(any) function types for task functions.
The biggest annoyance here is having to clone all of the task creation
functions for Embedded Swift because it can't use `any Actor` right now.
2024-03-15 14:40:54 -04:00
Saleem Abdulrasool
4c5558d482 Merge pull request #72339 from compnerd/nullability
shims: adjust declaration for android NDK
2024-03-15 10:30:20 -07:00
eeckstein
9504de5ed7 Merge pull request #71552 from finagolfin/cross-compile
[CMake] Add broader support for cross-compiling the portions of the compiler that are written in Swift to non-Darwin Unix
2024-03-15 16:28:38 +01:00
Kavon Farvardin
149c052ec5 use new noncopyable types infrastructure
The infrastructure underpinning the new feature NoncopyableGenerics is
mature enough to be used.
2024-03-14 23:10:44 -07:00
Allan Shortlidge
c27d1b806c Merge pull request #72333 from tshortli/string-processing-resilient-libraries-flag
CMake: Pass -DRESILIENT_LIBRARIES when building _StringProcessing
2024-03-14 22:22:22 -07:00
John McCall
b0cee67d04 Properly save and restore the current task in the runtime so that tasks
can be reentrantly executed.

I don't think doing this is *actually a good idea*, but corrupting the
runtime is an even worse idea, and the overhead here is very low.
2024-03-15 00:40:54 -04:00
Doug Gregor
735e28b551 Merge pull request #72336 from DougGregor/demangle-inverse-requirements-to-ast
Demangle inverse requirements when building AST types
2024-03-14 17:30:49 -07:00
David Smith
dc405525f9 Optimize checking for all-ASCII bytes (#72312) 2024-03-14 16:13:34 -07:00
Saleem Abdulrasool
ac4123b7b9 shims: adjust declaration for android NDK
Mark the nullability to repair the build against NDK r26b.
2024-03-14 15:47:00 -07:00
Doug Gregor
a2ae2149e8 Demangle inverse requirements when building AST types
Extend TypeDecoder with support for inverse requirements, passing them
along to the type builder. Then implement support for inverse
requirements within the AST demangler, which addresses the round-trip
demangling failures we've been seeing.

The runtime and remote inspection facilities still need metadata to
deal with inverse requirements.

Fixes rdar://124564447.
2024-03-14 14:01:53 -07:00
Allan Shortlidge
4d44bf3758 CMake: Pass -DRESILIENT_LIBRARIES when building _StringProcessing.
See https://github.com/apple/swift-experimental-string-processing/pull/731.
2024-03-14 10:07:21 -07:00
Ben Barham
cbcfc85777 Merge pull request #72323 from bnbarham/rename-startswith
Rename startswith to starts_with
2024-03-14 09:06:54 -07:00
Kuba (Brecka) Mracek
b9818c6015 Merge pull request #72322 from kubamracek/embedded-fix-arch-name
[embedded] Fix a typo in the module name for armv6m-none-none-eabi
2024-03-14 03:47:41 -07:00
Allan Shortlidge
3836662126 Merge pull request #72315 from tshortli/revert-regex-parser-resilience
Revert "[Regex] Really build _RegexParser without resilience."
2024-03-14 00:10:43 -07:00
Ben Barham
9779c18da3 Rename startswith to starts_with
LLVM is presumably moving towards `std::string_view` -
`StringRef::startswith` is deprecated on tip. `SmallString::startswith`
was just renamed there (maybe with some small deprecation inbetween, but
if so, we've missed it).

The `SmallString::startswith` references were moved to
`.str().starts_with()`, rather than adding the `starts_with` on
`stable/20230725` as we only had a few of them. Open to switching that
over if anyone feels strongly though.
2024-03-13 22:25:47 -07:00
Kuba Mracek
18d2ac14e9 [embedded] Fix a typo in the module name for armv6m-none-none-eabi 2024-03-13 21:28:30 -07:00
Kuba (Brecka) Mracek
d5e5723294 Merge pull request #72293 from kubamracek/embedded-synchronization
[embedded] Start building Synchronization in embedded Swift mode
2024-03-13 18:46:28 -07:00
Guillaume Lessard
30a76d7cee Merge pull request #72301 from tshortli/with-memory-rebound-typed-throws-condfail
stdlib: Guard `@inlinable` use of `withMemoryRebound()` with `#if $TypedThrows`
2024-03-13 16:54:43 -07:00
Allan Shortlidge
841847b009 Revert "[Regex] Really build _RegexParser without resilience."
This reverts commit 8d1b578275.

Resolves rdar://124541877
2024-03-13 16:25:21 -07:00
Tim Kientzle
7ac7d55180 Merge pull request #72290 from tbkka/tbkka-rdar123727657
Fix enum inspection of a no-payload enum inside another enum
2024-03-13 16:09:32 -07:00
Arnold Schwaighofer
7196c9c9ea Merge pull request #72296 from aschwaighofer/build_config_fix_fragile_resilient
Don't set enable-library evolution under SWIFT_STDLIB_USE_FRAGILE_RESILIENT_PROTOCOL_WITNESS_TABLES
2024-03-13 15:28:06 -07:00
Allan Shortlidge
20a8399488 stdlib: Guard @inlinable use of withMemoryRebound() with #if $TypedThrows.
Older compilers can no longer see the definition of `withMemoryRebound()` now
that it has adopted typed throws (https://github.com/apple/swift/pull/72036).

Resolves rdar://124540428
2024-03-13 11:38:24 -07:00
Tim Kientzle
afb75e631f Fix off-by-one error in maskForCount, comment more carefully 2024-03-13 10:35:35 -07:00
Arnold Schwaighofer
2bd3feeeee Don't set enable-library evolution under SWIFT_STDLIB_USE_FRAGILE_RESILIENT_PROTOCOL_WITNESS_TABLES
Rather, for the purpose of testing set this under an individual build
preset configuration.
2024-03-13 10:27:40 -07:00
Kuba Mracek
48b8228acd [embedded] Start building Synchronization in embedded Swift mode 2024-03-13 10:07:37 -07:00
Holly Borla
5d9ad87a82 [Concurrency] Task executors are available in Swift 6.0. 2024-03-13 09:56:24 -07:00
Tim Kientzle
35a98aad20 Fix enum inspection of a no-payload enum inside another enum
When a no-payload enum is stored inside a multi-payload enum,
the outer enum may be using some of the extra high-order bits.
So when we examine the inner enum, we should just strip those bits.
2024-03-13 09:14:37 -07:00
Arnold Schwaighofer
315a763c28 Merge pull request #72218 from aschwaighofer/fragile_resilient_protocols
IRGen: Add code to support building fragile resilient protocol witnesses
2024-03-13 08:40:44 -07:00
Holly Borla
154f47ecef Merge pull request #72252 from hborla/concurrency-lib-annotations
[Concurrency] Add a few missing `Sendable` annotations in the concurrency library.
2024-03-13 07:05:27 -07:00
Konrad `ktoso` Malawski
d4c347c3a1 [Concurrency] Adjustments to withTaskExecutorPreference (#71973) 2024-03-13 06:24:30 -07:00
Holly Borla
70d998a1bb [Concurrency] Make OptionalIsolatedParameters a conditionally suppressible
language feature, and suppress it for `Clock.measure`.

This allows the _Concurrency swiftinterface file to continue building with
compilers that do not support `OptionalIsolatedParameters`. The feature
suppression drops the `isolated` keyword and replaces `#isolation` with
`nil`.
2024-03-12 22:56:16 -07:00
Holly Borla
dfa7b866c7 [Concurrency] Clock.measure should inherit actor isolation. 2024-03-12 22:55:34 -07:00
Holly Borla
377b5274ff [Concurrency] Async{Throwing}Stream.init(unfolding:) should accept a
`@Sendable` closure.
2024-03-12 22:55:34 -07:00
Holly Borla
f78690bbb8 [Concurrency] ContinuousClock and SuspendingClock are Sendable. 2024-03-12 22:55:34 -07:00