Commit Graph

184428 Commits

Author SHA1 Message Date
Adrian Prantl
fa7e11851f Merge pull request #85693 from charles-zablit/charles-zablit/windows/upgrade-python-to-3.10-to-release-6.2
🍒 [windows] add Embeddable Python 3.10.1 to build.ps1
2025-12-09 21:35:21 -08:00
Charles Zablit
783cd84eb9 [windows] upgrade to Python 3.10.1
(cherry picked from commit caec84cd54)
2025-12-08 12:40:46 +00:00
Charles Zablit
7160097b7f [windows] remove pip installation
(cherry picked from commit 5cd4723862)
2025-12-05 16:46:19 +00:00
Saleem Abdulrasool
a90079d55b utils: adjust the python path
Adjust the python relative path when building LLDB to account for the
restructuring in the packaging.

(cherry picked from commit 8c66755133)
2025-12-05 16:46:19 +00:00
Charles Zablit
9329b27a56 [windows] add Embeddable Python to build.ps1
(cherry picked from commit df431c77cf)
2025-12-05 16:46:13 +00:00
Mishal Shah
a6aa30f93e Merge pull request #85769 from swiftlang/update-version-6.2.3
Bump the Swift version to 6.2.3
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-12-03-a
2025-12-02 10:00:11 -08:00
Mishal Shah
1846197588 Bump the Swift version to 6.2.3 2025-12-01 11:32:06 -08:00
Ryan Mansfield
3803158def Merge pull request #85710 from rjmansfield/cherry-pick-f455f3c-6.2
[6.2] Cherry-pick [Distributed] add availability annotations in test
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-11-26-a
2025-11-26 15:25:41 -05:00
Konrad Malawski
eaf0848106 [Distributed] add availability annotations in test
resolves rdar://159314393
2025-11-26 10:32:26 -05:00
Mishal Shah
4a0bb825af Merge pull request #85631 from MaxDesiatov/release/6.2-wasilibc-test
[6.2] disable `wasilibc_function.swift` as failing on AL2023
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-11-20-a
2025-11-20 14:24:24 -08:00
Max Desiatov
b22d83c2e9 Delete test/embedded/wasm/wasilibc_functions.swift 2025-11-20 22:20:32 +00:00
Alastair Houghton
e68723f3ba Merge pull request #85306 from al45tair/add-fatal-error-6.2
[Observation] Add threading fatal error handler.
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-11-14-a swift-6.2-DEVELOPMENT-SNAPSHOT-2025-11-19-a
2025-11-10 11:09:58 +00:00
Kavon Farvardin
f60b972a10 Merge pull request #85314 from aschwaighofer/cherry-pick-6.2-of-pr85022
[6.2] [Test] Don't expect IRGen/typed_throws_abi.swift to fail
2025-11-05 13:24:55 -08:00
Dario Rexin
965bbf0957 [6.2] [Test] Don't expect IRGen/typed_throws_abi.swift to fail
Since this test was introduced, code gen has changed and it is now passing on arm64e as well

Cherry-pick of #85022 to 6.2

rdar://163168020
2025-11-04 11:29:28 -08:00
Kavon Farvardin
bdc54cd5c2 Merge pull request #85304 from eeckstein/fix-benchmark-tests-6.2
[6.2] benchmark script tests: make the match string for invalid option errors more flexible
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-11-05-a
2025-11-04 08:56:32 -08:00
Alastair Houghton
ab053f305c [Observation] Add threading fatal error handler.
When the Threading library experiences a fatal error, we need to
tell it what to do.
2025-11-04 10:14:28 +00:00
Erik Eckstein
35783b97d0 benchmark script tests: make the match string for invalid option errors more flexible
Because the actual output depends on the python version
2025-11-04 06:44:09 +01:00
Adrian Prantl
49953edce0 Merge pull request #85195 from augusto2112/remote-mirr-indirect-addr-6.2
[RemoteMirrors] Add hook for resolving indirect addresses
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-31-a swift-6.2-DEVELOPMENT-SNAPSHOT-2025-11-01-a swift-6.2-DEVELOPMENT-SNAPSHOT-2025-11-03-a
2025-10-31 13:58:10 -07:00
Augusto Noronha
98a0a3fcac [RemoteMirrors] Add hook for resolving indirect addresses
Adds a hook so implementations of memory reader can add logic to
resolving remote addresses. This is needed because of an interaction
between LLDB, which tries to read memory from files instead of process
memory whenever possible and the DYLD shared cache.

