Commit Graph

21434 Commits

Author SHA1 Message Date
Guillaume Lessard
18dd091fb8 Merge pull request #78538 from lorentey/define-availability-for-6.2
Define placeholder availability for Swift 6.2
2025-01-10 18:09:39 -08:00
Alejandro Alonso
4c5a13a63e Moar test fixes 2025-01-10 17:52:50 -08:00
Saleem Abdulrasool
34b684203e Merge pull request #78548 from compnerd/spelling
runtime: use the preferred spelling on Windows (NFCI)
2025-01-10 16:15:28 -08:00
Guillaume Lessard
46aa3fba1a Merge pull request #78546 from glessard/array-lazy-eager-bridge-loadfix
[stdlib] loading a reference can’t use `loadUnaligned`
2025-01-10 13:10:26 -08:00
Guillaume Lessard
12675dddeb Merge pull request #78540 from glessard/string-gardening 2025-01-10 10:24:34 -08:00
Saleem Abdulrasool
627e79556e runtime: use the preferred spelling on Windows (NFCI)
This changes the windows path to use the preferred `_strdup` over
`strdup` to avoid the deprecation warning.
2025-01-10 09:31:09 -08:00
Guillaume Lessard
9743ec9fd6 [stdlib] loading a reference can’t use loadUnaligned 2025-01-10 09:10:32 -08:00
Alastair Houghton
9329776a5d [Backtracing] Use C++ interop to fix elf.h issue on Linux.
We have some problems on Linux where Glibc pulls in `<elf.h>` and then
we end up with conflicting definitions.  Fix by using C++ interop and
putting our definitions into a namespace.

