Commit Graph

21503 Commits

Author SHA1 Message Date
Doug Gregor
5464841e90 Make the _Concurrency library depend on _Builtin_float
rdar://163386438
2025-10-27 15:17:02 +00:00
Henrik G. Olsson
2afd4ec7a4 Revert "add std::span to module map for libstdc++"
This reverts commit f7d5902db5.

It was part of a larger PR in
https://github.com/swiftlang/swift/pull/84755, but turned out to be
broken for older versions of libstdc++. Since it's not critical to the
functionality of the larger PR, this reverts the problematic part.

rdar://161999183
2025-10-15 13:52:31 -07:00
Henrik G. Olsson
6a9ac22cd2 Merge pull request #84507 from hnrklssn/swiftify-import-as-method
[Swiftify] Add support for free functions imported as instance methods

(cherry picked from commit ed4f058c01)
2025-10-07 20:12:44 -07:00
Alastair Houghton
2b7c0aa1f6 [Linux][Backtracing] Don't try to use process_vm_readv().
We used to try to use `process_vm_readv()` if `CAP_SYS_PTRACE` is
enabled.  This avoided using signal handlers to catch crashes when
we try to read through an invalid pointer, but it complicates the
code and it turns out not to work on some Linux kernels where
the `process_vm_readv()` syscall is unavailable.

