Commit Graph

22101 Commits

Author SHA1 Message Date
Egor Zhdan
ab275373fe Merge pull request #85979 from egorzhdan/egorzhdan/android-ptrauth
[cxx-interop] Handle missing `<ptrauth.h>`
2025-12-12 10:04:02 +00:00
Michael Gottesman
e186e5e5d0 Merge pull request #85972 from gottesmm/pr-9663abc1697da1382a8514e6877a6c3ce3f439b9
[concurrency] Hide Concurrency StackNesting builtins behind a feature flag
2025-12-11 21:16:37 -08:00
Karoy Lorentey
a233485029 Merge pull request #82055 from vanvoorden/string-identical
[SE-0494][StdLib] Add `isTriviallyIdentical(to:)` Methods to String and Substring
2025-12-11 15:55:11 -08:00
Ben Cohen
9dd9e96e1d Allow Hashable: ~Copyable (#85748)
Builds on #85746 which covers Equatable.
2025-12-11 14:47:36 -08:00
Egor Zhdan
063b906966 [cxx-interop] Handle missing <ptrauth.h>
Android NDK, as of version 28, does not include the `ptrauth.h` header. This causes CI failures when building the Swift SDK for Android on Windows.

rdar://166242941
2025-12-11 11:39:20 +00:00
Hiroshi Yamauchi
5634d99c4f Add several headers to WinSDK (#85915)
This was needed for explicit module builds to work for internal apps.
2025-12-10 19:31:27 -08:00
Michael Gottesman
7b9281fcb8 [concurrency] Hide Concurrency StackNesting builtins behind a feature flag.
rdar://166244033
2025-12-10 16:02:18 -08:00
Tim Kientzle
efdd00892c Merge pull request #85797 from tbkka/tbkka-float-parsing
Reimplement Floating-Point Parsing in pure Swift
2025-12-10 18:42:41 +00:00
Egor Zhdan
ad56e061af Merge pull request #85066 from egorzhdan/egorzhdan/std-function-context
[cxx-interop] Allow initializing `std::function` from Swift capturing closures
2025-12-10 13:35:34 +00:00
Kyle Robson
f8f107f857 <rdar://165142180> fix immediate Task docs (#85626)
Co-authored-by: Kyle Robson <kyledr@apple.com>
2025-12-10 09:51:19 +09:00
Augusto Noronha
47eda910c1 Merge pull request #85916 from augusto2112/speedup-protocols-main
[NFC][RemoteInspection] Use existing cache to build conformance table
2025-12-09 13:06:41 -08:00
Eric Miotto
3bbd7da6e7 Merge pull request #85872 from edymtt/edymtt/android-build-builtin-float-before-math
CMake Android: ensure _Builtin_float is built before _math
2025-12-09 09:17:22 -08:00
Tim Kientzle
2e56ce0b98 Minor perf tweak 2025-12-09 09:30:38 +00:00
Ben Rimmington
b27c90b8b8 [SE-0494] isTriviallyIdentical(to:) [memory regions] (#84998)
Add `isTriviallyIdentical(to:)` methods to:

* `Span`
* `RawSpan`
* `UTF8Span`
* `UnsafeBufferPointer`
* `UnsafeMutableBufferPointer`
* `UnsafeRawBufferPointer`
* `UnsafeMutableRawBufferPointer`

Part of issue swiftlang/swift#84991.
2025-12-08 19:32:26 -08:00
Karoy Lorentey
e5787c661d [stdlib] String, Substring: Use new _StringGuts helper 2025-12-08 17:32:20 -08:00
Karoy Lorentey
4cde919950 [stdlib] Update availability of String view additions 2025-12-08 17:32:20 -08:00
WindowsMEMZ
288a69842d Add isIdentical to StringGuts and use it for comparation 2025-12-08 17:32:19 -08:00
WindowsMEMZ
14e37a15ec Make isIdentical opaque for clients 2025-12-08 17:32:19 -08:00
WindowsMEMZ
be5ec1aed4 Add isTriviallyIdentical for unicode views 2025-12-08 17:32:19 -08:00
Karoy Lorentey
c8202c6f9a Apply suggestions from code review 2025-12-08 17:32:19 -08:00
Karoy Lorentey
b7e32db453 [stdlib] Update availability of isTriviallyIdentical methods 2025-12-08 17:32:19 -08:00
Karoy Lorentey
794bbb99b4 [stdlib] Define availability for the 6.4 stdlib and runtime 2025-12-08 17:32:19 -08:00
Rick van Voorden
abae2f6547 [stdlib] string identical
Co-Authored-By: Karoy Lorentey <klorentey@apple.com>
2025-12-08 17:32:19 -08:00
Augusto Noronha
52c8b7975a [NFC][RemoteInspection] Use existing cache to build conformance table
There is an existing cache which is built when looking up
FieldDescriptors. collectAllConformances ignored this cache and would
parse every FieldDescriptor again. Use the existing cache mechanism.

rdar://166098516
2025-12-08 16:34:45 -08:00
Ben Cohen
58f661cfba Allow Equatable: ~Escapable (#85854)
Adds `~Escapable` to #85746
2025-12-08 09:50:50 -08:00
Tim Kientzle
8393f0639c Minor perf tweak 2025-12-08 08:02:49 +00:00
Tim Kientzle
fa0aa7506b Avoid un unnecessary bounds check 2025-12-08 07:39:09 +00:00
Tim Kientzle
73fee7fb26 Update comments 2025-12-07 13:21:28 +00:00
Tim Kientzle
2c9227e4c8 Update comments 2025-12-07 13:20:49 +00:00
Tim Kientzle
16920b200b Revert "Express the core parser functions as initializers"
After further thought, I realize that it makes more sense
to keep the public API in FloatingPointParsing.swift.gyb
(where we can consolidate the repetitive doc comments)
and have this as a purely internal set of service functions.

This reverts commit 7084ab8e6e.
2025-12-07 10:21:44 +00:00
AZero13
9fb56b8f8a Remove autorelease workaround for x86_64 (#85877)
LLVM no longer tail-calls this on x86_64, so we do not need an autorelease pool. Remove it for i386 as well as that is no longer a target for ObjC interop builds.
2025-12-06 11:28:03 -08:00
Max Desiatov
fb0ec64b2d Merge pull request #85835 from MaxDesiatov/embedded-wasm-mutex 2025-12-06 13:35:39 +00:00
Tim Kientzle
7084ab8e6e Express the core parser functions as initializers 2025-12-06 09:04:14 +00:00
Tim Kientzle
f48aa4a627 Make Float16 support conditional on Swift 5.3 2025-12-06 09:04:14 +00:00
Tim Kientzle
09cad0dbcd Disable this code on 16-bit platforms 2025-12-06 09:04:14 +00:00
Tim Kientzle
7d5fff34fc Fix 16-bit build 2025-12-06 09:04:13 +00:00
Tim Kientzle
c5ab343358 Fix the backwards-compatibility stubs 2025-12-06 09:04:13 +00:00
Tim Kientzle
c8f12e69e2 Fix up some comments 2025-12-06 09:04:13 +00:00
Tim Kientzle
93eb82c9a3 [Embedded] Reimplement Float16/32/64 parsing in Swift
This reimplements the underlying support for `Float16(_:StringSlice)`,
`Float32(_:StringSlice)`, and `Float64(_:StringSlice)` in pure Swift,
using the same core algorithm currently used by Apple's libc.  Those
`StringSlice` initializers are in turn used by `Float16(_:String)`,
`Float32(_:String)`, and `Float64(_:String)`.

**Supports Embedded**: This fully supports Embedded Swift and
insulates us from variations in libc implementations.

**Corrects bugs in Float16 parsing**: The previous version of
`Float16` parsing called libc `strtof()` to parse to a 32-bit float,
then rounded to `Float16`. (This was necessary because float16
parsing functions are not widely supported in C implementations.)
This double-rounding systematically corrupted NaN payloads and
resulted in 1 ULP errors for certain decimal and hexadecimal inputs.
The new version parses `Float16` directly, avoiding these errors.

**Modest perforamnce improvement**:  The old version had to copy
the Swift string to construct a C string.  For inputs longer than
15 characters, this typically required a heap allocation, which added
up to 20% to the runtime.  The new version parses directly from a Swift
string, avoiding this copy and heap allocation.
2025-12-06 09:04:12 +00:00
AZero13
bef81c9ee5 swift_nonatomic_unknownObjectRelease should use swift_nonatomic_release
This appears to be a typo. Thankfully, it is not a correctness issue, as the atomic version does the same thing just slower.
2025-12-05 20:56:06 -05:00
Eric Miotto
817a890a67 CMake Android: ensure _Builtin_float is built before _math
_math would be able to build against either the Swift or the clang
module for _Builtin_float; however the build will fail if the Swift
module is present but does not contain the architectures we need, with errors
like

```
<unknown>:0: error: could not find module
'_Builtin_float' for target 'armv7-unknown-linux-android'; found:
aarch64-unknown-linux-android, x86_64-unknown-linux-android, at:
/home/build-user/build/swift-project/Ninja-Release/swift-linux-x86_64/lib/swift/android/_Builtin_float.swiftmodule/armv7-unknown-linux-android
```

In other words, in this situation we are not falling back to the clang
module.

Addresses rdar://165768601
2025-12-05 12:58:06 -08:00
Ben Cohen
0f99458900 Allow Comparable: ~Copyable (#85747)
Builds on #85746 which covers Equatable
2025-12-05 08:37:36 -08:00
Egor Zhdan
7fc815e383 [cxx-interop] Allow initializing std::function from Swift capturing closures
This introduces support for converting a Swift closure that captures variables from its surrounding context into an instance of `std::function`, which is useful for working with C++ APIs that use callbacks.

Each instantiation of `std::function` gets a synthesized Swift constructor that takes a Swift closure. Unlike the previous implementation, the closure is _not_ marked as `@convention(c)`. The body of the constructor is created lazily.

Under the hood, the closure is bitcast to a pair of a function pointer and a context pointer, which are then wrapped in a C++ object, `__SwiftFunctionWrapper`, that manages the lifetime of the context object via calls to `swift_retain`/`swift_release` from the copy constructor and the destructor. The `__SwiftFunctionWrapper` class is templated, and is instantiated by ClangImporter.

rdar://133777029
2025-12-05 15:41:59 +00:00
Saleem Abdulrasool
a7f996651c Merge pull request #85532 from 0xpablo/patch-1
Platform: add `DirectX.Direct2D` module to WinSDK
2025-12-05 08:16:25 -06:00
Max Desiatov
9147fceabc Synchronization/CMakeLists.txt: build Cell.swift for Embedded Wasm 2025-12-04 17:34:27 +00:00
Evan Wilde
4ad6bea8c2 Merge pull request #85825 from etcwilde/ewilde/concurrency-tracing
Concurrency Runtime: Enable tracing with `SWIFT_STDLIB_TRACING`
2025-12-04 08:17:22 -08:00
Max Desiatov
bfa88573f7 Embedded Synchronization: enable Mutex for Wasm
We have both WASI-libc and pthread available for Wasm, which should be enough for making this type available.
2025-12-04 15:30:58 +00:00
Anthony Latsis
38c4867e8c Merge pull request #85798 from swiftlang/jepa-main4
Address `llvm::StringSwitch` deprecations in advance
2025-12-04 13:19:08 +00:00
Danny Canter
51c1358778 Merge pull request #85726 from dcantah/add-errno-to-linux-lock-failures
Synchronization: Add errno to some linux lock fatalErrors
2025-12-04 03:58:55 -08:00
Doug Gregor
dcebf64e32 Merge pull request #85808 from DougGregor/unicode-data-without-shims
Move Unicode Data declarations from SwiftShims to `@_extern(c)`
2025-12-04 01:50:41 -08:00