rdar://137201928
2025-01-10 13:49:14 +00:00
Guillaume Lessard
d4ae6b0ce8 [gardening] move String.withCString to String.swift
- it has been at an unexpected location for unremembered reasons.
2025-01-09 22:16:58 -08:00
Karoy Lorentey
872bc6eee6 [stdlib] Define _StdlibVersion.v6_2_0 and set it as the current version 2025-01-09 18:17:46 -08:00
Alejandro Alonso
cedea94b4c Test fixes and review feedback 2025-01-09 15:54:54 -08:00
Saleem Abdulrasool
cf4d825bde Merge pull request #78476 from compnerd/exportation
stdlib,Runtimes: begin preparing for a static stdlib on Windows
2025-01-09 11:22:38 -08:00
Alejandro Alonso
f76d841540 Rename to Slab 2025-01-09 10:39:45 -08:00
Meghana Gupta
8397fc364c Merge pull request #78460 from meg-gupta/removeossa
Fix build option for Synchronization and Distributed
2025-01-08 15:20:07 -08:00
Saleem Abdulrasool
358be09832 stdlib,Runtimes: begin preparing for a static stdlib on Windows
When building the standard library statically on Windows, we should not
use any __declspec(dllimport) or __declspec(dllexport) on the runtime
functions or data. Furthermore, we should internalise all of the
standard library functions so that they are not re-exported if used to
build a shared library. The code generation changes required for this
are easier to identify once a static SDK is available for Windows.
2025-01-08 15:08:14 -08:00
Alejandro Alonso
c62e851e38 Implement RemoteInspection support for Builtin.FixedArray 2025-01-08 10:37:17 -08:00
Alejandro Alonso
2823d3018f Some Vector API changes 2025-01-08 10:37:16 -08:00
Alejandro Alonso
f867d0bb05 Implement Vector 2025-01-08 10:33:13 -08:00
David Smith
26b2f7bb47 Re-land using associated objects to attach bridged Array buffers (#78452) 2025-01-07 19:38:21 -08:00
Meghana Gupta
a9b998bbce Fix cmake function parameter name while querying for IMPORTS_NON_OSSA option 2025-01-07 01:21:43 -08:00
Alex Martini
57657c6d3e Clarify what "schoolbook" rounding means (#77903) 2025-01-06 16:27:47 -08:00
Nate Cook
6c29d2f64a Fix the doc formatting for FloatingPoint comparison methods (#78443)
In the documentation for the `isLess(than:)` and `isLessThanOrEqualTo(_:)`
methods, a code sample isn't being formatted correctly due to it directly
following an unordered list. This change adds an additional message that
introduces the code sample, separating it from the list and allowing
the correct formatting to be applied.
2025-01-06 15:13:42 -08:00
Gábor Horváth
6e84b8f507 Merge pull request #78352 from swiftlang/gaborh/cxx-span-overload 2025-01-03 15:32:39 +01:00
Doug Gregor
7d6e3776ba Merge pull request #78332 from DougGregor/strict-safety-improvements
Strict safety improvements
2025-01-02 08:25:02 -08:00
Egor Zhdan
52a2638b3f Merge pull request #78353 from swiftlang/egorzhdan/nfc-fix-cxx-warning
[cxx-interop] NFC: Fix a warning
2025-01-02 12:15:39 +00:00
Egor Zhdan
67da2026ea [cxx-interop] NFC: Fix a warning
This fixes a build warning:
```
swift/stdlib/public/Cxx/CxxDictionary.swift:168:9: warning: variable 'iter' was never mutated; consider changing to 'let' constant
```
2024-12-23 16:26:36 +00:00
Gabor Horvath
b0bb995209 [cxx-interop] Estend _SwiftifyImport with basic std::span support
This is a preliminary PR to transform nonescaping std::span parameters
to Swift's Span type in safe wrappers. To hook this up with
ClangImporter, we will need generalize the noescape attribute to
non-pointer types (PR is already in review). To transform potentially
escaping spans and spans in the return position, a follow-up PR will
add lifetime annotation support. This is a building block towards
rdar://139074571.
2024-12-23 14:08:10 +00:00
Doug Gregor
3ab5456eae Mark SerialExecutor.asUnownedSerialExecutor unsafe so conformances don't need to be @unsafe
What we should actually do with SerialExecutor conformances is not yet clear, though.
2024-12-20 23:16:26 -08:00
Doug Gregor
47f21592d6 Remove WarnUnsafe from the standard library build until we're ready to deal with the warnings 2024-12-20 23:15:42 -08:00
Doug Gregor
55b186c904 Diagnose uses of @unchecked Sendable conformances, not declarations
Under strict concurrency and memory safety, uses of `@unchecked
Sendable` conformances are considered unsafe. Diagnose the use sites,
not the declaration site.
2024-12-20 23:15:40 -08:00
Doug Gregor
9e09513514 Mark UnownedSerialExecutor as @unsafe 2024-12-20 07:35:35 -08:00
Henrik G. Olsson
ef9d2b744d Rename pointer bounds (#78210)
* Make pointer bounds non-experimental

* Rename @PointerBounds to @_SwiftifyImport

* Rename filenames containing PointerBounds

* Add _PointerParam exception to stdlib ABI test

* Add _PointerParam to stdlib API changes

* Rename _PointerParam to _SwiftifyInfo
2024-12-20 11:36:01 +01:00
Kuba (Brecka) Mracek
e0ccd1b4ec Merge pull request #78263 from kubamracek/embedded-stdlib-all-available
[embedded] Make stdlib APIs automatically available on older Darwin versions in Embedded Swift
2024-12-19 20:33:34 -08:00
Andrew Trick
c347b66997 Merge pull request #78283 from atrick/remove-trivial-feature
Remove the experimental LifetimeDependenceDiagnoseTrivial feature.
2024-12-19 08:54:32 -08:00
Andrew Trick
60845673b0 Fix Span initialization from CxxSpan.
CxxSpan is trivial, but not immortal.

This initializer is diagnosed with an error after enabling trivial dependence
enforcement. Correct this with an _overrideLifetime call. This could be avoided
if we had a another way to tell the compiler that CxxSpan.__dataUnsafe()
produced a pointer with the same effective lifetime as the CxxSpan.
2024-12-18 16:58:49 -08:00
Egor Zhdan
d2801ecee9 Merge pull request #78242 from swiftlang/egorzhdan/simulator-deployment-target
[build] Respect `DEPLOYMENT_VERSION_{IOS|TVOS|WATCHOS}` for Simulator targets
2024-12-18 18:28:55 +00:00
Andrew Rogers
63dd1997c0 Add comment explaining debug. propname prefix 2024-12-18 10:07:23 -08:00
Andrew Rogers
b2fb2f465c PR feedback: rename propValueString to buffer 2024-12-18 10:02:56 -08:00
Egor Zhdan
0fa65bea8a Merge pull request #77864 from CrazyFanFan/feature_cxxmap
[cxx-interop]: Enhance CxxDictionary with Merging, Initializer, and Unsafe Erasure
2024-12-18 13:37:44 +00:00
finagolfin
2a8ad3a010 Merge pull request #78241 from finagolfin/ndk
[android] Detect the NDK version by reading source.properties, not by checking the NDK name
2024-12-18 11:49:38 +05:30
Kuba Mracek
24469238d8 [embedded] Make stdlib APIs automatically available on older Darwin versions in Embedded Swift 2024-12-17 19:40:57 -08:00
Andrew Rogers
feea6aaefe PR feedback 2024-12-17 11:54:02 -08:00
Andrew Rogers
0192aa4728 [android] also load debug env vars from system properties 2024-12-17 10:24:57 -08:00
Hamish Knight
f1e4fb27de Revert "Add an overload of append(contentsOf:) on Array that takes a Collecti…"
This reverts commit b71f768128.
2024-12-17 16:23:16 +00:00
Egor Zhdan
d1a435c42a [build] Respect DEPLOYMENT_VERSION_{IOS|TVOS|WATCHOS} for Simulator targets
This makes sure that Cxx and CxxStdlib modules are built with consistent deployment targets for iOS Simulator and iOS Device.

rdar://141232269
2024-12-17 15:51:18 +00:00
Finagolfin
632e7a7ea1 [android] Detect the NDK version by reading source.properties, not by checking the NDK name 2024-12-17 20:27:11 +05:30
Egor Zhdan
f2ad9f3d90 Merge pull request #78223 from swiftlang/egorzhdan/frt-as-existential-crash
[cxx-interop] Fix runtime crash when casting from an existential to a foreign reference type
2024-12-17 12:59:34 +00:00
Saleem Abdulrasool
b64c0198c9 Merge pull request #78208 from swiftlang/eng/android-ptrauth-build
[stdlib] fix android build
2024-12-16 13:17:47 -08:00
Philippe Hausler
8462f5c90b [Observation] Optimize the storage of registrar entries, provide KeyPath caching, and uniqueness notification (#78151) 2024-12-16 13:13:19 -08:00
Egor Zhdan
84ae5fbe8c [cxx-interop] Fix runtime crash when casting from an existential to a foreign reference type
When a C++ foreign reference type is conformed to a Swift protocol via a Swift extension, trying to cast `any MyProtocol` to the foreign reference type crashes the runtime.

This was because `selectCasterForDest` wasn't handling C++ foreign reference types, and we were hitting `swift_unreachable`.

This change makes sure the runtime doesn't crash for such casts.

Notably, Swift doesn't have enough metadata to determine if the conditional cast actually succeeded. This is also a problem for CF types. Casting CF types in a similar fashion triggers a typechecker diagnostic. That diagnostic will be amended in a follow-up patch to also trigger for foreign reference types.

rdar://141227849
2024-12-16 20:23:17 +00:00