The shared cache will merge pointers in the GOT sections from multiple
images into one location, and update the relative offsets to point to
the new location.
LLDB, will have initially read the offset pointing to the "old"
location, which will be zeroed out in live memory. This gives LLDB the
opportunity to re-read the relative offset, but from live memory, so it
can return the right pointer in the shared cache.

(cherry picked from commit 0f4a3ceb67a3669cd5433d5ae13fec6852876173)

rdar://163652093
2025-10-29 10:14:08 -07:00
Alastair Houghton
678ec6ec60 Merge pull request #85152 from al45tair/eng/PR-163386438
Make the _Concurrency library depend on _Builtin_float
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-28-a swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-30-a
2025-10-28 10:43:54 +00:00
Allan Shortlidge
13816faef3 Merge pull request #85159 from tshortli/suppress-inherited-retroactive-conformance-diags-with-module-qualification-6.2
[6.2] Sema: Fix a regression in retroactive conformance diagnostic suppression
2025-10-27 20:11:32 -07:00
Allan Shortlidge
60c711d4a6 Sema: Fix a regression in retroactive conformance diagnostic suppression.
Module qualifying a protocol name in an inheritance clause should suppress
retroactive conformance diagnostics for the protocol and any protocols it
inherits from, just like adding the `@retroactive` attribute. Fixes a
regression in Swift 6.2 introduced by
https://github.com/swiftlang/swift/pull/81576.

Resolves rdar://162295268 and https://github.com/swiftlang/swift/issues/85153.
2025-10-27 11:34:25 -07:00
Doug Gregor
5464841e90 Make the _Concurrency library depend on _Builtin_float
rdar://163386438
2025-10-27 15:17:02 +00:00
Kavon Farvardin
8c1cc1b78a Merge pull request #85120 from kavon/6.2-fspl-debuginfo-rdar163281183
[6.2] DebugInfo: fix FSPL SILLocation assertion issue
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-25-a
2025-10-25 01:30:47 -07:00
Michael Gottesman
c6314a37b0 Merge pull request #84986 from gottesmm/release/6.2-rdar156525771
[6.2] Add support for TBI masking optimization for nonisolated(nonsending)
2025-10-24 15:31:26 -07:00
Kavon Farvardin
e6694c124e DebugInfo: fix FSPL SILLocation assertion issue
We were reusing the SILLocation from return instructions
to generate projections to ultimately destroy values.

This fix improves on what we were doing before, by
converting the insertion point's SILLocation into a
RegularLocation _without dropping_ the source location.

If the SILLocation was tied to an ASTNode, it'll carry
over the line location for this new regular location.
Otherwise, it'll fallback to the prior strategy of
producing a line 0 autogenerated location.

resolves rdar://163281183

(cherry picked from commit fd06bb1eeb)
2025-10-24 12:08:07 -07:00
eeckstein
de48c2f59b Merge pull request #84946 from eeckstein/fix-simplify-cfg-6.2
[6.2] SimplifyCFG: insert compensating destroy when replacing a `switch_enum`
2025-10-23 20:47:01 +02:00
Erik Eckstein
c4c1c50e73 SimplifyCFG: insert compensating end_lifetime when replacing a switch_enum
This is a follow-up of https://github.com/swiftlang/swift/pull/84905, which handles non-copyable enums with a deinit correctly.
Also, for copyable enums it's more efficient to use `end_lifetime` than `destroy_value`, because we already know that the enum contains a trivial case.
Therefore no destroy operation is needed.
2025-10-23 08:18:04 +02:00
Erik Eckstein
ffc71e95e8 SimplifyCFG: insert compensating destroy when replacing a switch_enum
When replacing a `switch_enum` of an owned enum value with a branch to a non-payload case destination,
we need to insert a destroy of the enum value.

Fixes a SIL ownership verification failure.
https://github.com/swiftlang/swift/issues/84552
rdar://161482601
2025-10-23 08:17:12 +02:00
Michael Gottesman
8e3fa552dc Fix a concurrency irgen test for differences between main and release/6.2 2025-10-17 13:36:24 -07:00
Michael Gottesman
abc2e304dc Small fix for type with different name on 6.2. 2025-10-17 11:40:50 -07:00
Michael Gottesman
8519540633 [concurrency] Implement bit masking for TBI when available or in tagged pointer bits otherwise.
Specifically, when TBI is available we use the bottom two bits of the top nibble
(bits 60,61). On platforms without TBI, we use the bottom two tagged pointer
bits (bits 0, 1).

