Commit Graph

21665 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
481c928d67 [Concurrency] Fix missing return in legacy isSameExecutor mode detection
resolves rdar://128425368
resolves rdar://127400013
2024-05-27 17:02:25 +09:00
Alex Lorenz
dac073965b [android] add a module map for Android NDK
This commit doesn't install them yet, they will be installed and a whole Android NDK module will be built in a follow-up commit

This module map covers the Bionic C standard library and other Posix headers used in the Android NDK
2024-05-26 20:00:10 -07:00
Kuba Mracek
78d19ff6ba [embedded] Explicitly install libswiftUnicodeDataTables.a with -x permissions 2024-05-26 13:00:53 -07:00
Kuba Mracek
7d92baaddd [embedded] Provide Unicode data tables for embedded as a static library 2024-05-26 13:00:52 -07:00
Kuba (Brecka) Mracek
545c2434c0 Merge pull request #70446 from kubamracek/embedded-string
[embedded] Port Swift.String to embedded Swift
2024-05-26 12:59:01 -07:00
nate-chandler
c0af25c069 Merge pull request #73890 from nate-chandler/rdar128661878
[BitwiseCopyable] Drop req from SIMD/Storage.
2024-05-24 18:10:57 -07:00
Guillaume Lessard
71258c4a2a [stdlib] add failure explanations to debug preconditions
addresses rdar://128543858
2024-05-24 14:02:57 -07:00
Holly Borla
1011e4ddb0 [Concurrency] Only deprecate AnyActor, and update more tests.
Obsoleting `AnyActor` in Swift 6 blocks the Concurrency library itself
from migrating to Swift 6, because `Actor` and `DistributedActor` have to
preserve their refinement of `AnyActor` to avoid breaking code currently
using the marker protocol. There's no way to move protocol refinement into
an extension so that the use-site declaration can be obsoleted, so we're
stuck with just the deprecation of `AnyActor`.
2024-05-24 12:58:02 -07:00
Nate Chandler
746cf2ff5b [BitwiseCopyable] Drop req from SIMD/Storage.
There are conformers to SIMDStorage (like that in the added test case)
which involve an Array (a type that can't conform to BitwiseCopyable).
So lift the constraint on SIMDStorage.  This in turn requires lifting
the constraint on SIMD (otherwise, e.g. `SIMD8<Scalar>` would fail to
conform since it has as a member some SIMD8Storage which is only
constrained to conform to `SIMDStorage`; the `SIMD8Storage`
associatedtype also cannot be constrained to `BitwiseCopyable` because
that storage may again not conform as in the test example).

rdar://128661878
2024-05-24 12:32:10 -07:00
Holly Borla
2590b2d7ac [Concurrency] Obsolete a few deprecated typealiases to Sendable in
Swift 6.
2024-05-24 08:58:41 -07:00
Holly Borla
7af38860ed [Concurrency] Deprecate and obsolete AnyActor.
This marker protocol isn't useful for abstracting over actors and distributed
actors because it doesn't have any runtime requirements, so there's no way
to switch to the given actor. Instead, you should use `isolated (any Actor)?`
parameters, and the compiler will compute a local actor value from a
distributed actor using `DistributedActor.asLocalActor`.
2024-05-24 08:57:17 -07:00
Saleem Abdulrasool
1f70b2fdff Merge pull request #73825 from compnerd/atomic
Platform: add new module for VC 17.10.0
2024-05-24 00:00:47 +09:00
Alex Martini
65a5216a7b Merge pull request #73238 from amartini51/copyable_126377559
Add reference for Copyable

Fixes: rdar://126377559
2024-05-22 15:55:47 -07:00
Mike Ash
634295c85e Merge pull request #73796 from mikeash/fix-resume-function-for-logging
[Concurrency] Refine getResumeFunctionForLogging to avoid reading invalid future contexts.
2024-05-22 16:57:37 -04:00
Saleem Abdulrasool
b68188b00c Platform: add new module for VC 17.10.0
The new headers for LWG-3268 in the new VC release broke the
modularisation of `std.atomic`. Add the dependent private module to
ensure that we correctly modularise the dependency and allow
`std.atomic` to be built again.
2024-05-22 13:10:08 -07:00
Augusto Noronha
dd39730d74 Merge pull request #73723 from augusto2112/default-actor-ti-main
[RemoteInspection] Hardcode DefaultActorStorage's type info
2024-05-22 11:14:47 -07:00
eeckstein
7c69bec9b4 Merge pull request #73782 from eeckstein/static-arrays-in-embedded
IRGen: support read-only statically initialized arrays in embedded swift
2024-05-22 19:34:42 +02:00
Alejandro Alonso
4221d9f76a Merge pull request #73734 from Azoy/bitwisecopyable-atomic-reps
[stdlib] Enforce that atomic representations are BitwiseCopyable
2024-05-22 08:19:06 -07:00
Mike Ash
b67c4bfc22 Merge pull request #73761 from mikeash/lazy-signposts-option
[Runtime] Use CMake variable to control os_trace_lazy_init usage.
2024-05-22 11:01:35 -04:00
Andrew Trick
6339b2236e Merge pull request #73808 from apple/revert-70910-mpokhylets/fix-list-merger-performance
Revert "Fix quadratic performance of the `ListMerger` in specific usage pattern"
2024-05-21 20:35:19 -07:00
Andrew Trick
bdc959fc6f Merge pull request #73786 from mikeash/prespecializations-dyld-hash-table-availability-fix
[Runtime] Add weak check to use of _dyld_find_pointer_hash_table_entry.
2024-05-21 17:28:39 -07:00
Andrew Trick
2640ff613b Revert "Fix quadratic performance of the ListMerger in specific usage pattern" 2024-05-21 16:23:57 -07:00
Mike Ash
0f226b6667 [Concurrency] Refine getResumeFunctionForLogging to avoid reading invalid future contexts.
When using a future adapter, the resume context may not be valid after the task starts running. Only peer through the adapter when we're starting to run.

rdar://126298035
2024-05-21 16:22:40 -04:00
Erik Eckstein
162139364e IRGen: support read-only statically initialized arrays in embedded swift
Arrays buffers need to be initialized with a (minimal) metatype and with an immortal reference count.
2024-05-21 18:04:10 +02:00
Mike Ash
ae71658c6a [Runtime] Add weak check to use of _dyld_find_pointer_hash_table_entry.
Needed to avoid availability errors in some configurations.

rdar://127621414
2024-05-21 10:59:15 -04:00
Alastair Houghton
ee630d407f [Build] Don't include Compatiblity50/51 for 64-bit watchOS.
We don't support Swift 5.0 or 5.1 on ARM64 watchOS.

rdar://128445543
2024-05-21 14:21:48 +01:00
Mike Ash
7f2d4be642 [Runtime] Use CMake variable to control os_trace_lazy_init usage.
SWIFT_BNI_OS_BUILD isn't exactly what we need. Use an option to turn it on/off instead.

rdar://128408295
2024-05-20 17:39:01 -04:00
John McCall
e1a82f622e Merge pull request #70910 from nickolas-pohilets/mpokhylets/fix-list-merger-performance
Fix quadratic performance of the `ListMerger` in specific usage pattern
2024-05-20 17:26:34 -04:00
David Smith
b81aec5c1a rdar://127199021, fix compatibility with apps that accidentally do [[[aSwiftArray class] new] mutableCopy] to work (#73728) 2024-05-20 12:06:05 -07:00
Alastair Houghton
72d801c88e Merge pull request #73747 from al45tair/eng/PR-128388845
[Shims] Fix nullability for musl.
2024-05-20 15:30:02 +01:00
Alastair Houghton
5e24abc970 [Shims] Fix nullability for musl.
Apparently I got the merge for this slightly wrong.

rdar://128388845
2024-05-20 12:18:59 +01:00
Alejandro Alonso
3053c81259 Enforce that atomic representations are bitwisecopyable 2024-05-18 10:18:32 -07:00
Michael Gottesman
d759ec97ea Merge pull request #73696 from gottesmm/rdar128216574
[sending] Add support for 'sending'
2024-05-18 05:42:41 -04:00
Mike Ash
011c46eb45 Merge pull request #73650 from mikeash/prespecializations-dyld-hash-table
[Runtime] Add pointer-based lookup of prespecialized metadata.
2024-05-17 21:22:57 -04:00
Guillaume Lessard
a27d9c426a Merge pull request #71912 from oscbyspro/better-joined-distance-from-to-int-min
FlattenSequence/distance(from:to:) untrapping Int.min
2024-05-17 16:17:01 -07:00
Augusto Noronha
4417786be4 [RemoteInspection] Hardcode DefaultActorStorage's type info
No metadata is emitted for the builtin DefaultActorStorage type. Since
its layout is fixed, hardcode its definition in Remote Mirrors.

rdar://128032250
2024-05-17 14:29:25 -07:00
Mike Ash
96555ba51c [Runtime] Add pointer-based lookup of prespecialized metadata.
The existing lookup uses a hash table with the type's mangled name as the key. Building that key is costly. Add a new table that uses pointer keys, so that we can use the descriptor and arguments directly as the key.

rdar://127621414
2024-05-17 16:17:03 -04:00
Allan Shortlidge
f0551920c5 Merge pull request #73700 from tshortli/borrowing-switch-condfail
stdlib: Fix a borrowing switch condfail
2024-05-17 09:16:39 -07:00
Allan Shortlidge
ca70312879 stdlib: Fix a borrowing switch condfail.
Resolves rdar://128249510
2024-05-16 23:35:25 -07:00
Allan Shortlidge
5b252da7e2 stdlib: Fix warnings in Duration.swift. 2024-05-16 23:34:44 -07:00
Alex Martini
b57dbae317 Fix typo in docs code example
Co-authored-by: Kavon Farvardin <kfarvardin@apple.com>
2024-05-16 16:33:12 -07:00
Alex Martini
97790c03a7 Indent code listings, to match style used elsewhere 2024-05-16 14:35:29 -07:00
Alastair Houghton
a3ce5a9ba2 Merge pull request #73670 from al45tair/eng/PR-128197532
[Build] Add compatibility library deps to target executables.
2024-05-16 21:57:21 +01:00
Alex Martini
6fa34bdabf Add a missing implicit Copyable constraint
Co-authored-by: Kavon Farvardin <kfarvardin@apple.com>
Co-authored-by: Slava Pestov <spestov@apple.com>
2024-05-16 13:47:36 -07:00
Michael Gottesman
e3e78ad6bb [sending] Change the internals of sending to be based around 'sending' instead of 'transferring'.
We still only parse transferring... but this sets us up for adding the new
'sending' syntax by first validating that this internal change does not mess up
the current transferring impl since we want both to keep working for now.

rdar://128216574
2024-05-16 12:20:45 -07:00
Alejandro Alonso
db9232f246 Merge pull request #73550 from Azoy/string-debugger-changes
[debug] Print strings using their description in the debugger
2024-05-16 11:40:00 -07:00
Mike Ash
857cc388d4 Merge pull request #73639 from mikeash/lazy-signposts
[Runtime] Don't emit signposts until the system is ready.
2024-05-16 14:30:39 -04:00
Alastair Houghton
0302944988 [Build] Add compatibility library deps to target executables.
We need to make sure that we add the compatibility libraries as
dependencies for target executables, otherwise we can end up with
a race condition in the build where the build will fail if the
compatibility libraries haven't been built by the time e.g.
`swift-backtrace` is linked.

rdar://128197532
2024-05-16 15:46:09 +01:00
Erik Eckstein
15acfbb268 stdlib: improve debug performance of UnsafePointer.pointer(to:)
Making those functions transparent enables to completely remove the creation of keypaths, even with -Onone.
rdar://127793797
2024-05-16 10:15:53 +02:00
Erik Eckstein
fb036e9019 stdlib: more efficient pointer overflow checks in the UnsafePointer.pointer(to:) functions
Saves the optional nil check for unwrapping the pointer and one condition
2024-05-16 10:15:42 +02:00