Commit Graph

8274 Commits

Author SHA1 Message Date
John Hui e350e7e716 Merge pull request #89156 from j-hui/c_int128 2026-05-20 07:58:47 -07:00
Guillaume Lessard 616e61a367 Merge pull request #89188 from glessard/rdar177198190-ref-mutableref-conformances 2026-05-18 13:00:24 -07:00
Guillaume Lessard 28b627070a [stdlib] add missing conformances to Ref and MutableRef 2026-05-15 18:20:05 -07:00
Allan Shortlidge 4728376a57 Revert "stdlib: Remove superfluous SwiftStdlib 6.3 availability checks"
This reverts commit 27d605c584.
2026-05-15 16:51:18 -07:00
John Hui 1fe7f685b5 [cxx-interop] Import __int128 as CInt128
Swift gained native Int128 / UInt128 types in SE-0425, but the plumbing
for bridging them across the C/C++ boundary was incomplete. CInt128 and
CUnsignedInt128 were never added to CTypes.swift, even though
BuiltinMappedTypes.def has been mapping __int128 / unsigned __int128 to
those names since 2013. Without the typealiases, every C declaration
mentioning __int128 was silently dropped at import time.

This patch adds the CInt128 and CUInt128 type aliases to CTypes.swift
for forward interop, and also adds the Int128 -> __int128 mapping in
PrintAsClang and IRABIDetailsProvider for reverse interop.

