Commit Graph

7182 Commits

Author SHA1 Message Date
nate-chandler
a43faf89c8 Merge pull request #71242 from nate-chandler/bitwise-copyable/not-for-unchecked
[BitwiseCopyable] Don't derive on @unchecked field
2024-01-31 05:55:38 -08:00
Nate Chandler
c8119e3c01 [stdlib] FixedWidthInteger is BitwiseCopyable. 2024-01-30 14:38:07 -08:00
Nate Chandler
4c5d1006c4 [stdlib] SIMD extends BitwiseCopyable. 2024-01-30 14:38:07 -08:00
Nate Chandler
4dc9713a7a [stdlib] Uncheck pointers' conf to BitwiseCopyable
The pitch calls for such types to obstruct inference of _BitwiseCopyable
in aggregates containing them.
2024-01-30 14:38:07 -08:00
Kuba (Brecka) Mracek
0655578718 Merge pull request #71226 from kubamracek/embedded-cdecls-runtime
[embedded] Fix calling convention on embedded runtime APIs (switch @_silgen_name for @_cdecl)
2024-01-30 09:24:17 -08:00
Kuba Mracek
6383d05ea1 [embedded] Fix calling convention on embedded runtime APIs (switch @_silgen_name for @_cdecl) 2024-01-29 15:37:46 -08:00
Doug Gregor
da08b96371 Allow the main function for @main types to use typed throws
Allow the use of typed throws for the main functions of `@main` types,
and thread the thrown error through to a new entry point in the library,
`_errorInMainTyped`, which is generic in the thrown error type.

