Commit Graph

21434 Commits

Author SHA1 Message Date
Karoy Lorentey
2a1f15587e [stdlib] Use hasFeature(Foo) instead of opaque $Foo syntax 2024-03-18 11:03:49 -07:00
Karoy Lorentey
776ec74dcf [stdlib] {consuming,borrowing}{Flat,}Map: adopt typed throws 2024-03-18 11:03:49 -07:00
Karoy Lorentey
71519aaf98 [stdlib] Apply minor review notes 2024-03-18 11:03:49 -07:00
Karoy Lorentey
febfd34aac [stdlib] Make MemoryLayout techically copyable
It’s a caseless enum, but there’s no reason to change this aspect of it.
2024-03-18 11:03:49 -07:00
Karoy Lorentey
2d23ab3226 [stdlib] withUnsafePointer: Spell out Error conformance on E 2024-03-18 11:03:49 -07:00
Karoy Lorentey
d70f197c24 [stdlib] Update SwiftStdlibLegacyABI convention to use @available(swift, obsoleted: 1)
Using version `2` here is just weird for no reason.
2024-03-18 11:03:49 -07:00
Karoy Lorentey
ce62475cd9 [stdlib] ManagedBuffer: Support for noncopyable Element
Header is tricky, but it’s on the TODO list for later.
2024-03-18 11:03:49 -07:00
Karoy Lorentey
d7c402f2f2 [stdlib] Add partial ~Copyable support to withUnsafeTemporaryAllocation facility
Generalizing the result type is not yet possible, but T works!
2024-03-18 11:03:49 -07:00
Karoy Lorentey
b83282b689 [stdlib] Temporarily disable round trip validation for debug types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
3507a0cf8c [stdlib] Add support for noncopyables to withUnsafePointer(to:) family 2024-03-18 11:03:49 -07:00
Karoy Lorentey
285c3d3744 [stdlib] Add support for noncopyables to withExtendedLifetime(of:) family 2024-03-18 11:03:49 -07:00
Karoy Lorentey
72fa98c4b6 [stdlib] Result: Initial support for noncopyable payloads 2024-03-18 11:03:49 -07:00
Karoy Lorentey
3cb9b3383e [stdlib] Add support for noncopyables to swap(_:_:) 2024-03-18 11:03:49 -07:00
Karoy Lorentey
5ae757181e [stdlib] UnsafeRawBufferPointer: new interactions with noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
d15d5004c8 [stdlib] Unsafe[Mutable]BufferPointer: Add support for non-copyable Pointee types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
78270e1e4e [stdlib] UnsafePointer: Resolve most of the symbol mismatches 2024-03-18 11:03:49 -07:00
Karoy Lorentey
5ceb055e29 [stdlib] UnsafePointer: Don’t let the compiler synthesize hashValue 2024-03-18 11:03:49 -07:00
Karoy Lorentey
5d90d81dac [stdlib] Optional: Add @_preInverseGenerics to ExpressibleByNilLiteral conformance 2024-03-18 11:03:49 -07:00
Karoy Lorentey
deda7d6865 [stdlib] UnsafePointer: Add @_preInverseGenerics to _Pointer conformance 2024-03-18 11:03:49 -07:00
Karoy Lorentey
209c66cf74 [stdlib] UnsafePointer: Add @_preInverseGenerics to stored properties 2024-03-18 11:03:49 -07:00
Karoy Lorentey
0a676db16f [stdlib] Generalize swap(_:_:) for noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
805f94b5a8 [stdlib] OpaquePointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
d6296ab966 [stdlib] UnsafeRawPointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
baa317c29a [stdlib] Optional: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
56ddafb0a0 [stdlib] UnsafePointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
bfd2b068c1 [stdlib] MemoryLayout: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
7d87ad5a8a [stdlib] OpaquePointer: new interactions with noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
0568dbf903 [stdlib] UnsafeRawPointer: new interactions with noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
85a6b97e7a [stdlib] Optional: Initial support for noncopyable payloads
- Enable BorrowingSwitch feature within the stdlib
- ExpressibleByNilLiteral: Add retroactive support for noncopyable conforming types
- Optional: draft an API surface for noncopyable payloads

[stdlib] Oops, the ExpressibleByNilLiteral conformance kept its implicit copyability
2024-03-18 11:03:49 -07:00
Karoy Lorentey
d0b39ac8db [stdlib] Unsafe[Mutable]Pointer: Add support for non-copyable Pointee types
[stdlib] Pull back @_aeic on pointer → integer conversions

[stdlib] UnsafeMutablePointer.allocate: Fix thinko

[stdlib] Disable support for noncopyable pointees on some pointer operations

We have to temporarily pull back support for noncopyable pointees for UnsafeMutablePointer.initialize(to:), .moveInitialize, .moveUpdate, as the builtins they’re calling are no longer accepting such types.

These will return following a builtin audit.

[stdlib] Remove workarounds for certain builtins not supporting noncopyable use

https://github.com/apple/swift/pull/71733 fixed this!

