Commit Graph

21665 Commits

Author SHA1 Message Date
Konrad 'ktoso' Malawski
0cb39ddd8a [Concurrency] Improve assertion to validate we pop the EXACT record we intend to 2025-04-04 13:25:58 +09:00
Nate Chandler
66ca0d8d4b [CoroutineAccessors] Use async bit in descriptors.
To facilitate back deployment, make use of the fact that the async bit
has up to now never been set for read and modify accessors and claim
that set bit to indicate that it is a callee-allocated coroutine.  This
has the virtue of being completely back deployable because like async
function pointers coro function pointers must be auth'd and signed as
data.
2025-04-03 19:49:44 -07:00
Doug Gregor
0100104ff7 [stdlib] Reinstate AllowUnsafeAttribute experimental feature on libraries
We need this so that older compilers can handle the .swiftinterface
files we generate. It's unnecessary for newer compilers and can be
removed later.

Fixes rdar://148529962.
2025-04-03 18:07:19 -07:00
Meghana Gupta
493f0b782e Introduce InoutLifetimeDependence feature 2025-04-03 17:32:09 -07:00
Meghana Gupta
f4a980d62d Update stdlib 2025-04-03 17:32:09 -07:00
Artem Chikin
69b4ea3469 Merge pull request #80421 from swiftlang/revert-80246-playing-with-pointy-pointers
Revert "Concurrency: remove workaround for silencing UB"
2025-04-03 16:12:53 -07:00
Allan Shortlidge
a6d311e3ed Merge pull request #80501 from tshortli/stdlib-warnings
stdlib: Address #StrictMemorySafety and unreachable code warnings
2025-04-03 15:05:51 -07:00
Alastair Houghton
1745467062 Merge pull request #80492 from al45tair/eng/PR-148506256
[Concurrency] Fix race condition in `_runAsyncMain`.
2025-04-03 18:57:23 +01:00
Allan Shortlidge
14e0eed88f stdlib: Address unreachable code warnings. 2025-04-03 10:19:46 -07:00
Allan Shortlidge
d32310fb76 stdlib: Address new #StrictMemorySafety warnings. 2025-04-03 10:18:39 -07:00
Alejandro Alonso
06937d89a6 [stdlib] Update availability of EnumeratedSequence collection conformance (#80471) 2025-04-03 14:48:05 +01:00
Alastair Houghton
a9ed11ca96 [Concurrency] Fix race condition in _runAsyncMain.
As of the custom main/global executor changes, there is a race in
`_runAsyncMain()` to construct the main executor; if this goes the wrong way,
the IRGen async tests, which use this function, can fail.

Fix by explicitly constructing a task and enqueing it on the main executor,
instead of detaching a task and trying to hop to it.

rdar://148506256
2025-04-03 12:07:52 +01:00
Guillaume Lessard
aedb869c69 Merge pull request #80116 from glessard/rdar137710901-utf8view-span-notsmol
[SE-0456] Span properties over utf8 views
2025-04-03 01:02:14 -07:00
Guillaume Lessard
7539366c46 [stdlib] rename internal and private symbols 2025-04-02 17:53:13 -07:00
Guillaume Lessard
278f76b666 [stdlib] remove a repetition 2025-04-02 17:53:13 -07:00
Guillaume Lessard
5eab44651d [stdlib] document performance limitations on String’s span 2025-04-02 17:53:13 -07:00
Guillaume Lessard
f3a01663ac [stdlib] document limitations for Substring’s span 2025-04-02 17:53:13 -07:00
Guillaume Lessard
bde7a1871c [stdlib] harden bounds checking in Substring’s span 2025-04-02 17:53:12 -07:00
Guillaume Lessard
0bbec0c6d8 [stdlib] a less public association key
- with tweaks in associated object code
2025-04-02 17:53:12 -07:00
Guillaume Lessard
0976b61ecc Apply suggestions from code review
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2025-04-02 17:53:12 -07:00
Guillaume Lessard
ea44ff9fc9 [temporary] disable small-string support 2025-04-02 17:53:12 -07:00
Alastair Houghton
941991b9e1 Merge pull request #80439 from al45tair/eng/PR-148337712
[Concurrency] Use the correct Dispatch clock.
2025-04-02 16:11:37 +01:00
eeckstein
6c0b7782f5 Merge pull request #80404 from eeckstein/optimize-floating-point
Optimizer: add some floating point optimizations
2025-04-02 13:06:25 +02:00
Konrad `ktoso` Malawski
28c4930f4f [Concurrency] Avoid inserting handler record in already cancelled task. (#80456)
This avoids the potential to race with the triggering coming from
task_cancel, because we first set the cancelled flag, and only THEN
take the lock and iterate over the inserted records. Because of this we
could: T1 flip the cancelled bit; T2 observes that, and triggers
"immediately" during installing the handler record. T1 then proceeds to
lock records and trigger it again, causing a double trigger of the
cancellation handler.

resolves https://github.com/swiftlang/swift/issues/80161
resolves rdar://147493150
2025-04-02 19:21:18 +09:00
Crazy凡
b4531a6ae8 [cxx-interop]: Refactor CxxDictionary protocols to use generics instead of Self.
- Add support for merging `std::map` and `std::unordered_map` with each other seamlessly.
- Add support for typed throws
2025-04-02 09:14:06 +08:00
David Smith
f800fdf3d2 Adopt indirect tagged strings (#80425)
Fixes rdar://142991821
2025-04-01 12:53:29 -07:00
Julian Lettner
a7ade95529 Remove Malloc Type Descriptor cache (#80355)
Remove Malloc Type Descriptor cache and trivialize
`computeMallocTypeSummary()` to only provide
language.  The remaining info in
`malloc_type_summary_t` are currently not used by
the allocator.

The principled, long-term solution is to have the
Swift compiler compute type descriptors for Swift
types.

rdar://137993434
2025-04-01 10:07:29 -07:00
Erik Eckstein
3f6f163598 stdlib: annotate some floating point functions with "optimize.sil.inline.constant.arguments" 2025-04-01 18:12:45 +02:00
Alastair Houghton
5b5f486a31 [Concurrency] Use the correct Dispatch clock.
This caused a hard-to-reproduce bug where a machine that had slept for
a long time would take a very long time to run some of the tests because
we'd be scheduling Dispatch executions with the wrong clock.

rdar://148337712
2025-04-01 16:07:12 +01:00
Kuba (Brecka) Mracek
a1cdd336f0 Merge pull request #80420 from kubamracek/embedded-drop-mach-apple
[embedded] Stop using -D__APPLE__ and -D__MACH__
2025-04-01 06:25:44 -07:00
Allan Shortlidge
c6cbcd8553 stdlib: Address StrictMemorySafety warnings in Cxx String related code. 2025-03-31 16:45:08 -07:00
Allan Shortlidge
d2e8edfc93 stdlib: Address StrictMemorySafety warnings in Span related code. 2025-03-31 16:45:08 -07:00
Allan Shortlidge
3a574c0e6f stdlib: Address StrictMemorySafety warnings in Concurrency related code. 2025-03-31 16:45:08 -07:00
Allan Shortlidge
dbd3d40c07 stdlib: Address StrictMemorySafety warnings in KeyPath related code. 2025-03-31 16:45:08 -07:00
Allan Shortlidge
60e66f3613 stdlib: Address StrictMemorySafety warnings in String related code. 2025-03-31 16:45:08 -07:00
Allan Shortlidge
b3038e6d81 stdlib: Address StrictMemorySafety warnings in Set related code. 2025-03-31 16:45:08 -07:00
Allan Shortlidge
87db90c0da stdlib: Address StrictMemorySafety warnings in Dictionary related code. 2025-03-31 16:45:08 -07:00
Allan Shortlidge
322443d91d stdlib: Address StrictMemorySafety warnings in Array related code. 2025-03-31 16:43:01 -07:00
Konrad `ktoso` Malawski
240a43b054 Revert "Concurrency: remove workaround for silencing UB" 2025-04-01 07:09:57 +09:00
Kuba Mracek
6d71f45101 [embedded] Stop using -D__APPLE__ and -D__MACH__ 2025-03-31 15:07:11 -07:00
Guillaume Lessard
e3234f8ae2 [stdlib] a better pointer as associated object id 2025-03-31 12:05:50 -07:00
Guillaume Lessard
6059be4bca [stdlib] simplify spans of bridged substrings 2025-03-31 12:05:50 -07:00
Guillaume Lessard
85a9be6a1b [stdlib] spans over bridged Substring instances 2025-03-31 12:05:50 -07:00
Guillaume Lessard
9ae58c992b [stdlib] span properties for bridged String instances 2025-03-31 12:05:50 -07:00
Guillaume Lessard
af0aa94c18 [stdlib] lazy-eager bridging for non-UTF8 NSString instances 2025-03-31 12:05:50 -07:00
Guillaume Lessard
a061425aae [stdlib] add storage property to Substring.UTF8View 2025-03-31 12:05:50 -07:00
Guillaume Lessard
3015bf522d [stdlib] add storage property to String.UTF8View 2025-03-31 12:05:50 -07:00
Alastair Houghton
b1c345f1be Merge pull request #80266 from al45tair/custom-executors-take2
[Concurrency] Provide a Swift interface for custom main and global executors.
2025-03-31 09:53:48 +01:00
Allan Shortlidge
e5d0cd4e51 Merge pull request #80322 from tshortli/allow-swift-runtime-symbol-declarations 2025-03-30 16:14:40 -07:00
Allan Shortlidge
8f2d5a759e Merge pull request #80321 from tshortli/warnings 2025-03-30 16:14:21 -07:00