rdar://156525771
(cherry picked from commit 390afe3e7d)
2025-10-17 11:33:27 -07:00
Michael Gottesman
f8ec8ac314 Test updates for previous commit.
(cherry picked from commit dc193063cf)

Conflicts:
	test/Concurrency/isolation_macro_sil.swift
	test/Concurrency/nonisolated_nonsending_optimize_hoptoexecutor.swift
2025-10-17 11:33:27 -07:00
Michael Gottesman
ce162afd9d [silgen] Use Builtin.ImplicitActor instead of Optional<any Actor> to represent the implicit isolated parameter.
NOTE: We are not performing any bitmasking at all now. This is so that we can
transition the code base/tests to expect Builtin.ImplicitActor instead
of Optional<any Actor>.

NOTE: The actual test changes are in the next commit. I did this to make it
easier to review the changes.

This should not have any user visible changes.

(cherry picked from commit 788abd0b96)
2025-10-17 11:33:27 -07:00
Michael Gottesman
f625cce668 [concurrency] NFC refactor out some code from LowerHopToActor before changing the pass.
Specifically, I am refactoring out the code that converts actor/Optional<any
Actor> to an executor in preparation for adding code to LowerHopToExecutor that
handles Builtin.ImplicitIsolationActor.

The only actual functional change is that I made getExecutorForOptionalActor
support being invoked when generating code (i.e. when its SILBuilder has an
insertion point at the end of the block). It previously assumed that it would
always have a real SILInstruction as an insertion point. The changes can be seen
in the places where we now check if the insertion point equals the end of a
block. Its very minor and due to conditional control flow doesn't have any
actual impact given the manner that the code today is generated. This came up in
a subsequent commit when I reuse this code to generate a helper function for
converting Builtin.ImplicitIsolationActor to Builtin.Executor.

(cherry picked from commit 21915ae428)

Conflicts:
	lib/SILOptimizer/Mandatory/LowerHopToActor.cpp
2025-10-17 11:33:27 -07:00
Michael Gottesman
380e414a35 [sil] Add a new instruction cast_implicit_actor_to_optional_actor.
This instruction converts Builtin.ImplicitActor to Optional<any Actor>. In the
process of doing so, it masks out the bits we may have stolen from the witness
table pointer of Builtin.ImplicitActor. The bits that we mask out are the bottom
two bits of the top nibble of the TBI space on platforms that support TBI (that
is bit 60,61 on arm64). On platforms that do not support TBI, we just use the
bottom two tagged pointer bits (0,1).

By using an instruction, we avoid having to represent the bitmasking that we are
performing at the SIL level and can instead just make the emission of the
bitmasking an IRGen detail. It also allows us to move detection if we are
compiling for AArch64 to be an IRGen flag instead of a LangOpts flag.

The instruction is a guaranteed forwarding instruction since we want to treat
its result as a borrowed projection from the Builtin.ImplicitActor.

(cherry picked from commit fe9c21fd87)
2025-10-17 11:33:27 -07:00
Michael Gottesman
40392258a6 [silgen] Change two places we used Builtin.Executor to instead use Optional<any Actor> as an expected executor.
We want SILGen to have a simplified view of its executor and know that whenever
one sees an Actor, it is an actual actor instead of a Builtin.Executor. This
just simplifies code. Also, we should eventually have an invariant that
Builtin.Executor should only be allowed in LoweredSIL after LowerHopToExecutor
has run. But that is a change for another day.

(cherry picked from commit 81885a67d0)
2025-10-17 11:33:27 -07:00
Michael Gottesman
a4dca2545b [concurrency] Add a new type Builtin.ImplicitActor.
This is currently not wired up to anything. I am going to wire it up in
subsequent commits.

The reason why we are introducing this new Builtin type is to represent that we
are going to start stealing bits from the protocol witness table pointer of the
Optional<any Actor> that this type is bitwise compatible with. The type will
ensure that this value is only used in places where we know that it will be
properly masked out giving us certainty that this value will not be used in any
manner without it first being bit cleared and transformed back to Optional<any
Actor>.

(cherry picked from commit 2fa3908e94)

Conflicts:
	lib/AST/ASTPrinter.cpp
	lib/IRGen/IRGenModule.cpp
