Commit Graph

18809 Commits

Author SHA1 Message Date
John Hui e350e7e716 Merge pull request #89156 from j-hui/c_int128 2026-05-20 07:58:47 -07:00
Konrad `ktoso` Malawski efd8843a26 [Distributed][docs] Fix cut off sentence (#89279)
Fix cut off sentence in executor explanation.

resolves rdar://177443891
2026-05-20 06:37:00 -07:00
Augusto Noronha 27ba7beb5c Merge pull request #89138 from augusto2112/fix-protocol-typealias-typeref
[RemoteInspection] Fix generic typealiases in DemanglingForTypeRef
2026-05-19 10:47:18 -07:00
Carl Peto 8b87e3db49 [Backtracing] [Windows] Bugfixes for windows image crash logs (#89218)
- Fix issue with no build id showing up as `000000`... (e.g. no debug
info), now shows as `<no build id>` as intended.
- Try to avoid loading PE file unless it's necessary on Windows
symbolicating backtraces.
- DefaultSymbolLocator: PDB file finding now respects the overridable
path for use in the offline symbolicator (no effect on standard
backtracing).
- Record timestamp/size in Image Info on windows for possible future use
in offline symbolicator

---------

Co-authored-by: Carl Peto <carlpeto@Carls-MacBook-Pro.local>
2026-05-19 16:35:38 +01:00
Guillaume Lessard 616e61a367 Merge pull request #89188 from glessard/rdar177198190-ref-mutableref-conformances 2026-05-18 13:00:24 -07:00
Allan Shortlidge cf0aed5b19 Merge pull request #89189 from tshortli/revert-stdlib-remove-superfluous-availability-checks
Revert "stdlib: Remove superfluous SwiftStdlib 6.3 availability checks"
2026-05-17 12:49:01 -07:00
Mike Ash 488842f83b Merge pull request #88924 from mikeash/fix-retain-hook-nonobjc
[Runtime] Fix the swift_retain hook when ObjC interop is disabled.
2026-05-16 03:56:58 -04:00
Guillaume Lessard 28b627070a [stdlib] add missing conformances to Ref and MutableRef 2026-05-15 18:20:05 -07:00
Allan Shortlidge 4728376a57 Revert "stdlib: Remove superfluous SwiftStdlib 6.3 availability checks"
This reverts commit 27d605c584.
2026-05-15 16:51:18 -07:00
Mike Ash 3fb5d9c0a6 [Runtime] Fix the swift_retain hook when ObjC interop is disabled.
Mask the non-native bridgeobject bits rather than all spare bits. This prevents us from trying to retain pointers that aren't valid native object pointers.
2026-05-15 17:31:07 -04:00
Mike Ash 0ad96e4d5b Merge pull request #89140 from mikeash/env-vars-types-namespace
[Runtime] Group environment variable types into a types namespace.
2026-05-15 13:55:05 -04:00
Augusto Noronha 0d82d03e93 [RemoteInspection] Fix generic typealiases in DemanglingForTypeRef
When a typealias or associated type is declared inside a protocol, the
mangling of an access like S.A (for `typealias A` in `protocol P` and
`struct S : P`) wraps the protocol in a BoundGenericProtocol whose
single generic argument is the conforming Self type:

  BoundGenericProtocol
  |
  --> Protocol: P
  |
  --> TypeList:
      |
      --> Structure: S

DemanglingForTypeRef was substituting the richer parent wholesale in
place of the Protocol, losing the BoundGenericProtocol entirely and
producing a mangled tree that looks as if A were declared directly
on S rather than inside P.

Assisted-by: claude

rdar://160408523
2026-05-15 07:30:07 -07:00
John Hui 1fe7f685b5 [cxx-interop] Import __int128 as CInt128
Swift gained native Int128 / UInt128 types in SE-0425, but the plumbing
for bridging them across the C/C++ boundary was incomplete. CInt128 and
CUnsignedInt128 were never added to CTypes.swift, even though
BuiltinMappedTypes.def has been mapping __int128 / unsigned __int128 to
those names since 2013. Without the typealiases, every C declaration
mentioning __int128 was silently dropped at import time.

This patch adds the CInt128 and CUInt128 type aliases to CTypes.swift
for forward interop, and also adds the Int128 -> __int128 mapping in
PrintAsClang and IRABIDetailsProvider for reverse interop.

rdar://177111210
2026-05-14 20:58:50 -07:00
Mike Ash 61b512b68b Merge pull request #89078 from mikeash/swift_getFunctionFullNameFromMangledName-leak-fix
[Distributed] Fix leaks in failure paths of swift_getFunctionFullNameFromMangledName.
2026-05-14 21:26:38 -04:00
Mike Ash 23fac72075 Merge pull request #88933 from mikeash/remote-mirror-inline-array
[Reflection] Support inspection of InlineArray.
2026-05-14 19:53:11 -04:00
Mike Ash f7745f2094 [Runtime] Group environment variable types into a types namespace.
Rather than attempt to use standard C++ type names, create a namespace specifically for environment variable types and require vars to use a type from that namespace. This avoids the annoying collision between this `string` and `std::string`, and makes everything a bit more consistent. Rename the types a bit to be more appropriate for this context: boolean, uint8, and uint32, instead of bool, uint8_t, and uint32_t.
2026-05-14 15:16:17 -04:00
Augusto Noronha 12f6b5f403 Merge pull request #89059 from augusto2112/fix-cross-mod-extension
[RemoteInspection] Fix handling of extensions in DemanglingForTypeRef
2026-05-14 10:04:38 -07:00
Guillaume Lessard fd595f461e Merge pull request #88934 from glessard/rdar147935102-span-bytes-docs
[stdlib] improve doc-comments for span and bytes properties
2026-05-13 15:27:08 -07:00
Augusto Noronha e5873e820b [RemoteInspection] Fix handling of extensions in DemanglingForTypeRef
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
2026-05-13 11:06:13 -07:00
Mike Ash f6b456403c [Distributed] Fix leaks in failure paths of swift_getFunctionFullNameFromMangledName.
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
2026-05-13 09:56:09 -04:00
Konrad `ktoso` Malawski 689d85ffaa [Concurrency] New non-copyable Continuation type (#88182)
**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>
2026-05-13 19:30:57 +09:00
Allan Shortlidge e4ee38446e Merge pull request #89050 from tshortli/warnings
stdlib/Runtimes: Address a few warnings
2026-05-13 00:38:33 -07:00
Guillaume Lessard 459a3208c4 Merge pull request #89063 from glessard/rdar139816157-se0525-followup
[stdlib] remove functions deferred from SE-0525
2026-05-12 20:20:06 -07:00
Doug Gregor e41f6dbc49 Merge pull request #89047 from DougGregor/embedded-alloc-dealloc-box
[Embedded] Centralize allocation size/alignment computation for boxes
2026-05-12 19:49:26 -07:00
Allan Shortlidge 794b905c31 Merge pull request #88890 from tshortli/stdlib-remove-superfluous-availability-checks
stdlib: Remove superfluous `StdlibDeploymentTarget 6.3` checks
2026-05-12 18:06:13 -07:00
Guillaume Lessard 7befc8ff8c [stdlib] remove functions deferred from SE-0525 2026-05-12 15:18:45 -07:00
Allan Shortlidge 5af46147ff stdlib/Runtimes: Address some _StringProcessing build warnings.
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.
2026-05-12 15:11:45 -07:00
Guillaume Lessard 6e140559b8 [stdlib] rephrase some doc-comment notes with active voice 2026-05-12 13:56:51 -07:00
Guillaume Lessard eb8cea792c [stdlib] apply code fences to doc-comment code examples 2026-05-12 13:11:31 -07:00
Allan Shortlidge 400249a431 Merge pull request #89020 from tshortli/embedded-shims-warnings
Resolve warnings in EmbeddedShims.h
2026-05-12 11:53:07 -07:00
Allan Shortlidge da5ee4c315 Observation: Suppress a NoUsage warning.
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.
2026-05-12 10:56:36 -07:00
Allan Shortlidge 0a8918c317 stdlib: Remove spurious unsafe in StringStorageBridge.swift.
Calling `withUnsafeTemporaryAllocation()` is not unsafe by itself - using the
pointer it provides is.
2026-05-12 10:56:36 -07:00
Doug Gregor d0957a8933 [Embedded] Centralize allocation size/alignment computation for boxes
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.
2026-05-12 10:45:13 -07:00
Allan Shortlidge 27d605c584 stdlib: Remove superfluous SwiftStdlib 6.3 availability checks
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.
2026-05-12 08:34:31 -07:00
Alastair Houghton a512fc22ee Merge pull request #88488 from al45tair/eng/PR-171438432
[Windows][Backtracing] Don't use `DebugActiveProcess()`.
2026-05-12 11:41:07 +01:00
Karoy Lorentey 285fd54fde Merge pull request #88900 from lorentey/bump-swift-version
Bump Swift version to 6.5
2026-05-11 18:28:56 -07:00
Allan Shortlidge 9e9f28cf2c Resolve warnings in EmbeddedShims.h
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.
2026-05-11 17:13:34 -07:00
Augusto Noronha fb537a0c98 Merge pull request #88981 from augusto2112/fix-existential-constrained-typeref-lowering-main
[RemoteInspection] Handle lowering existential constrained metatype
2026-05-11 10:36:34 -07:00
Mike Ash 31c4b0e216 Merge pull request #87715 from mikeash/swift-job-run-exception-block
[Concurrency] Block exception propagation through swift_job_run.
2026-05-11 13:21:01 -04:00
Alastair Houghton 4915138024 Merge pull request #88960 from al45tair/eng/PR-176547291
[Backtracing][Win32] Scan the global symbol stream and deduplicate.
2026-05-11 12:04:23 +01:00
Alejandro Alonso 66a1326cdb Merge pull request #88990 from Azoy/nonescapable-ref
[stdlib] Let `Ref` reference nonescapable types
2026-05-10 16:57:15 -07:00
David Smith 51b4c9b7d0 Don't attempt to create tagged pointer strings for >11 characters (#88810)
Fixes rdar://176209576
2026-05-09 20:25:21 -07:00
Alejandro Alonso f5561eaa4a Let Ref reference nonescapable types 2026-05-09 11:00:23 -07:00
David Smith ed3eec2cd1 Change String growth to resize by 1.625x instead of 2x (#88973)
Fixes rdar://59684914
2026-05-09 08:48:39 -07:00
Augusto Noronha cd4e937294 [RemoteInspection] Handle lowering existential constrained metatype
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
2026-05-08 17:58:03 -07:00
Allan Shortlidge 9211f0aa46 stdlib: Remove superfluous unsafe markers.
Resolves warnings introduced by https://github.com/swiftlang/swift/pull/87271.
2026-05-08 16:14:04 -07:00
David Smith f08afd00c3 Vectorize UTF16->UTF8 transcoding (#83073)
Fixes rdar://141789595
2026-05-08 11:49:00 -07:00
Alastair Houghton c27e93fc8e [Backtracing][Win32] Scan the global symbol stream and deduplicate.
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
2026-05-08 16:37:22 +01:00
Mike Ash 058b1ed822 [Concurrency] Block exception propagation through swift_job_run.
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
2026-05-08 10:16:29 -04:00
Mike Ash 2bcfe0b092 [Reflection] Support inspection of InlineArray.
Report the array count as NumFields, and report the same info for each child since InlineArray is homogeneous.

rdar://176382725
2026-05-07 14:39:05 -04:00