Commit Graph

21665 Commits

Author SHA1 Message Date
Guillaume Lessard
c7af9a701b Merge pull request #79294 from Azoy/bye-bye-slab
[stdlib] Rename Slab to InlineArray
2025-02-12 12:03:25 -08:00
Hamish Knight
d260bd8ddb [build-script] Remove Xcode generation support
This was quite brittle and has now been superseded
by swift-xcodegen. Remove the CMake/build-script
logic for it, leaving the option behind to inform
users to switch to using xcodegen instead.
2025-02-12 12:19:21 +00:00
Erik Eckstein
6407f9a0bd remove the allocVector builtin
It's not needed anymore, because the "FixedArray" experimental feature is replaced by inline-arrays.
2025-02-12 10:51:14 +01:00
Mike Ash
e4e2b23a71 [Compatibility50] Silence warning about taking the address of objc_setHook_getClass.
Add a & so the compiler doesn't think it always evaluates to true.

rdar://144465537
2025-02-11 17:11:12 -05:00
Guillaume Lessard
6b90664f54 [concurrency] fix availabilities some more
Extensions cannot be more available than their type for swiftinterface files.
2025-02-11 13:14:49 -08:00
Alejandro Alonso
e4fb1f6761 Rename Slab to InlineArray 2025-02-11 10:26:44 -08:00
Rashmi Mudduluru
f60394db46 [SUA][Runtime] Define swift_coroFrameAlloc function that allocates typed memory (#79200)
[SUA][Runtime] Define `swift_coroFrameAlloc` function that allocates typed memory

Define `swift_coroFrameAlloc` that allocates typed memory if SWIFT_STDLIB_HAS_MALLOC_TYPE is defined.
This function will be used by IRGen to emit typed memory allocations for property accessors.

rdar://141235539
2025-02-11 09:57:08 -08:00
Saleem Abdulrasool
a86743e77e Merge pull request #79278 from compnerd/modular 2025-02-11 05:48:29 -08:00
Guillaume Lessard
e10e476fe4 [concurrency] fix availabilities
These two functions are called from a context that has SwiftStdlib 6.2 availability. Theyshould have that same availability.
2025-02-10 19:14:25 -08:00
Konrad `ktoso` Malawski
edc81e8901 Merge pull request #78625 from ktoso/wip-taskpriority-escalate-api
[Concurrency] Task priority escalation APIs
2025-02-11 09:08:05 +09:00
Saleem Abdulrasool
79d2af759b ClangImporter: support modularizing __msvc_string_view.hpp
This header was introduced in a recent STL release. Modularise the
header properly, adding a shim for compatibility with older releases.

Partially based on a change from @egorzhdan.
2025-02-10 12:48:35 -08:00
Konrad `ktoso` Malawski
26c521d317 [Concurrency] Add new APIs to ABI check & add more tests 2025-02-10 17:55:42 +09:00
Konrad `ktoso` Malawski
29d95cef85 [Concurrency] Fix ptrauth value for __ptrauth_swift_escalation_notification_function
Previously these records were not used at all, so changing this has no
impact on existing runtimes. Note that we changedd the FunctionType
because the previous one was slightly incorrect -- the context comes
LAST in the type, not first.
2025-02-08 17:18:59 +09:00
Konrad `ktoso` Malawski
67e6373c23 [Concurrency] minor renames of new API for adding escalation handlers 2025-02-08 17:18:58 +09:00
Konrad `ktoso` Malawski
655bd67f67 [Concurrency] Task priority escalation handler API 2025-02-08 17:18:58 +09:00
Konrad `ktoso` Malawski
18c25845d6 [Concurrency] Task.escalatePriority 2025-02-08 17:18:57 +09:00
Saleem Abdulrasool
db160d5e81 runtime: tweak the environment handling
We would previously enable "environment variables" on Android via global
properties. Re-order the macros a bit to make it more explicit that the
environment handling is required for that and remove it when environment
variables are unsupported.
2025-02-07 09:26:49 -08:00
Alastair Houghton
c35d65efca Merge pull request #79155 from weissi/jw-bt-leak
fix ELF/DWARF leak
2025-02-07 09:18:06 +00:00
Alejandro Alonso
57234f8034 Merge pull request #70451 from Azoy/read-keypath-optimization
[stdlib] Performance improvements for reading keypaths
2025-02-05 22:57:29 -08:00
Alejandro Alonso
f38e84cfe1 Pass buffer to _projectReadOnly and fix appends 2025-02-05 14:33:30 -08:00
Johannes Weiss
e533b8a7ff fix ELF/DWARF leak 2025-02-05 14:27:18 +00:00
Konrad `ktoso` Malawski
76f3729644 The SWIFT_DUMP_ACCESSIBLE_FUNCTIONS flag must be a bool, not a string 2025-02-05 10:30:53 +09:00
Alejandro Alonso
90bd2a008e Add maxSize helper to buffer and fix reroot 2025-02-04 16:21:09 -08:00
Alejandro Alonso
edee13a612 Take the leaf type into account for max size 2025-02-04 15:16:40 -08:00
Alejandro Alonso
59c53b72f0 Don't do the kvc stored offset optimization on 16 bit platforms 2025-02-04 15:16:40 -08:00
Alejandro Alonso
02401d4bb0 Remove some workarounds 2025-02-04 15:16:39 -08:00
Alejandro Alonso
581376e86e Move variable into closure 2025-02-04 15:16:39 -08:00
Alejandro Alonso
25a4bbe549 Check maxSize on finish 2025-02-04 15:16:39 -08:00
Alejandro Alonso
6fdb684fd2 Optimization for single component and fix tests 2025-02-04 15:16:39 -08:00
Alejandro Alonso
00ace6695f Round up sizeWithMaxSize 2025-02-04 15:16:38 -08:00
Alejandro Alonso
4733da2744 Performance improvements for reading keypaths 2025-02-04 15:16:36 -08:00
Saleem Abdulrasool
6028fde00a Merge pull request #79116 from compnerd/silence
Concurrency: silence some unused variable warnings
2025-02-04 10:28:30 -08:00
Saleem Abdulrasool
0174528f81 stdlib: fix the problem swept under the rug in 58a97f1603
The `-Winvalid-offsetof` warning is valid in this case. `offsetof` is
being applied to types with a non-standard layout. The layout of this
type is undefined by the specification. There is no guarantee that the
type layout is uniform across all ABIs. It is not possible to portably
compute the offset statically, especially efficiently.

Sink this check into a unit test to avoid performing this test at
runtime. In order to do this in the standard library, we would need to
do this check through a global constructor.
2025-02-03 09:25:06 -08:00
Saleem Abdulrasool
8040430bc7 Concurrency: silence some unused variable warnings
This cleans up some warnings from the unused variables. The variables
were referenced by `assert` cases only.
2025-02-03 09:22:50 -08:00
Arnold Schwaighofer
d2d5ad6df4 Merge pull request #79111 from al45tair/eng/PR-144045984
[Backtracing] Local|RemoteMemoryReader only exists on macOS and Linux.
2025-02-03 08:36:53 -08:00
Alastair Houghton
615f884a42 Merge pull request #79057 from al45tair/backtracing-cxxstdlib-dep
[Backtracing] Add missing CxxStdlib dependency.
2025-02-03 16:26:55 +00:00
Alastair Houghton
a60dd8f76d [Backtracing] Local|RemoteMemoryReader only exists on macOS and Linux.
When fixing the previous problem, I should have realised that this
would cascade; the `@_specialize` annotations refer to the cached
versions of the types, and those are now turned off except on macOS
and Linux because they rely on the uncached versions, which are only
available on macOS and Linux.

rdar://144023438
2025-02-03 12:34:42 +00:00
Allan Shortlidge
4799f1e295 Concurrency: Suppress some warnings. 2025-02-01 13:52:43 -08:00
Allan Shortlidge
2b8d1be3ca Backtracing: Suppress a "switch covers known cases" warning. 2025-02-01 10:28:27 -08:00
Allan Shortlidge
e65aab74dd stdlib: Fix an unused variable warning. 2025-02-01 10:28:27 -08:00
Alastair Houghton
dd40b2f501 Merge pull request #79071 from al45tair/eng/PR-143869185
[Backtracing] Bump minimum deployment targets.
2025-02-01 10:28:14 +00:00
Arnold Schwaighofer
9b66fdf272 Merge pull request #79072 from al45tair/eng/PR-143865183
[Backtracing] Uncached(Local|Remote)MemoryReader only exists on macOS and Linux.
2025-01-31 16:02:04 -08:00
Philippe Hausler
854fa5c4e3 [Observation] Disable caching of KeyPaths (#78853)
* [Observation] Disable caching of KeyPaths

* Remove the cached keypath annottion for the ObservationTracked peer macro
2025-01-31 13:50:05 -08:00
Kuba (Brecka) Mracek
3afe8ebdf6 Merge pull request #78919 from kubamracek/embedded-dict-init
[embedded] Support Dictionary.init(uniqueKeysWithValues:) in Embedded Swift
2025-01-31 11:03:04 -08:00
Alastair Houghton
884cf75fb2 [Backtracing] Add missing CxxStdlib dependency.
To do this we also need to fix AddSwiftStdlib because if you set the
`INSTALL_WITH_SHARED` flag, the CMake scripts don't make a target
with the `-static` suffix, but AddSwiftStdlib also assumes that it
should dad `-static` to any module dependencies when building a
static library.
2025-01-31 14:52:48 +00:00
Alastair Houghton
6c7eda887e [Backtracing] Harden output path setting.
We should harden the output path setting so that it can't be used
as part of an exploit to get a crashing process to overwrite a
file at an attacker-controller path, or to divert the crash report
to `/dev/null` to hide their tracks or other such undesirable
activity.

Take a copy of the setting at start-up and write-protect it to
prevent attackers overwriting it.

Note that we already protect against attempts to trigger the
backtracer from privileged programs (both on Darwin and Linux);
this is really a belt and braces measure to make life harder for
attackers.

rdar://136977833
2025-01-31 14:36:56 +00:00
Alastair Houghton
5d9def94ad [Backtracing] Uncached(Local|Remote)MemoryReader only exists on macOS and Linux.
There's no support for this type on anything other than macOS and Linux
right now.

rdar://143865183
2025-01-31 14:22:31 +00:00
Alastair Houghton
857c96300f [Backtracing] Bump minimum deployment targets.
We need a minimum deployment target of 10.15 now, because of the use
of `some Sequence<T>` in the Runtime module interface.

rdar://143869185
2025-01-31 14:16:07 +00:00
Meghana Gupta
681a6c814a Merge pull request #78939 from meg-gupta/ossamoduleson
Enable serialization in OSSA
2025-01-30 23:25:19 -08:00
Dario Rexin
21c4850f6d Merge pull request #79031 from drexin/wip-143852239
[Runtime] Add specialized CVW entry points for multi payload enums
2025-01-30 21:45:09 -08:00