rdar://177111210
2026-05-14 20:58:50 -07:00
Guillaume Lessard fd595f461e Merge pull request #88934 from glessard/rdar147935102-span-bytes-docs
[stdlib] improve doc-comments for span and bytes properties
2026-05-13 15:27:08 -07:00
Allan Shortlidge e4ee38446e Merge pull request #89050 from tshortli/warnings
stdlib/Runtimes: Address a few warnings
2026-05-13 00:38:33 -07:00
Guillaume Lessard 459a3208c4 Merge pull request #89063 from glessard/rdar139816157-se0525-followup
[stdlib] remove functions deferred from SE-0525
2026-05-12 20:20:06 -07:00
Doug Gregor e41f6dbc49 Merge pull request #89047 from DougGregor/embedded-alloc-dealloc-box
[Embedded] Centralize allocation size/alignment computation for boxes
2026-05-12 19:49:26 -07:00
Allan Shortlidge 794b905c31 Merge pull request #88890 from tshortli/stdlib-remove-superfluous-availability-checks
stdlib: Remove superfluous `StdlibDeploymentTarget 6.3` checks
2026-05-12 18:06:13 -07:00
Guillaume Lessard 7befc8ff8c [stdlib] remove functions deferred from SE-0525 2026-05-12 15:18:45 -07:00
Guillaume Lessard 6e140559b8 [stdlib] rephrase some doc-comment notes with active voice 2026-05-12 13:56:51 -07:00
Guillaume Lessard eb8cea792c [stdlib] apply code fences to doc-comment code examples 2026-05-12 13:11:31 -07:00
Allan Shortlidge 0a8918c317 stdlib: Remove spurious unsafe in StringStorageBridge.swift.
Calling `withUnsafeTemporaryAllocation()` is not unsafe by itself - using the
pointer it provides is.
2026-05-12 10:56:36 -07:00
Doug Gregor d0957a8933 [Embedded] Centralize allocation size/alignment computation for boxes
swift_allocBox was correctly computing allocation size/alignment.
swift_deallocBox was compiting it differently (and incorrectly).
Factor out the logic into a separate function that we use from both
places.
2026-05-12 10:45:13 -07:00
Allan Shortlidge 27d605c584 stdlib: Remove superfluous SwiftStdlib 6.3 availability checks
Now that `SwiftStdlib 6.3` maps to real versions for Apple's operating systems
(https://github.com/swiftlang/swift/pull/87510), checks like

```
if #available(StdlibDeploymentTarget 6.3, *) { ... }
```

inside the implementation of the stdlib are no longer necessary to satisfy the
availability checker and instead cause warnings to be emitted.  Remove the now
superfluous checks.

This is a reattempt of https://github.com/swiftlang/swift/pull/87744. The
previous attempt was reverted because it turned out that there were some
configurations (outside of Swift CI) in which the stdlib was built with an
unnecessarily low deployment target. That has now been corrected, unblocking
this fix.
2026-05-12 08:34:31 -07:00
Karoy Lorentey 285fd54fde Merge pull request #88900 from lorentey/bump-swift-version
Bump Swift version to 6.5
2026-05-11 18:28:56 -07:00
Alejandro Alonso 66a1326cdb Merge pull request #88990 from Azoy/nonescapable-ref
[stdlib] Let `Ref` reference nonescapable types
2026-05-10 16:57:15 -07:00
David Smith 51b4c9b7d0 Don't attempt to create tagged pointer strings for >11 characters (#88810)
Fixes rdar://176209576
2026-05-09 20:25:21 -07:00
Alejandro Alonso f5561eaa4a Let Ref reference nonescapable types 2026-05-09 11:00:23 -07:00
David Smith ed3eec2cd1 Change String growth to resize by 1.625x instead of 2x (#88973)
Fixes rdar://59684914
2026-05-09 08:48:39 -07:00
Allan Shortlidge 9211f0aa46 stdlib: Remove superfluous unsafe markers.
Resolves warnings introduced by https://github.com/swiftlang/swift/pull/87271.
2026-05-08 16:14:04 -07:00
David Smith f08afd00c3 Vectorize UTF16->UTF8 transcoding (#83073)
Fixes rdar://141789595
2026-05-08 11:49:00 -07:00
Doug Gregor 5ac23be8fd Merge pull request #88862 from DougGregor/embedded-concurrency-minimized-dependencies
Minimize platform dependencies in the Embedded Swift Concurrency library
2026-05-07 10:37:32 -07:00
Guillaume Lessard e4db90b222 [stdlib] improve doc-comments for span and bytes properties 2026-05-07 10:29:01 -07:00
David Smith 5039cccf80 Add a cross-encoding version of strcmp, use it in bridged String equality, and expose it for Foundation's use (#87271)
There's a longstanding problem in implementing `-isEqualToString:`,
where if you don't know how to get fast access to the other NSString's
contents, you have to pick between doing it character by character (very
slow), or calling [other isEqualToString: self], which risks infinite
recursion if the other string does the same.

This cuts the gordian knot by adding a new method
`isEqualToBytes:encoding:count:`, so you can get the contents out of
`self`, and hand it to the other string, confident that it will not need
to (nor, in fact be able to) ask you anything that might recurse.
2026-05-07 02:10:44 -07:00
Karoy Lorentey da885c09e8 Bump Swift Compiler/Stdlib/Runtime version to 6.5 2026-05-06 16:21:38 -07:00
Doug Gregor cb5b0ee938 [Embedded Concurrency] Route fatal errors to a new _swift_fatalError
Fatal errors in the concurrency runtime used a mix of
swift_Concurrency_fatalError[v] and manual calls to abort(). Drop the
dependency on abort() by routing all true fatal errors through
swift_Concurrency_fatalErrorv and eventually to a new
`_swift_fatalError` C entrypoint defined in the Embedded Swift
runtime, which (optionally) prints and then (always) traps.
2026-05-05 18:06:30 -07:00
Doug Gregor 9782c5d82f [Embedded] Implement swift_getObjectType and swift_compareWitnessTables
The concurrency runtime makes use of these functions, which have
trivial implementations. Implement them in the Embedded Swift runtime.
2026-05-05 16:40:10 -07:00
Doug Gregor c5981970c2 [stdlib] Use defer and typed throws in withUnsafeTemporaryAllocation
When introducing typed throws to withUnsafeTemporaryAllocation, we
encountered limitations with `defer` that required a workaround of
going through Result. Now that we can handle stack-manipulating
builtins in `defer`, which to that. Fixes #88441.
2026-05-04 13:01:27 -07:00
Doug Gregor 6c555aa605 Merge pull request #88786 from Azoy/borrow-to-ref
[stdlib] Rename Borrow and Inout to Ref and MutableRef
2026-05-03 22:02:17 -07:00
Doug Gregor 64e9cea4ab Merge pull request #88702 from glessard/rdar139816157-safe-loading-api-rawspan
[SE-0525] Safe loading API for `RawSpan` family
2026-05-03 21:52:19 -07:00
Andrew Trick 247a258518 Merge pull request #84701 from atrick/rawpointer-nonescapable
[stdlib] ~Escapable raw pointer access: API adoption in URP, UMRP, URBP, UMRBP
2026-05-02 13:11:40 -07:00
Guillaume Lessard d2840789e5 [stdlib] add some missing parameter labels 2026-05-02 12:45:00 -07:00
Guillaume Lessard 15bbce2a00 [stdlib] fix ABI of ByteOrder.native 2026-05-02 05:48:12 -07:00
Guillaume Lessard 5aed20039d [stdlib] rename append(elementCount:…)
Argument label `elementCount` becomes `upTo`.
2026-05-02 05:48:12 -07:00
Guillaume Lessard e17e28b3cc [stdlib] add availability for Float16 2026-05-02 05:48:11 -07:00
Guillaume Lessard 82a9428bb1 [stdlib] fix an oversight 2026-05-02 05:48:10 -07:00
Guillaume Lessard 3d13e6b414 [stdlib] doc-comment updates 2026-05-02 05:48:10 -07:00
Guillaume Lessard 49773d4d9c [stdlib] fix an unavailability message 2026-05-02 05:48:09 -07:00
Guillaume Lessard 5007cf2bd8 [stdlib] consistency fixes 2026-05-02 05:48:09 -07:00
Guillaume Lessard 265ab26995 [stdlib] move conformances to their parent types’s files 2026-05-02 05:48:09 -07:00
Guillaume Lessard e767f20271 [stdlib] SE-0525 additions to OutputRawSpan 2026-05-02 05:48:08 -07:00
Guillaume Lessard 4e08d9788e [stdlib] add missing overloads 2026-05-02 05:47:48 -07:00
Guillaume Lessard fee8ae82ad [stdlib] SE-0525 additions to MutableRawSpan 2026-05-02 05:47:48 -07:00
Guillaume Lessard 9502451ba9 [stdlib] SE-0525 additions to RawSpan 2026-05-02 05:47:17 -07:00
Guillaume Lessard 2fa0b46e4e [stdlib] ByteOrder tweaks 2026-05-02 05:47:17 -07:00
Guillaume Lessard 91b9eda7ba [stdlib] SE-0525 addition to OutputSpan 2026-05-02 05:47:16 -07:00
Guillaume Lessard 429c4af567 [stdlib] SE-0525 additions to MutableSpan 2026-05-02 05:47:16 -07:00
Guillaume Lessard 8e5539f619 [stdlib] SE-0525 additions to Span 2026-05-02 05:47:15 -07:00