[stdlib] Update FIXME

[stdlib] UnsafePointer: Update Swift version numbers

[stdlib] UnsafePointer: Actually hide legacy ABI

[stdlib] Remove workaround for U[M]BP.withMemoryRebound
2024-03-18 11:03:49 -07:00
Karoy Lorentey
7fc54cab80 [stdlib] MemoryLayout: Add support for non-copyable type arguments
[stdlib] MemoryLayout: Update Swift version numbers

[stdlib] MemoryLayout: Actually hide legacy ABI
2024-03-18 11:03:48 -07:00
Kavon Farvardin
76c6510519 Merge pull request #72276 from kavon/ncgenerics-xfails-3 2024-03-16 04:18:35 -07:00
John McCall
8d8b91dfb2 Merge pull request #72325 from rjmccall/isolated-any-task-creation
Use `@isolated(any)` function types in task creation
2024-03-16 02:02:23 -04:00
Guillaume Lessard
d00866aa3c Merge pull request #72365 from glessard/rethrowing-disappearing-act
[stdlib] preserve untyped-throws versions of functions
2024-03-15 19:36:19 -07:00
Guillaume Lessard
8459d0616d [stdlib] make swiftinterfaces compatible with older toolchains 2024-03-15 16:50:12 -07:00
John McCall
a86b76a3e9 Use @isolated(any) function types for task functions.
The biggest annoyance here is having to clone all of the task creation
functions for Embedded Swift because it can't use `any Actor` right now.
2024-03-15 14:40:54 -04:00
Saleem Abdulrasool
4c5558d482 Merge pull request #72339 from compnerd/nullability
shims: adjust declaration for android NDK
2024-03-15 10:30:20 -07:00
eeckstein
9504de5ed7 Merge pull request #71552 from finagolfin/cross-compile
[CMake] Add broader support for cross-compiling the portions of the compiler that are written in Swift to non-Darwin Unix
2024-03-15 16:28:38 +01:00
Kavon Farvardin
149c052ec5 use new noncopyable types infrastructure
The infrastructure underpinning the new feature NoncopyableGenerics is
mature enough to be used.
2024-03-14 23:10:44 -07:00
Allan Shortlidge
c27d1b806c Merge pull request #72333 from tshortli/string-processing-resilient-libraries-flag
CMake: Pass -DRESILIENT_LIBRARIES when building _StringProcessing
2024-03-14 22:22:22 -07:00
John McCall
b0cee67d04 Properly save and restore the current task in the runtime so that tasks
can be reentrantly executed.

I don't think doing this is *actually a good idea*, but corrupting the
runtime is an even worse idea, and the overhead here is very low.
2024-03-15 00:40:54 -04:00
Doug Gregor
735e28b551 Merge pull request #72336 from DougGregor/demangle-inverse-requirements-to-ast
Demangle inverse requirements when building AST types
2024-03-14 17:30:49 -07:00
David Smith
dc405525f9 Optimize checking for all-ASCII bytes (#72312) 2024-03-14 16:13:34 -07:00
Saleem Abdulrasool
ac4123b7b9 shims: adjust declaration for android NDK
Mark the nullability to repair the build against NDK r26b.
2024-03-14 15:47:00 -07:00
Doug Gregor
a2ae2149e8 Demangle inverse requirements when building AST types
Extend TypeDecoder with support for inverse requirements, passing them
along to the type builder. Then implement support for inverse
requirements within the AST demangler, which addresses the round-trip
demangling failures we've been seeing.

The runtime and remote inspection facilities still need metadata to
deal with inverse requirements.

Fixes rdar://124564447.
2024-03-14 14:01:53 -07:00
Allan Shortlidge
4d44bf3758 CMake: Pass -DRESILIENT_LIBRARIES when building _StringProcessing.
See https://github.com/apple/swift-experimental-string-processing/pull/731.
2024-03-14 10:07:21 -07:00
Ben Barham
cbcfc85777 Merge pull request #72323 from bnbarham/rename-startswith
Rename startswith to starts_with
2024-03-14 09:06:54 -07:00
Kuba (Brecka) Mracek
b9818c6015 Merge pull request #72322 from kubamracek/embedded-fix-arch-name
[embedded] Fix a typo in the module name for armv6m-none-none-eabi
2024-03-14 03:47:41 -07:00
Allan Shortlidge
3836662126 Merge pull request #72315 from tshortli/revert-regex-parser-resilience
Revert "[Regex] Really build _RegexParser without resilience."
2024-03-14 00:10:43 -07:00
Ben Barham
9779c18da3 Rename startswith to starts_with
LLVM is presumably moving towards `std::string_view` -
`StringRef::startswith` is deprecated on tip. `SmallString::startswith`
was just renamed there (maybe with some small deprecation inbetween, but
if so, we've missed it).

The `SmallString::startswith` references were moved to
`.str().starts_with()`, rather than adding the `starts_with` on
`stable/20230725` as we only had a few of them. Open to switching that
over if anyone feels strongly though.
2024-03-13 22:25:47 -07:00