2025-10-17 11:33:27 -07:00
Michael Gottesman
bf524c4fca [sil-llvm-gen] Run Sema before we attempt to emit IR.
(cherry picked from commit 3a96e99bd8)
2025-10-17 11:33:27 -07:00
Michael Gottesman
2e7c74c102 [sil-llvm-gen] Allow for -Xllvm options to be passed to sil-llvm-gen.
Specifically, we ignore the -Xllvm bit and put the option into
FrontendOptions.LLVMArgs so that parts of CompilerInvocation that assumes that
-Xllvm flags will be placed there are actually there. We still pass through the
argument to llvm::cl so it gets set that way as well.

(cherry picked from commit d0d2163e0d)
2025-10-17 11:33:27 -07:00
Michael Gottesman
c86902d342 [sil-llvm-gen] Update some settings setup from sil-opt.
(cherry picked from commit ca2fb094d2)
2025-10-17 11:33:27 -07:00
Michael Gottesman
d7e41d2d9b [sil-llvm-gen] Add support for emitting IR before LLVM optimizations run.
Specifically, I renamed the old llvm-as which printed with optimization as
llvm-as-opt and made llvm-as just test IRGen. That is really the true reason
that I created this utility many years ago: to test how IRGen lowers specific
SIL instruction sequences. How LLVM optimizes such sequences once lowered is a
different problem. I updated the one test that used sil-llvm-gen and required
optimizations to use llvm-as-opt so that the tests output did not change.

(cherry picked from commit 5c8a95f27a)
2025-10-17 11:33:27 -07:00
Michael Gottesman
605437ab18 [irgen] Make HasAArch64TBI an IRGen option instead of a LangOpts.
With some changes that I am making, we will no longer need this flag at the SIL
level, so we can just make it an IRGen flag (which it really should have been
in the first place).

(cherry picked from commit 361e63c815)
2025-10-17 11:33:27 -07:00
Michael Gottesman
7fcc8a5460 [frontend] Expose via a LangOption whether or not the compiler is compiling for a triple that supports AArch64 TBI.
Just breaking down layers of a larger patch to make it easier to review.

(cherry picked from commit bfecaa357f)
2025-10-17 11:33:27 -07:00
Michael Gottesman
b4c3a212f4 [ast] Convert swift::getBuiltinType to use a covered switch for BuiltinTypeKind.
This is an NFC change. The idea is that this will make it easier to add new
BuiltinTypeKinds. I missed this code when adding Builtin.ImplicitIsolationActor.
By adding a covered switch, we can make sure this code is updated in the
future.

(cherry picked from commit 05536d7183)
2025-10-17 11:33:27 -07:00
Hamish Knight
d7bb1fe25f Merge pull request #84965 from hamishknight/quick-fix-6.2
[6.2] [Sema] Quick fix for non-copyable type resolution crash
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-18-a swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-21-a swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-20-a swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-23-a swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-22-a
2025-10-17 05:38:29 +01:00
Hamish Knight
7629fbd0e0 [Sema] Quick fix for non-copyable type resolution crash
Add a guard to make sure we don't attempt to check for Copyable
conformance if the type contains type variables. This matches the
existing behavior where we won't check for unbound generic types.
Neither behavior is correct since we won't do the proper check once
the generic type is opened, but this at least makes the behavior
consistent and fixes the crash. It's also a very low risk fix that
can be cherry-picked.

rdar://152287178
2025-10-16 20:34:38 +01:00
Kavon Farvardin
24154e3638 Merge pull request #84937 from kavon/6.2-the-realloc-strikes-back-rdar162440304
[6.2] MoveOnlyChecker: avoid dangling reference in custom alloc
2025-10-16 12:22:05 -07:00
Guillaume Lessard
f449b7bcc1 Merge pull request #84894 from hnrklssn/revert-span-for-libstdc++
[6.2] Revert "add std::span to module map for libstdc++"
2025-10-16 08:16:50 -07:00
Kavon Farvardin
743599b765 MoveOnlyChecker: avoid dangling reference in custom alloc
The AvailableValueStore maintains stable spans of SILValues,
one span (effectively a MutableArrayRef) per basic block, that
is preallocated for performance.

This patch fixes an issue where _a pointer_ to a span is vended from
`AvailableValueStore::get` and that pointer is into storage within
a DenseMap, which can reallocate and invalidate all such pointers.

There's no reason to be returning a pointer to a MutableArrayRef,
aka AvailableValues, so I've simply stripped off that indirection to
fix this issue.

resolves rdar://162440304

(cherry picked from commit d1f3f8495e)
2025-10-15 15:03:42 -07:00