rdar://159930644
2025-09-26 08:57:04 +01:00
Yuta Saito
908b7b58c3 [NFC][wasm] Fix incorrect comment about reserved low addresses 2025-09-15 07:09:06 +00:00
Eric Miotto
7aa050dd4e [6.2] CMake: make the libswiftCompatibilitySpan symlink relative symlink (#84201)
- **Explanation**: create the symlink from
libswiftCompatibilitySpan.dylib to libswiftCore.dylib in the Swift build
folder as a relative one instead of an absolute one, to support device
testing.
- **Scope**: CMake code that creates the symlink for
libswiftCompatibilitySpan.dylib during builds
- **Issues**: rdar://159314722
- **Original PRs**:  #84200
- **Risk**: Low, scope is limited to configurations that run tests on a
machine different form the builder, regular CI tests are not affected
(since symlinks are valid on the builder itself), and packaging
regenerates the symlink with a different mechanism.
- **Testing**: ensured at desk that `stdlib/Span` test can run on a
different machine (i.e. using `remote-run`)
- **Reviewers**: waiting for reviews in the main PR
2025-09-10 22:54:31 -07:00
Alejandro Alonso
0877b04efe Merge pull request #81365 from Azoy/my-existentials
[AST & Runtime] Correctly mangle extended existentials with inverse requirements
2025-08-27 10:00:59 -07:00
Guillaume Lessard
d03de08221 Merge pull request #83775 from glessard/rdar158440246-62
[stdlib, 6.2.x] guard against deinitializing empty OutputSpan instances
2025-08-22 13:42:00 -07:00
Guillaume Lessard
39cc73b97d Merge pull request #83438 from glessard/rdar157064330-also-available-now
[stdlib, 6.2] fix availability of `Span.bytes`
2025-08-22 09:57:50 -07:00
finagolfin
cd62ce002c Merge pull request #83503 from finagolfin/droid
[6.2][build] Make it possible to build a cross-compilation toolchain for Android, including Testing

Add a linker flag for the upcoming 16 KB page support in Android, generate an Android CMake toolchain file that can be used to cross-compile repos like cmark and Testing, and add a build flag that makes it easy to build cross-compilation toolchains, by disabling the cross-compilation of all host tools and macros for listed --cross-compile-hosts, leaving only the Swift runtime libraries in a cross-compilation SDK.
2025-08-22 16:42:24 +05:30
Max Desiatov
94539464ca [6.2] Embedded Wasm: enable import WASILibc (#83846)
**Explanation**: Cherry-pick of #83792, merged as 450cb14597
WASILibc wasn't built for the embedded stdlib in `stdlib/public/Platform/CMakeLists.txt`. New `copy_wasilibc_modulemap_embedded_resource` and `embedded-stdlib-platform-${triple}` targets are added, the latter for `wasm32-unknown-wasip1` only for now. Also added a `wasilibc_functions.swift` test to verify the result.
**Scope**: limited to Embedded Swift for Wasm;
**Risk**: low due to limited scope;
**Testing**: added new lit test to the existing Embedded Swift test suite;
**Issue**: rdar://157467412
**Reviewer**: @bnbarham
2025-08-22 09:28:23 +01:00
Guillaume Lessard
5e9c3f4a1d [stdlib] guard against underflow 2025-08-16 04:13:15 -07:00
Gábor Horváth
99f9c318ca [6.2][StrictMemorySafety] Check the safety of return types of calls
Explanation: There were some scenarios where we could call an unsafe
function without marking the expression as unsafe. These affect mostly
cases where the function's result is passed to another function or
returned. This PR makes sure we always flag functions with unsafe return
types, even if their result is not stored anywhere for later use.
Issues: rdar://157237301
Original PRs: #83520
Risk: Low, worst case scenario the user has to add redundant unsafe
keywords in strict memory safe mode.
Testing: Added a compiler test.
Reviewers: @DougGregor
2025-08-13 11:49:22 +01:00
Marc Prud'hommeaux
7f09af24cf Support 16 KB page sizes on Android (#81596)
Android 15+ requires that native libraries be compiled with a linker
flag to support 16 KB page sizes. See:
https://developer.android.com/guide/practices/page-sizes#compile-r26-lower
2025-08-11 04:31:19 +05:30
Philippe Hausler
838cb7a91b Revert "[Observation] Ensure deinitialized Observable types don't leave active observations in memory (#82752)" (#83492)
This reverts commit a349e64039.

This is in concert of https://github.com/swiftlang/swift/pull/83436

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-08-08 17:13:13 -07:00
Guillaume Lessard
2c5da55981 [stdlib] fix availability of Span.bytes 2025-07-30 12:55:33 -07:00
Slava Pestov
95baef19df Merge pull request #83300 from slavapestov/update-availability-macros-26-6.0
[6.2] Update utils/availability-macros.def
2025-07-26 10:47:45 -04:00
David Smith
215620af3d [6.2] Fix lengthOfBytes(using:) semantics (#83340)
(cherry picked from commit ea7c3d4ec8)
2025-07-25 22:22:51 -07:00
Alastair Houghton
4f7be0814a [Concurrency] Update availability of UnimplementedExecutor.
We need it to be `StdlibDeploymentTarget 6.2` rather than
`SwiftStdlib 6.2`, so that we can update the availability definitions.

rdar://156710569
2025-07-25 15:45:46 -04:00
David Smith
155d7fbbcf [6.2] Make sure SwiftObject doesn't crash when compared to tagged pointers (#83271)
Cherry pick of https://github.com/swiftlang/swift/pull/83269
2025-07-25 01:11:46 -07:00
Michael Ilseman
7983566de5 [6.2] Better docs for UTF8Span (#83184) (#83209)
Cherry pick of https://github.com/swiftlang/swift/pull/83184

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->

Co-authored-by: Alex Martini <amartini@apple.com>
2025-07-23 03:48:20 -07:00
Stephen Canon
59e64904dc [6.2] Use unsigned arithmetic for Span bounds checks (#83215)
This allows us to eliminate a comparison;
https://github.com/swiftlang/swift/pull/83172 will allow the compiler to
do it for us instead in the future.

**Explanation:** Changes the implementation of Span's subscript bounds
checks to use a single unsigned comparison instead of two signed
compares.
**Scope:** Narrow. Does not apply to any other API.
**Issues:** rdar://156068535 
**Original PRs:** https://github.com/swiftlang/swift/pull/83150
**Risk:** Low. Minor implementation tweaks to API that is not widely
adopted.
**Testing:** CI
**Reviewers:** @glessard @meg-gupta
2025-07-23 03:38:07 -07:00
Guillaume Lessard
a345e3a8b3 Merge pull request #83000 from glessard/rdar147780495-OutputSpan-updates-62
[SE-0485, 6.2] OutputSpan and OutputRawSpan
2025-07-17 19:12:58 -07:00
Yuta Saito
0a5a694b46 Merge pull request #83120 from kateinoigakukun/yt/cherry-pick-6.2-gh83086
[6.2][Concurrency] Fix runtime isolated-conformance checks with static stdlib
2025-07-17 22:00:15 +09:00
Konrad `ktoso` Malawski
8e4d9a3c8a [6.2][Concurrency] Remove symbols of startSynchronously, make it AEIC (#83089)
Co-authored-by: Pavel Yaskevich <pyaskevich@apple.com>
2025-07-17 00:44:36 -07:00
Guillaume Lessard
2a88f0e764 [stdlib] add OutputSpan to backdeployment library 2025-07-16 17:19:42 -07:00
Yuta Saito
e6453a34a0 [Concurrency] Fix runtime isolated-conformance checks with static stdlib
Most of linkers pull object files from static archives only if any
symbol from that object file is referenced, even if the object contains
a ctor code. `Setup.cpp` didn't have any symbols referenced from
other code, so it was not linked in when the concurrency runtime was
linked in statically. This commit moves the ctor code to `Task.cpp`
to ensure that it is always linked in.
2025-07-16 23:50:31 +00:00
Guillaume Lessard
5ba72f267f Merge pull request #83023 from glessard/rdar155474776-extracting-62
[SE-0488, 6.2] Implementation for SE-0488
2025-07-15 13:59:29 -07:00
Saleem Abdulrasool
8bf3af09a6 Merge pull request #82166 from Steelskin/fabrice/6.2-line-directive
🍒 [6.2] line-directive: Stop expanding response files
2025-07-15 11:40:13 -07:00
Jonas Devlieghere
3d0ceb7715 Merge pull request #82997 from augusto2112/change-remote-addr-6.2-3
[NFC][RemoteInspection] Add an opaque AddressSpace field to RemoteAddress
2025-07-14 13:24:19 -07:00
Alastair Houghton
eefdd69c8d Merge pull request #82915 from al45tair/eng/PR-151147606-take2
[Concurrency] Remove custom global executors from 6.2.
2025-07-14 16:20:57 +01:00
Guillaume Lessard
6414aa226f [stdlib] rename RawSpan.extracting functions 2025-07-12 22:58:00 -07:00
Guillaume Lessard
ac3e47612c [stdlib] rename Span.extracting functions 2025-07-12 22:58:00 -07:00
Guillaume Lessard
402a0cf2c8 [stdlib] remove bulk-update from MutableRawSpan per SE-0485 2025-07-11 19:03:03 -07:00
Guillaume Lessard
34a26d6d9a [stdlib] remove bulk-update from MutableSpan per SE-0485 2025-07-11 19:03:03 -07:00
Guillaume Lessard
3b4279c671 [stdlib] rename MutableRawSpan.extracting functions 2025-07-11 19:03:03 -07:00
Guillaume Lessard
05fe6fa522 [stdlib] rename MutableSpan.extracting functions 2025-07-11 19:03:03 -07:00
Guillaume Lessard
8c7d0db816 [stdlib] make OutputRawSpan changes from SE-0485 2025-07-11 19:03:02 -07:00
Guillaume Lessard
f11f3a9b72 [stdlib] make OutputSpan changes from SE-0485 2025-07-11 19:03:02 -07:00
Guillaume Lessard
ea4083777b [stdlib] internal UnsafeRawBufferPointer tweaks 2025-07-11 19:03:02 -07:00
Guillaume Lessard
d078734051 [stdlib] InlineArray consumed by OutputSpan 2025-07-11 19:03:01 -07:00
Guillaume Lessard
9f9565f4b2 [stdlib] in-place initializer for InlineArray 2025-07-11 19:03:01 -07:00
Guillaume Lessard
42c5988161 [stdlib] add OutputRawSpan 2025-07-11 19:03:01 -07:00
Guillaume Lessard
850bb23d48 [stdlib] add OutputSpan 2025-07-11 19:03:00 -07:00
Guillaume Lessard
ccffb19afd [stdlib] alignment-checking functions for pointers
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2025-07-11 19:03:00 -07:00
Augusto Noronha
79824f56b2 [RemoteAddress] Handle comparison of addresses in different spaces
Sometimes it makes sense to compares addresses from different address
spaces.

rdar://148361743
(cherry picked from commit c97dfd6b05)
2025-07-11 16:36:40 -07:00
Augusto Noronha
e2c8b761cd [NFC][RemoteInspection] Add an opaque AddressSpace field to RemoteAddress
Add an extra opaque field to AddressSpace, which can be used by clients
of RemoteInspection to distinguish between different address spaces.

LLDB employs an optimization where it reads memory from files instead of
the running process whenever it can to speed up memory reads (these can
be slow when debugging something over a network). To do this, it needs
to keep track whether an address originated from a process or a file. It
currently distinguishes addresses by setting an unused high bit on the
address, but because of pointer authentication this is not a reliable
solution. In order to keep this optimization working, this patch adds an
extra opaque AddressSpace field to RemoteAddress, which LLDB can use on
its own implementation of MemoryReader to distinguish between addresses.

This patch is NFC for the other RemoteInspection clients, as it adds
extra information to RemoteAddress, which is entirely optional and if
unused should not change the behavior of the library.

Although this patch is quite big the changes are largely mechanical,
replacing threading StoredPointer with RemoteAddress.

rdar://148361743
(cherry picked from commit 58df5534d2)
(cherry picked from commit 8f3862b5e7)
2025-07-11 16:36:40 -07:00
Konrad `ktoso` Malawski
9ac4ebc603 Merge pull request #82984 from ktoso/pick-task-group-docs 2025-07-12 05:01:37 +09:00
Alex Martini
12b998e4bc Revise doc comment for style & clarity
- Move the definition of 'structured concurrency' to the beginning of
  the section.
- Avoid future tense.  Fix some mixed future+present tense errors.
- Write bullet points as individual sentences, not as the clauses of one
  long sentence.
- Apple Style: Use 'since' only in the sense of 'after'.
- Apple Style: Use 'you' instead of 'one'.
- Apple Style: Close up 'non-' except when ambiguous.
- DevPubs style: Avoid bare 'this' for clarity.  Here, 'this guarantee'
  tells the reader what 'this' refers to.
- DevPubs style: Avoid 'may' which can be ambiguous between possibility
  and permission.
2025-07-11 12:00:54 +09:00
Alex Martini
430f49b98b Fix more 'cancel(l)ed' style issues 2025-07-11 11:45:25 +09:00