As we now have docc doc catalogues and can have articles since
https://github.com/swiftlang/swift/pull/88061, we finally have a place
to put distributed actor system documentation!
Typically, the first node of a nested type is the type that contains it.
For example:
```
Demangling for $s7ModBase5OuterV5InnerC
kind=Global
kind=Class
kind=Structure
kind=Module, text="ModBase"
kind=Identifier, text="Outer"
kind=Identifier, text="Inner"
$s7ModBase5OuterV5InnerC ---> ModBase.Outer.Inner
```
However, when a type is declared inside an extension of "Outer", that
becomes part of the mangled name too. For example:
```
Demangling for $s7ModBase5OuterV6ModExtE5InnerC
kind=Global
kind=Class
kind=Extension
kind=Module, text="ModExt"
kind=Structure
kind=Module, text="ModBase"
kind=Identifier, text="Outer"
kind=Identifier, text="Inner"
$s7ModBase5OuterV6ModExtE5InnerC ---> (extension in ModExt):ModBase.Outer.Inner
````
DemanglingForTypeRef did not treat the extension case correctly, and was
losing the extension information. This patch fixes it.
Assisted-by: claude
rdar://176586425
Fix several early returns which didn't free the string copy made earlier in the function. Fix most of them by doing the string copy only at the very end where it's needed. When we race to insert into the cache and we lose that race, then free the copies before returning the other thread's cached entry.
rdar://170736413
**Explanation**:
Implementation of `Continuation` as proposed in upcoming SE proposal:
https://github.com/swiftlang/swift-evolution/pull/3246
This is a ~Copyable Continuation with much stronger safety guarantees
and no runtime overhead. Refer to proposal for details.
Initial work by @fabianfett.
**Scope**: Adds a new continuation type.
**Risk**: Low, adds new type, allows `~Copyable` into existing builtin
-- I believe this change should be safe (?)
**Testing**: Added lots of tests covering problems this aims to prevent.
**Issues**:
resolves rdar://174826360
Somewhat relevant to rdar://139975911
Co-authored-by: Fabian Fett <fabianfett@apple.com>
Allow _StringProcessing to use `@_silgen_name("swift_getTupleTypeMetadata")`
via `-enable-experimental-feature AllowRuntimeSymbolDeclarations`. Also, add
the missing `-DRESILIENT_LIBRARIES` flag to the Runtimes build for
_StringProcessing.
Even though `trackingLists.remove(_:)` returns a discardable result,
`withCriticalRegion` forwards that return value as its own return value, which
the compiler then flags as unused.
swift_allocBox was correctly computing allocation size/alignment.
swift_deallocBox was compiting it differently (and incorrectly).
Factor out the logic into a separate function that we use from both
places.
Now that `SwiftStdlib 6.3` maps to real versions for Apple's operating systems
(https://github.com/swiftlang/swift/pull/87510), checks like
```
if #available(StdlibDeploymentTarget 6.3, *) { ... }
```
inside the implementation of the stdlib are no longer necessary to satisfy the
availability checker and instead cause warnings to be emitted. Remove the now
superfluous checks.
This is a reattempt of https://github.com/swiftlang/swift/pull/87744. The
previous attempt was reverted because it turned out that there were some
configurations (outside of Swift CI) in which the stdlib was built with an
unnecessarily low deployment target. That has now been corrected, unblocking
this fix.
This header has `#pragma clang assume_nonnull begin` which causes nullability
annotations to be inferred for most declarations. However, Clang does not infer
`_Nonnull` for function pointer declarations where the return type is also a
pointer so explicit annotations are needed for a few declarations.
RemoteInspection was failing to produce type info for metatypes of
constrained existentials (any SomeType<ConstraintHere>.Type)
A constrained existential has the same layout as a regular protocol
composition, so we can use that instead.
rdar://176586637
While for Swift symbols, they always exist in the module streams, the
PDBs that Microsoft serves from its symbol servers don't work that
way, and contain symbols that don't show up in the module streams.
Thus we need to add function data for each of those.
That then creates a problem where the symbol is in both places, so we
need to de-duplicate as well.
rdar://176547291
When an exception is thrown through swift_job_run, it leaves the Concurrency runtime in an inconsistent state, which can lead to misbehavior or crashes later on. It's very difficult to work out what the cause is when this happens. Since the program state is doomed once this happens, prevent exceptions from propagating through swift_job_run at all, and terminate immediately when throwing.
rdar://171909991
There's a longstanding problem in implementing `-isEqualToString:`,
where if you don't know how to get fast access to the other NSString's
contents, you have to pick between doing it character by character (very
slow), or calling [other isEqualToString: self], which risks infinite
recursion if the other string does the same.
This cuts the gordian knot by adding a new method
`isEqualToBytes:encoding:count:`, so you can get the contents out of
`self`, and hand it to the other string, confident that it will not need
to (nor, in fact be able to) ask you anything that might recurse.
Use unreachable methods instead of abstract methods in the Embedded
concurrency library, so that the C++ compiler doesn't inject a
reference to __cxa_pure_virtual, which is in the C++ runtime.
Rather than always calling malloc/free, parameterize the StackAllocator
on the underlying global allocator. The default uses malloc/free, so
most uses of StackAllocator are unchanged by this refactoring.
In the embedded concurrency library, swap in an global allocator that
uses swift_slowAllloc/swift_slowDealloc instead, eliminating the
remaining malloc/free references so everything goes through the
platform abstraction layer. For now, don't change the non-embedded
concurrency library in the same manner.
Memory allocation in Swift should always go through the common Swift
entrypoints rather than have calls directly into the C standard
library. This goes through the platform abstraction layer in Embedded
Swift, for platforms that may not have a C standard library.