Commit Graph

21434 Commits

Author SHA1 Message Date
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
Alejandro Alonso
56bb298d14 Merge pull request #72258 from Azoy/commandline-fixes
[stdlib] Deprecate CommandLine.arguments setter
2024-03-12 16:45:26 -07:00
Allan Shortlidge
32cd086068 Merge pull request #72259 from tshortli/typed-throws-without-actually-escaping
Concurrency: Guard use of `withoutActuallyEscaping()` in inlinable code
2024-03-12 15:12:03 -07:00
Guillaume Lessard
d4abcde64a Merge pull request #72233 from glessard/toplevel-withUUMP-typed-throws
[stdlib] convert `_withUnprotectedUnsafeMutablePointer()` to typed throws
2024-03-12 14:39:46 -07:00
Alejandro Alonso
552edd2ccb Merge pull request #72101 from Azoy/sendable-all-the-things
[stdlib] Sendablize all the things
2024-03-12 13:37:15 -07:00
Mike Ash
133dc5dc55 Merge pull request #72243 from mikeash/dont-log-logd
[Runtime] Don't enable tracing in logd, diagnosticd, notifyd.
2024-03-12 16:04:22 -04:00
Allan Shortlidge
65c0ef830e Concurrency: Guard use of withoutActuallyEscaping() in inlinable code.
Since `withoutActuallyEscaping()` has adopted typed throws, it's no longer
visible to older compilers that do not support typed throws. We need to guard
use of the function in inlinable code to make sure the textual interface of
`_Concurrency` remains buildable with older compilers.

