Guillaume Lessard
b508206844
[span] improve indices(of:) and byteOffsets(of:)
2024-10-23 18:19:21 -07:00
Guillaume Lessard
5d49bd60b7
[span] allow start pointers of empty spans to be exposed
2024-10-23 14:59:07 -07:00
Guillaume Lessard
6fa9780bc5
[span] improve _elementsEqual
2024-10-23 14:48:25 -07:00
Guillaume Lessard
108034e4b0
[span] fix a bounds-checking mistake
2024-10-23 14:06:26 -07:00
Guillaume Lessard
e58e50d17c
[span] add availability annotations
2024-10-23 13:14:26 -07:00
Guillaume Lessard
909409181a
[gardening] add a relevant FIXME comment
2024-10-23 13:14:22 -07:00
Kuba Mracek
0048c1c624
[embedded] Document the details of the Embedded Swift's refcounting scheme
2024-10-21 08:56:22 -07:00
Guillaume Lessard
979523014c
[span] update to match latest proposal tweaks
2024-10-19 23:46:54 -07:00
Kuba Mracek
8666aef39f
[embedded] Fix a memory leak caused by incorrect refcounting logic around doNotFreeBit
2024-10-18 23:19:40 -07:00
Guillaume Lessard
7faf7bc634
[stdlib] add Span
2024-10-18 22:57:43 -07:00
Guillaume Lessard
5b3647270b
[stdlib] add RawSpan
2024-10-18 22:57:43 -07:00
Guillaume Lessard
5e819aeea6
[stdlib] generalize isPOD() over suppressible protocols
2024-10-18 22:57:43 -07:00
David Smith
bed89567d4
Disable calling _swift_stdlib_dyld_is_objc_constant_string, it's unnecessary currently ( #77064 )
2024-10-17 19:01:08 -07:00
Kuba (Brecka) Mracek
44bea0552a
Merge pull request #76029 from kubamracek/embedded-traps-unique
...
[embedded] Make assert helper functions always inlined to avoid trap basic blocks from merging
2024-10-16 22:46:39 -07:00
Nate Cook
9265743adc
Add validation to CollectionDifference decoder ( #76876 )
...
The `CollectionDifference` type has a few different invariants
that were not being validated when initializing using the type's
`Decodable` conformance, since the type was using the
autogenerated `Codable` implementation. This change provides
manual implementations of the `Encodable` and `Decodable`
requirements, and adds tests that validate the failure when trying
to decode invalid JSON for CollectionDifference (and a few other
types).
2024-10-11 17:23:55 -07:00
David Smith
bca125c760
rdar://137709108 (Mitigate the code size increase from eager-lazy array bridging by marking some methods release none) ( #76966 )
2024-10-10 23:29:25 -07:00
Karoy Lorentey
29cf262ef7
[stdlib] String.Index: conform to CustomDebugStringConvertible instead
...
Apply the LSG’s modifications as detailed in their review notes.
2024-10-07 17:00:13 -07:00
Karoy Lorentey
28ed16b469
[stdlib] String.Index.description: Explicitly note that the returned format is not stable
...
This tends to be generally through for most `description` properties, but explicitly calling it out should help preventing people from trying to parse the result in this case.
2024-10-07 16:02:18 -07:00
Karoy Lorentey
e39613b851
[stdlib] String.Index.description: Use @_aeic for now
2024-10-07 16:02:18 -07:00
Karoy Lorentey
01792372a9
[stdlib] String.Index: conform to CustomStringConvertible
...
This better exposes the internals of string indices, demystifying their operation and radically simplifying working with them.
2024-10-07 16:02:16 -07:00
Konrad `ktoso` Malawski
dea3b59331
Merge pull request #76250 from ktoso/wip-experimental-isolated-deinit
2024-10-03 17:19:10 +09:00
Egor Zhdan
7f597c63ae
Merge pull request #76726 from swiftlang/egorzhdan/char8_t
...
[cxx-interop] Support `char8_t` C++20 type
2024-10-02 16:10:17 +01:00
Doug Gregor
af49172b55
Mark Range.init(uncheckedBounds:) and ClosedRange.init(uncheckedBounds:) as @unsafe
2024-09-30 15:20:36 -07:00
Konrad `ktoso` Malawski
45b97f146b
Merge branch 'main' into wip-experimental-isolated-deinit
2024-09-30 13:47:39 +09:00
Amritpan Kaur
6066418340
Merge pull request #73242 from amritpan/metatype-kp-implementation
2024-09-28 02:46:15 -07:00
Philippe Hausler
4f53f189e0
[Embedded] Enable RangeSet for embedded targets ( #76614 )
2024-09-27 09:20:11 -07:00
Egor Zhdan
fcb590690e
[cxx-interop] Support char8_t C++20 type
...
https://en.cppreference.com/w/cpp/keyword/char8_t
This is based on a patch from Varun Gandhi: https://github.com/swiftlang/swift/pull/26153
rdar://39988329 / resolves https://github.com/swiftlang/swift/issues/68726
2024-09-27 13:56:03 +01:00
Amritpan Kaur
1c494c4d89
[StdLib] Handle nil property descriptors.
2024-09-25 12:54:52 -07:00
Kuba (Brecka) Mracek
d3c5149714
Merge pull request #76658 from kubamracek/embedded-managed-buffer
...
[embedded] Add support for ManagedBuffer to Embedded Swift
2024-09-25 02:54:55 -07:00
Kuba Mracek
0b50c2155e
Don't emit upcast to the same type in SimplifyAllocRefDynamic, add test, add comment
2024-09-24 08:48:51 -07:00
Kuba Mracek
c7a5569c4f
[embedded] Add support for ManagedBuffer to Embedded Swift
...
This makes ManagedBuffer available and usable in Embedded Swift, by:
- Removing an internal consistency check from ManagedBuffer that relies on metatypes.
- Making the .create() API transparent (to hoist the metatype to the callee).
- Adding a AllocRefDynamicInst simplification to convert `alloc_ref_dynamic` to `alloc_ref`, which removes a metatype use.
- Adding tests for the above.
2024-09-23 13:32:50 -07:00
Konrad `ktoso` Malawski
b9319d80f1
Merge branch 'main' into wip-experimental-isolated-deinit
2024-09-23 09:01:06 +09:00
Meghana Gupta
961e6ea104
Merge pull request #76294 from meg-gupta/rewritenext
...
Rewrite UnsafeRawBufferPointer.Iterator.next
2024-09-20 12:10:39 -07:00
Konrad `ktoso` Malawski
d89347bed0
Merge branch 'main' into wip-experimental-isolated-deinit
2024-09-20 18:34:45 +09:00
Guillaume Lessard
a35dea18c5
[gardening] remove obsolete annotations
2024-09-19 12:56:31 -07:00
Konrad `ktoso` Malawski
7d1ce789ad
Revert "Revert "Isolated synchronous deinit""
2024-09-17 17:35:38 +09:00
Kuba (Brecka) Mracek
142df19324
Merge pull request #76231 from kubamracek/embedded-deinit-release
...
[embedded] Handle retain/retain ops inside deinit in Embedded Swift's swift_release
2024-09-16 16:13:08 -07:00
Stephen Canon
a4c20e043b
Add borrowing _withUnprotectedUnsafePointer ( #76446 )
...
* Add non-inout `_withUnprotectedUnsafePointer`
For withUnsafePointer we have both an inout and a borrowing form, allowing it to be used with immutable values. Add a parallel form for the unprotected variant.
* Update LifetimeManager.swift
2024-09-16 14:11:34 -04:00
Kuba Mracek
b4431db2c5
[embedded] Add a more detailed explaining comment to swift_release_n_
2024-09-16 10:37:40 -07:00
Jonathan Grynspan
db7a030a71
Extend internal _mangledTypeName() function to take non-copyable types. ( #76041 )
...
`_mangledTypeName()` returns the Swift-mangled typename of a given type. This PR extends it to take non-copyable types as well.
Related to our use case in Swift Testing, but not to the PR directly: #69146 #69147 #71112
Resolves rdar://134278607.
2024-09-11 16:11:58 -04:00
Mike Ash
3937ceecc7
[Stdlib] Mark CVaListPointer as @unsafe.
...
rdar://135604375
2024-09-10 14:49:38 -04:00
Meghana Gupta
2f37e10674
Rewrite UnsafeRawBufferPointer.Iterator.next to avoid non natural loop in SIL
...
The current implementation creates a non-natural loop and none of the SIL and
LLVM loop passes will work for such loops. We have to find a way to fix this in
SIL. Until then, rewrite so we get a natural loop in SIL.
2024-09-05 15:35:39 -07:00
Alex Hoppen
c5aa49ba64
Revert "Isolated synchronous deinit"
2024-09-03 18:11:26 -07:00
Kuba Mracek
249f7e6073
[embedded] Handle retain/retain ops inside deinit in Embedded Swift's swift_release
2024-09-03 14:38:03 -07:00
Konrad `ktoso` Malawski
c86e4a8738
Merge pull request #60057 from nickolas-pohilets/mpokhylets/isolated-deinit
...
Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com >
2024-09-04 01:16:56 +09:00
Alejandro Alonso
027a95a1b5
Merge pull request #76097 from jeongHunE/main
...
[stdlib] Fix the indentation from 1 space to 2 spaces in ArraySlice.s…
2024-09-02 21:22:55 -07:00
Konrad `ktoso` Malawski
c55ad6fa88
Merge branch 'main' into mpokhylets/isolated-deinit
2024-09-02 23:16:17 +09:00
Allan Shortlidge
5c30b30947
Merge pull request #76177 from tshortli/availability-visionos
...
build-script: Copy `libclang_rt.a` from the host toolchain for visionOS
2024-08-31 10:00:13 -07:00
Allan Shortlidge
48f236d09a
build-script: Copy libclang_rt.a from the host toolchain for visionOS.
...
During the toolchain build, when building the Swift standard library for
platforms other than macOS the `libclang_rt.a` needs to be copied out of the
host SDK. That wasn't happening for visionOS.
Resolves rdar://135023111.
2024-08-30 18:15:13 -07:00
Alejandro Alonso
10314365e4
Merge pull request #76144 from Benedicto-H/fix-Dictionary-doc
...
[stdlib] Fix typos in Dictionary.swift
2024-08-29 21:48:03 -07:00