Commit Graph

21492 Commits

Author SHA1 Message Date
Alastair Houghton
82076d600d [Backtracing] Fix runtime symbols.
The runtime functions must be marked `extern "C"` because the symbols
are not mangled when exported.

rdar://137201928
2025-01-14 16:48:04 +00:00
Alastair Houghton
f0974bd227 [Backtracing] Turn off MemberImportVisibility.
Also fixed a couple of other minor issues preventing this PR from
building on its own.

rdar://137201928
2025-01-14 12:13:58 +00:00
Saleem Abdulrasool
66921730ee Merge pull request #78251 from andrurogerz/swift-runtime-debugvars-android
[Runtime] load debug env vars from Android system properties
2025-01-13 13:14:04 -08:00
Evan Wilde
6f823dcebf Fix Slab availability annotation
Values in generic types are only available as part of 6.2, not 6.1.
Fix the availability annotations on the slab type to match.

rdar://142781302
2025-01-13 12:42:20 -08:00
Henrik G. Olsson
d7bd76e9f1 [Swiftify] Add return pointer support (#78571)
* Import __counted_by for function return values

Instead of simply passing a parameter index to _SwiftifyInfo, the
_SwiftifyExpr enum is introduced. It currently has two cases:
 - .param(index: Int), corresponding to the previous parameter index
 - .return, corresponding to the function's return value.

ClangImporter is also updated to pass this new information along to
_SwiftifyImport, allowing overloads with buffer pointer return types to
be generated. The swiftified return values currently return Span when
the return value is marked as nonescaping, despite this not being sound.
This is a bug that will be fixed in the next commit, as the issue is
greater than just for return values.

* Fix Span variant selection

There was an assumption that all converted pointers were either
converted to Span-family pointers, or UnsafeBufferPointer-family
pointers. This was not consistently handled, resulting in violating the
`assert(nonescaping)` assert when the two were mixed. This patch removes
the Variant struct, and instead each swiftified pointer separately
tracks whether it should map to Span or UnsafeBufferPointer.
This also fixes return pointers being incorrectly mapped to Span when
marked as nonescaping.
2025-01-13 08:08:36 -08:00
Alejandro Alonso
09d122af7c Merge pull request #76438 from Azoy/vector
[stdlib] Slab
2025-01-12 10:36:25 -08:00
John McCall
11ff5b4348 Merge pull request #78576 from rjmccall/demangle-sending-result-with-function-isolation
Fix the demangling of sending result types when combined with isolation
2025-01-11 12:35:55 -05:00
John McCall
fa932e736c Fix the demangling of sending result types when combined with isolation
Fixes the immediate problem, but the presence of demangling code in the
runtime means that we'll need a follow-up to fix the compiler so that it
doesn't try to use the demangler to materialize metadata for function types
that have both isolation and a sending result.

rdar://142443925
2025-01-10 21:11:45 -05:00
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