Fixes rdar://121603043.
2024-01-28 11:21:00 -08:00
David Smith
0843891eb9 Switch to malloc_good_size instead of malloc_size (#70532)
Switch to malloc_good_size instead of malloc_size
2024-01-27 19:20:33 -08:00
Guillaume Lessard
6b328f9c07 [gardening] add a missing license header 2024-01-27 13:15:16 -08:00
Guillaume Lessard
384a66aa59 Merge pull request #71186 from apple/jgrynspan/121674502-fix-deprecation-of-validatingUTF8-cchar-array-overload
Fix the deprecation of `String.init(validatingUTF8: [CChar])`.
2024-01-26 17:27:54 -08:00
Max Desiatov
633d5bc45a Enable x86_64 and i686 ELF triples for embedded Swift (#70642)
This is just as useful for x86 bare metal as the already enabled `arm*-none-none-eabi` triples.
2024-01-26 21:39:17 +00:00
Jonathan Grynspan
3da7483c5f Fix the deprecation of String.init(validatingUTF8: [CChar]).
This PR changes the deprecation annotation of `String.init(validatingUTF8: [CChar])` to match that of `String.init(validatingUTF8: UnsafePointer<CChar>)`. Both have been given new, undeprecated, renamed replacements (`validatingCString:`).

Resolves rdar://121674502.
2024-01-26 13:40:27 -05:00
Rick van Voorden
f8ae46b3f3 [inclusive-language] changed sanity to soundness 2024-01-25 18:18:02 -08:00
Serena758
6151d4f23d changed sanity to soundness 2024-01-25 14:22:46 -08:00
Kavon Farvardin
b8cd7effeb Merge pull request #70866 from kavon/ncgenerics-stdlib-building-v4
Build Stdlib with Noncopyable Generics (Part 4)
2024-01-25 07:09:38 -08:00
Kuba (Brecka) Mracek
302e106e2d Merge pull request #70458 from kubamracek/embedded-random
[embedded] Make RNG APIs available on embedded Swift
2024-01-24 13:14:47 -08:00
Kavon Farvardin
25aa49be55 [NCGenerics] Sendable doesn't require Copyable 2024-01-23 22:42:38 -08:00
Kuba Mracek
2c30b0a0e2 [embedded] Resolve ptrauth crashes by signing HeapObjects's isa pointers in embedded Swift 2024-01-22 16:45:07 -08:00
Guillaume Lessard
50b83c8e69 Merge pull request #68423 from glessard/se0405-take2
[se-0405] rename `String.init(validatingUTF8:)`
2024-01-22 09:29:21 -08:00
Guillaume Lessard
d8c809c0ad Merge pull request #68419 from glessard/se0405-part1
[se-0405] Implement API additions
2024-01-22 09:27:27 -08:00
Kuba (Brecka) Mracek
e06bbf79aa Merge pull request #70971 from kubamracek/tt-withunsafeptr
Adopt typed throws in one withUnsafePointer() API
2024-01-19 14:23:27 -08:00
nate-chandler
1da24ece36 Merge pull request #71009 from nate-chandler/bitwise-copyable-gating
[BitwiseCopyable] Remove gating from protocol declaration.
2024-01-19 12:39:31 -08:00
Nate Chandler
c49738eecf [BitwiseCopyable] Remove gating from protocol decl
It's harmless to have the protocol defined in the swiftinterface for
older compilers and removing the gating permits the gating to be omitted
from conformances
2024-01-19 07:25:15 -08:00
Kuba Mracek
43554c4da4 [embedded] Also enable RNG APIs on SIMD types 2024-01-17 14:53:24 -08:00
Kuba Mracek
bd5913a176 [embedded] Make RNG APIs available on embedded Swift 2024-01-17 14:53:24 -08:00
Kuba Mracek
6d2de26691 Adopt typed throws in one withUnsafePointer() API 2024-01-17 14:19:16 -08:00
Alejandro Alonso
72ad6c5c33 Merge pull request #70945 from Azoy/fix-unmanaged-opaque
[stdlib] Avoid materializing strong references in potential dangling unmanaged opaque functions
2024-01-17 09:30:50 -08:00
Kuba (Brecka) Mracek
cf440011cb Merge pull request #70947 from kubamracek/embedded-unicode-scalar
[embedded] Add Unicode.Scalar to embedded stdlib
2024-01-17 09:30:08 -08:00
Alejandro Alonso
f0a74ecb0d Apply suggestions from code review
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>

fix test
2024-01-16 17:14:18 -08:00
Kuba Mracek
c12d067eac [embedded] Add Unicode.Scalar to embedded stdlib 2024-01-16 16:01:48 -08:00
Alejandro Alonso
e6e87881b8 Take doc suggestion from Karoy #2
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2024-01-16 16:00:04 -08:00
Alejandro Alonso
f28ebc9668 Take doc suggestion from Karoy #1
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2024-01-16 15:58:34 -08:00
Alejandro Alonso
c384b1cfc5 Avoid materializing strong references in potential dangling unmanaged opaque functions
Add test and comments
2024-01-16 15:17:49 -08:00
Kuba Mracek
392f2c36eb [embedded] Add Dictionary to embedded stdlib 2024-01-16 13:40:13 -08:00
Kuba (Brecka) Mracek
0b19b58b68 Merge pull request #70685 from kubamracek/embedded-print-stopgap
[embedded] Add a stop-gap print() for embedded Swift
2024-01-16 10:56:01 -08:00
nate-chandler
7dd1d3f7c1 Merge pull request #70872 from nate-chandler/rdar19519745
[BitwiseCopyable] Infer and check constraint.
2024-01-16 07:01:31 -08:00
Nate Chandler
63de79c91e [stdlib] Pointers and SIMDs are bitwise copyable. 2024-01-15 17:08:32 -08:00
Nate Chandler
2133c94add [stdlib] Optional conforms to _BitwiseCopyable. 2024-01-15 17:08:32 -08:00
Guillaume Lessard
e773d9a093 Merge pull request #70911 from stephentyrone/check-alignment-not-stride 2024-01-15 11:56:03 -08:00
Doug Gregor
b5d1ecc55a Merge pull request #70917 from DougGregor/typed-throws-open-existential
Implement typed throws support in `_openExistential`.
2024-01-14 17:23:11 -08:00
Guillaume Lessard
4e36f5616d [stdlib] operator precedence strikes again 2024-01-14 17:13:24 -08:00
Doug Gregor
a30b623ee6 Implement typed throws support in _openExistential. 2024-01-14 14:32:49 -08:00
Doug Gregor
467f684a43 Merge pull request #70913 from DougGregor/typed-throws-without-actually-escaping
[SE-0413] Adopt typed throws in `withoutActuallyEscaping(_:do:)`
2024-01-14 00:47:36 -08:00
Doug Gregor
8912d4aa71 [SE-0413] Adopt typed throws in withoutActuallyEscaping(_:do:)
There is a small bug fix here in the identification of the catch node,
where the leading `{` of a closure was considered to be "inside" the
closure for code like

    { ... }()

causing us to assume that the call to the closure would catch the error
within the closure.

Other than that, introduce the thrown error type into the type checker's
modeling of `withoutActuallyEscaping(_:do:)`, and mirror that in the
library declaration.
2024-01-13 21:57:24 -08:00
Stephen Canon
c7d50087b0 Check the base address against the element alignment rather than stride
Stride is the gap between elements, not the alignment that each element must satisfy (stride need not even be a power of two).
2024-01-13 16:59:51 -05:00
Doug Gregor
0e6a913f98 Merge pull request #70907 from DougGregor/se-0413-result-typed-throws
[SE-0413] Adopt typed throws in Result
2024-01-13 13:21:05 -08:00
Kuba Mracek
43a9a80e60 [embedded] Hardcode radix=10 in embedded print() 2024-01-13 21:35:37 +01:00
Kuba Mracek
a565d1ab85 [embedded] Make embedded print() not depend on untyped throwing and allocations 2024-01-13 21:35:37 +01:00
Kuba Mracek
8dd56d495f [embedded] Use the correct standard putchar signature: func putchar(_: CInt) -> CInt 2024-01-13 21:35:37 +01:00
Kuba Mracek
75f0e3c66a [embedded] Add a stop-gap print() for embedded Swift 2024-01-13 21:35:36 +01:00