Resolves rdar://124352900
2024-03-12 10:34:57 -07:00
Alejandro Alonso
9d318220b9 Deprecate CommandLine.arguments setter 2024-03-12 09:54:53 -07:00
Alejandro Alonso
17401c627b Remove explicit unavailable sendable from keypath 2024-03-12 09:20:40 -07:00
Konrad `ktoso` Malawski
27702fa115 [Distributed][Macro] Handle more cases in distributed protocol macro (#72177) 2024-03-12 02:12:31 -07:00
Doug Gregor
e0df6e01bd Merge pull request #72234 from DougGregor/attr-implements-assoc-failure-type
[Associated type inference] Support `@_implements` on type witnesses and use it for async sequence `Failure`
2024-03-11 21:03:54 -07:00
Mike Ash
3100be12fa [Runtime] Don't enable tracing in logd, diagnosticd, notifyd.
We can't use os_log functionality in logd, diagnosticd, or notifyd. Check for them and disable tracing in those processes.

Add a new TracingCommon.h for common code shared between swiftCore and swift_Concurrency tracing. Add a single function that checks if tracing should be enabled, which now checks if os_signpost_enabled is available, and if the process is one of these. Modify the tracing code to check this before creating os_log objects.

rdar://124226334
2024-03-11 21:06:15 -04:00
Doug Gregor
5bdd4e5772 Improve @_implements for associated type witnesses
Allow `@_implements` to be expressed in an extension of the protocol in
which the associated type is defined. Use this to uncomment an
intended use of `@_implements` in `Sequence` that could be used to
replace a longstanding hack for associated type inference.

Since this change means that the standard library module interface
won't be accepted by older compilers, introduce a suppressible feature
ssociatedTypeImplements` that covers the use of `@_implements` on type
declarations. This will hide the `@_implements` attribute from older
compilers.
2024-03-11 14:28:20 -07:00
Guillaume Lessard
0ccfa42957 [stdlib] convert _withUnprotectedUnsafeMutablePointer() to typed throws 2024-03-11 11:34:01 -07:00
Arnold Schwaighofer
9639e007d8 Teach TBD that in fragile resilient protocol mode the protocol table is visible 2024-03-11 09:49:38 -07:00
Arnold Schwaighofer
ea70aea43c IRGen: Add code to support building fragile resilient protocol witnesses
We don't currently support building resilient relative protocol witness tables.
One might want to build with relative witness tables but not need
resilient protocols. Allow for that scenario.

Add a test configuration to test library-evolution + fragile resilient
protocols + relative protocol witness tables.
2024-03-10 09:14:08 -07:00
Daniel Rodríguez Troitiño
42e43edef3 [cmake] Unify usage of create_symlink/copy across the build files. (#72202)
In several places, there was the same or similar code to either do
a symlink or use copy/copy_if_different/copy_directory in Windows
systems. The checks were also slightly different in some cases.

There is a `SWIFT_COPY_OR_SYMLINK` that can be controlled as a CMake
option, and uses `CMAKE_HOST_UNIX` as default. Change all cases that
I can find to use that value. Also create a parallel value
`SWIFT_COPY_OR_SYMLINK_DIR` to apply to directories.

There is still a couple of cases that are specific to macOS SourceKit
framework which I have left as-is, since symlinks is probably the only
right thing to do there.

There's a case for Windows specifically that uses symlinks (in
523f807694/cmake/modules/SwiftConfigureSDK.cmake (L502))
which I have not modified as well.
2024-03-09 18:03:55 -08:00
Guillaume Lessard
78273b2390 Merge pull request #72089 from glessard/toplevel-withUMP-typed-throws
[stdlib] convert `withUnsafeMutablePointer()` to typed throws
2024-03-08 13:52:23 -08:00
Guillaume Lessard
805dd70cfe Merge pull request #72074 from glessard/toplevel-withbytes-typed-throws
[stdlib] convert `withUnsafeBytes()` to typed throws
2024-03-08 08:55:08 -08:00
John McCall
14dcab6bcd Restore (TaskOptionRecordKind)0 to set the initial serial executor.
This has been the behavior of the runtime since the initial release.
Initially, it was thought that task executors would provide similar
functionality, so they naturally took over the enumerator.  After that
changed, we forgot to change it back.  Fortunately, we haven't released
any versions of Swift with the task executors feature yet, so it's not
too late to fix this.
2024-03-08 00:15:10 -05:00
Slava Pestov
123045f825 Merge pull request #71780 from slavapestov/remove-non-experimental-assoc-type-inference
Remove old associated type inference implementation
2024-03-07 22:14:06 -05:00
Meghana Gupta
e96642c219 Merge pull request #72106 from meg-gupta/lifetimedepdiag
Loosen some lifetime dependence diagnostics
2024-03-07 16:32:13 -08:00
Slava Pestov
af8c8f1671 Sema: Remove non-experimental associated type inference 2024-03-07 17:30:17 -05:00
Alastair Houghton
07031a1ab5 [Tests] Fix LongRefcounting test.
We were retaining one too many times in the two `_DeathTest` tests,
which caused the tests to fail.  This was previously masked by a bug.

rdar://124212794
2024-03-07 16:33:49 +00:00
Oscar Byström Ericsson
af0c9fae8e FlattenSequence/distance(from:to:) untrapping Int.min (v6).
1. Put the first region inside the if-else (same branch condition).
2. Use the forward distance in the highest region (as done in the middle).
2024-03-07 13:19:45 +01:00
Meghana Gupta
f3a85b118f Add build-script option and lit config for nonescapable_types
With this build-script has a flag --enable-experimental-nonescpable-types=1
to enable this feature in stdlib.

Also we can now add // REQUIRES: nonescapable_types to tests which run only when
the compiler is built with this feature turned on.
2024-03-06 21:57:03 -08:00
Meghana Gupta
806921c0c8 Allow ~Escapable types to be _BitwiseCopyable 2024-03-06 21:57:03 -08:00
Guillaume Lessard
578a058797 Merge pull request #72052 from glessard/toplevel-withpointer-typed-throws
[stdlib] convert `withUnsafePointer()` to typed throws
2024-03-06 15:01:45 -08:00
Mike Ash
4d484c9f12 Merge pull request #71993 from mikeash/fix-32-bit-unowned-refcount-overflow
[Runtime] Fix strong and unowned refcount overflow on 32-bit.
2024-03-06 17:54:26 -05:00
Nate Chandler
73231b185b [BitwiseCopyable] Don't apply to FixedWidthInteger.
Per LWG feedback.

This reverts commit c8119e3c01.
2024-03-06 08:12:54 -08:00
eeckstein
d1ec089c72 Merge pull request #72088 from language-core/main
chore: fix some comments
2024-03-06 10:08:50 +01:00
Alejandro Alonso
f9f640b141 Sendablize the standard library
oops dont add this flag

no more nonisolated
2024-03-05 15:02:09 -08:00