Commit Graph

21821 Commits

Author SHA1 Message Date
swift-ci
0f20b54db7 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-19 10:14:16 -07:00
Nate Cook
80f052e251 [stdlib] Switch to a linear-space variant of Myers diffing (#83212)
This changes the implementation for `Collection.difference(from:)` to
use a linear-space complexity variation of the same Myers algorithm. The
new version is similar in execution time to the existing one, but should
alleviate memory pressure when diffing collections where the number of
differences approaches the size of the collection. While the new
algorithm returns a set of changes that is the same size as the previous
version, the specific changes are not guaranteed to be the same.

rdar://155829876
2025-09-19 10:03:26 -07:00
swift-ci
e7eb500826 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-19 01:14:59 -07:00
Doug Gregor
844ba5f4f8 [Embedded] Diagnose non-final generic methods in class in the type checker
Move the diagnostic about non-final generic methods in classes up to
the type checker, so that it is available to `-Wwarning
EmbeddedRestrictions` and earlier in the pipeline. The SIL version of
this is still available as a backstop.

Yet another part of rdar://133874555.
2025-09-18 10:05:33 -07:00
swift-ci
27ad0fa578 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-18 06:18:04 -07:00
Doug Gregor
5a46664954 Merge pull request #84359 from DougGregor/diagnose-untyped-throws-in-embedded 2025-09-18 06:11:55 -07:00
Doug Gregor
7088022eef [Standard library] Eliminate ABI-only rethrows versions from Embedded
Where we have rethrowing versions of functions that have typed-throws
counterparts that are only retained for ABI compatibility, wrap them
in `#if !$Embedded` so they aren't compiled into the Embedded version
of the standard library. This eliminates warnings about this code,
which cannot actually be used with arbitrary errors anyway.
2025-09-17 13:09:49 -07:00
Ebuka Ezike
c4cee76605 [Debug] Re-enable DebugDescription macro on linux 2025-09-17 12:42:54 +01:00
Andrew Trick
9007036d2e Merge pull request #84276 from atrick/remove-span-unsafenonescapable
Mutable[Raw]Span.init() does not need @_unsafeNonescapableResult
2025-09-16 15:30:21 -07:00
David Smith
2c02ba3189 Remove a retain-release pair from -count for bridged arrays (#84247) 2025-09-16 12:41:27 -04:00
Ebuka Ezike
b2fda7ffe6 [Debug] Renable DebugDescription macro on linux 2025-09-16 14:28:14 +01:00
Yuta Saito
2b6ea81b9e Merge pull request #84285 from kateinoigakukun/yt/fix-tagged-funcptr
[Legacy Driver][wasm] Pass `--table-base` to reserve low function addresses
2025-09-16 08:26:04 +09:00
Yuta Saito
6915a36895 [NFC][wasm] Fix incorrect comment about reserved low addresses 2025-09-15 06:21:35 +00:00
Andrew Trick
20067350eb Mutable[Raw]Span.init() does not need @_unsafeNonescapableResult
It isn't clear why @_unsafeNonescapableResult was applied to
Mutable[Raw]Span.init(). It was either a mistake or temporary workaround for
some compiler bug.
2025-09-13 22:15:51 -07:00
Tony Allevato
e5b732d524 Merge pull request #84221 from allevato/float16-fix
[Runtime] Fix overload resolution when targeting Haswell.
2025-09-12 16:50:04 -04:00
Peter Rong
b396bd05a3 [stdlib] Add explict import to ReflectionTest to avoid name conflicts in stdlib and Darwin (#81953)
Similar to #77155 , we disambiguate stdin, stdout, and stderr now.

Signed-off-by: Peter Rong <PeterRong@meta.com>
2025-09-12 10:08:21 -07:00
Tony Allevato
4578d0b2a3 [Runtime] Fix overload resolution when targeting Haswell. 2025-09-11 08:44:03 -04:00
Eric Miotto
db18a725d4 CMake: make the libswiftCompatibilitySpan symlink relative (#84200)
Currently we create an absolute one -- this prevents to use the partial
toolchain before the installation phase (namely for configurations that
run Swift tests on a different device than the builder).

Addresses rdar://160277259
2025-09-10 22:53:02 -07:00
Mike Ash
b871c26d44 Merge pull request #84114 from mikeash/async-task-cputrace
[Concurrency] Emit async task running/waitingOn metadata inline into CPUTrace.
2025-09-10 19:53:26 -04:00
Mike Ash
0116da253e [Concurrency] Emit async task running/waitingOn metadata inline into CPUTrace.
This allows tracking async code execution throughout a task's lifetime.

rdar://137230240
2025-09-10 11:32:10 -04:00
Anton Korobeynikov
7668666ad2 Support differentiation of wrapped value modify accessors (#78794)
Some fixes for coroutines with normal results and `partial_apply` of coroutines were required.

Fixes #55084
2025-09-10 02:30:26 -07:00
Egor Zhdan
6f0ab5dce8 Merge pull request #83914 from egorzhdan/egorzhdan/guiddef
[WinSDK] Modularize `<guiddef.h>`
2025-09-09 16:24:23 +01:00
Alastair Houghton
3e74869830 Merge pull request #84122 from al45tair/eng/PR-159930644
[Linux][Backtracing] Don't try to use `process_vm_readv()`.
2025-09-09 11:16:11 +01:00
Tim Kientzle
e5f9ffce12 Merge pull request #84024 from tbkka/tbkka-missing-embedded-allocators
Fill in two missing functions for Embedded Swift
2025-09-08 06:44:10 -07:00
Alastair Houghton
da4e319d16 [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-05 11:38:28 +01:00
David Smith
11adbdd707 Don't grow smol Strings to 16 characters when bridging out if tagged pointer formation fails (#84068)
Fixes rdar://159771498
2025-09-04 12:34:19 -07:00
Stephen Canon
f3da6b205e Try to clarify availability of Float16 and Float80 (#84011) 2025-09-04 10:22:18 -04:00
Stephen Canon
de8c4cd4d5 Mark U[M]BP.baseAddress transparent (#84097)
As well as a few other trivial API, since apparentely these do not reliably get inlined as-is.

Addresses rdar://159801610
2025-09-04 08:21:16 -04:00
Guillaume Lessard
cbcef93a54 Merge pull request #84002 from stephentyrone/pointer-comment-clarification
Remove "if and only if" language from [Raw]Span's _pointer field
2025-09-03 16:33:36 -07:00
Arnold Schwaighofer
f1b6de0de5 Merge pull request #83833 from aschwaighofer/mark_unsaferawpointer_withContiguousStorageIfAvailable_inline_always
stdlib: Mark UnsafeRawBufferPointer's withContiguousStorageIfAvailable as @inline(__always)
2025-09-02 10:17:59 -07:00
Tim Kientzle
ff50f8f2be Fill in two missing functions for Embedded Swift
`swift_coroFrameAlloc` is needed by `_read`/`_modify` accessors

`swift_deallocUninitializedObject` which I believe is needed for failable class initializers

Resolves rdar://157028375
Resolves rdar://157276375
2025-08-29 16:57:08 -07:00
Eric Miotto
c9345a38c4 [Concurrency] Add availability to one of the ExecutorJob extensions
Without this, we may fail building Concurrency when enforcing strict
availability.

Addresses rdar://159473855
2025-08-29 15:09:46 -07:00
Eric Miotto
5464129aa1 Merge pull request #83990 from edymtt/edymtt/update-availability-taskpriority
[Concurrency] Change availability for a TaskPriority extension
2025-08-29 13:48:55 -07:00
Stephen Canon
567c619e3f Remove "if and only if" language from [Raw]Span's _pointer field
"can be nil" paired with "if and only if" lends itself to misreading, so let's clean this up a bit.
2025-08-29 09:36:12 -04:00
Jesse L. Zamora
bf60ab1630 Float16Support.cpp: Add __arm__ for ARM 32-bit architectures (#83979)
This is the only patch required to cross-compile Swift for armv6 and armv7 that is used here:

https://github.com/swift-embedded-linux/armhf-debian/blob/main/patches/0002-Add-arm-to-float16support-for-missing-symbol.patch
2025-08-29 10:03:41 +01:00
Eric Miotto
173c5ff2a4 [Concurrency] Change availability for a TaskPriority extension
We need the `init?(JobPriority)` constructor to be
`StdlibDeploymentTarget 5.9`
so the compiler will not complain when we reference it
 from `ExecutorJob.createTrampoline` when building the standard library
without strict availability.

Addresses rdar://159397287
2025-08-28 15:34:10 -07:00
Egor Zhdan
28f9db7bfa [WinSDK] Modularize <guiddef.h>
This fixes modularization errors that arise when importing a C++ header that contains `#include <guiddef.h>`, which might hijack this header from the WinSDK module where it belongs.
2025-08-28 22:21:55 +01:00
Egor Zhdan
4b0e8861f5 [cxx-interop] Fix warning about missing unsafe 2025-08-28 12:10:14 +01:00
Egor Zhdan
521c2cea94 Merge pull request #83943 from egorzhdan/egorzhdan/wstring
[cxx-interop] Provide overlay for `std::wstring`
2025-08-28 10:35:51 +01:00
Egor Zhdan
4dda78846d [cxx-interop] Provide overlay for std::wstring
This adds CxxStdlib overlay features to `std::wstring` similarly to `std::string`, `std::u16string`, etc.

This lets clients e.g. convert between Swift String and C++ wide string simply by calling an initializer.

rdar://159272493
2025-08-27 13:20:09 +01:00
Alastair Houghton
687e09da65 Merge pull request #82456 from al45tair/concurrency-updates
[Concurrency] Updates after second SE pitch.
2025-08-27 11:40:07 +01:00
Saleem Abdulrasool
6f1b83143a Merge pull request #83933 from compnerd/unsafe
Windows: annotate unsafe constructs in the overlay
2025-08-26 23:47:32 -07:00
Doug Gregor
75b94d7a5b Merge pull request #83921 from DougGregor/with-unsafe-temporary-alloc-typed-throws
Adopt typed throws in withUnsafeTemporaryAllocation
2025-08-26 22:47:49 -07:00
Saleem Abdulrasool
eafc8140da Windows: annotate unsafe constructs in the overlay
Mark a number of overlay calls as `unsafe` to account for the new memory
safety work.
2025-08-26 18:03:56 -07:00
Doug Gregor
45069a199b Merge pull request #82080 from jamieQ/patch-2
[docs][NFC]: minor formatting edits to SendableMetatype docs
2025-08-26 17:15:45 -07:00
Doug Gregor
3782db5ce1 Small fixes for typed throws in withUnsafeTemporaryAllocation 2025-08-26 17:09:07 -07:00
Doug Gregor
e96e1746bb Adopt typed throws in withUnsafeTemporaryAllocation
The interior wrapping in Result<T, U> is a little unfortunate, but is
currently necessary because we end up with extra stack allocations
along the error-handling path in a do..catch that aren't there when
using untyped throws. We can simplify the implementation if we can
eliminate the extraneous stack allocation.

Fixes rdar://134973620.
2025-08-26 13:06:48 -07:00
Alastair Houghton
d6224d16d9 [Concurrency] Fix minimal stdlib build again.
Some mentions of `ExecutorJob` were not guarded by the required
`SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY` condition.
2025-08-26 09:38:14 +01:00
Alastair Houghton
ff8d2fa80c [Concurrency] Support continuous waits in CooperativeExecutor.
This fixes some WASM tests.
2025-08-26 09:38:14 +01:00
Alastair Houghton
bd27a14ea0 [Concurrency] Fix cooperative executor to return only after all jobs run.
We were terminating after the first set of jobs; if one of them scheduled
another job, and there were no timers running, we would terminate,
which was wrong.
2025-08-26 09:38:13 +01:00