Commit Graph

182354 Commits

Author SHA1 Message Date
Hamish Knight
362a239b02 Merge pull request #80581 from hamishknight/mangle-less-6.2
[6.2] [Mangler] Avoid mangling local discriminator for attached macros
2025-04-07 18:58:30 +01:00
Joe Groff
5d81f4d83a Merge pull request #80544 from jckarter/canonicalize-integer-generic-parameters-6.2
[6.2] Canonicalize different spellings of the same integer generic parameter.
2025-04-07 08:00:00 -07:00
Joe Groff
155a1d7314 Merge pull request #80542 from jckarter/builtin-emplace-double-free-6.2
[6.2] SILGen: Correct ownership forwarding of `Builtin.emplace`.
2025-04-07 07:59:28 -07:00
Hamish Knight
e1a864d867 [Mangler] Avoid mangling local discriminator for attached macros
If we're using the macro-specific local discriminator, we need to
make sure we avoid mangling the regular local discriminator in
`appendDeclName`, since that could prematurely kick local discriminator
assignment before type-checking has finished.

rdar://143834482
2025-04-07 10:26:56 +01:00
nate-chandler
1b2f8c3a19 Merge pull request #80554 from nate-chandler/general-coro/20250403/1
6.2: [CoroutineAccessors] Use async bit in descriptors.
2025-04-05 07:14:36 -07:00
Nate Chandler
63a1bb0705 [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-04 15:50:11 -07:00
Mishal Shah
50cb6ad7db Merge pull request #80528 from swiftlang/swift-6.2-support
[6.2] [update-checkout] Swift 6.2 release branch support
2025-04-04 12:49:02 -07:00
Joe Groff
81576a639f Canonicalize different spellings of the same integer generic parameter.
`Foo<256>`, `Foo<2_56>`, and `Foo<0x100>` are all canonically the same type.
Fixes rdar://144736386.
2025-04-04 10:40:15 -07:00
Joe Groff
00e59ee7a5 SILGen: Correct ownership forwarding of Builtin.emplace.
Forward the owning cleanup for the temporary buffer (if needed) instead of
creating a new cleanup, to avoid a double-free when both the initialization
cleanup and the value cleanup execute. Fixes rdar://147961840.
2025-04-04 10:22:19 -07:00
Mishal Shah
667f5fae9b Add Swift release managers as codeowners for the release branch 2025-04-03 23:47:35 -07:00
Mishal Shah
c9bdc6be7c [update-checkout] Swift 6.2 release branch support
(cherry picked from commit dbf648b172)
2025-04-03 23:44:52 -07:00
eeckstein
253f730f92 Merge pull request #80506 from eeckstein/fix-simplify-alloc-stack
Fix two bugs in alloc_stack simplification
2025-04-04 07:21:18 +02:00
Doug Gregor
a452a41440 Merge pull request #80508 from 3405691582/bootstrap
Fix the bootstrap build.
2025-04-03 21:23:59 -07:00
nate-chandler
0e2ca9a07d Merge pull request #80483 from nate-chandler/general-coro/20250327/2
[CoroutineAccessors] Open-code a task_dealloc_thru
2025-04-03 21:21:06 -07:00
Evan Wilde
96ea03f255 Merge pull request #80479 from etcwilde/ewilde/clang-linkers-choice
[Driver] Don't hardcode default linker on Linux
2025-04-03 17:32:33 -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
Augusto Noronha
cac0abbfde Merge pull request #80380 from augusto2112/fix-opaque
[DebugInfo] Use underlying type of global variables with opaque type
2025-04-03 15:39:11 -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
Erik Eckstein
f4955978d8 SIL: fix AllocStackInst.isLexical
If wrongly returned false.
2025-04-03 23:04:49 +02:00
Erik Eckstein
f8d6efd485 SimplifyAllocStack: bail if the address of the allocated existential escapes
This is not a problem if the alloc_stack already contains the opened existential.
Fixes a miscompile
rdar://148253142
2025-04-03 23:04:49 +02:00
eeckstein
ff14828c7f Merge pull request #80463 from eeckstein/fix-sil-combine
SILCombine: fix an ownership violation when replacing open existential apply arguments
2025-04-03 23:00:00 +02:00
Nate Chandler
cb68533649 [CoroutineAccessors] Open-code a task_dealloc_thru
When building for back-deployment, emit calls to an open-coded
`_swift_task_dealloc_through` function rather than the runtime
`swift_task_dealloc_through` which doesn't exist on them.
2025-04-03 13:45:27 -07:00
3405691582
782ef64931 Fix the bootstrap build.
Otherwise, referring to swift_ASTGen_bridgedSwiftClosureCall_1 results in
a linker error on a bootstrap build (i.e., without Swift host tools
available).
2025-04-03 16:40:47 -04:00
Doug Gregor
e49afc8797 Merge pull request #80389 from 3405691582/nobtcfi
Add a build flavor to opt-out of BTCFI on OpenBSD.
2025-04-03 13:29:04 -07:00
Joe Groff
367ad789c5 Merge pull request #80470 from jckarter/trivial-borrow-transitive-uses
MoveOnlyChecker: Don't follow trivial transitive uses of borrows.
2025-04-03 13:13:24 -07:00
Steven Wu
a0484229c0 Merge pull request #80467 from cachemeifyoucan/eng/PR-148446465
[ExplicitModuleBuild] Don't leak chained bridging header in objc header
2025-04-03 12:32:16 -07:00
Hamish Knight
918d4b54cf Merge pull request #80461 from hamishknight/in-sequence
[ASTScope] Allow `try` in unfolded sequence to cover following elements
2025-04-03 20:23:51 +01:00
eeckstein
68f0e9627f Merge pull request #80488 from eeckstein/rename-variable
SimplifyAllocStack: rename a variable and update a comment
2025-04-03 21:08:32 +02: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
eeckstein
70bc9cdb1f Merge pull request #80486 from eeckstein/fix-struct-extract
SIL: fix the ownership computation of `struct_extract` and `tuple_extract`
2025-04-03 18:32:07 +02:00
Kuba (Brecka) Mracek
eb1c92575d Merge pull request #80416 from kubamracek/embedded-mergeable-global-refs
[embedded] Fix compilation crash with -num-threads and -mergeable-symbols
2025-04-03 08:49:26 -07:00
John Hui
50f5221962 [NFC] promote getOperatorName() to a non-static function (#80466) 2025-04-03 10:42:37 -04: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
eeckstein
d1a04056ad Merge pull request #80487 from eeckstein/sil-builder-assert
SIL: add some asserts to catch broken enum ASTs
2025-04-03 12:56:24 +02:00
Hamish Knight
b7629c2f64 Merge pull request #80472 from hamishknight/labeled 2025-04-03 11:37:25 +01:00
Doug Gregor
7418b2593c Merge pull request #80480 from DougGregor/imported-union-member-unsafe
[Strict memory safety] Union member accessors are always unsafe
2025-04-03 03:30:25 -07:00
Saleem Abdulrasool
f3a769455d Merge pull request #80423 from brianmichel/brian/update-caching-build-ps1 2025-04-03 13:09:12 +03: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
Erik Eckstein
0b9f5eb86c SIL: add some asserts to catch broken enum ASTs 2025-04-03 08:14:42 +02:00
Doug Gregor
daf8d97616 Merge pull request #80484 from DougGregor/isolated-conformances-fix-and-docs
[SE-0470] Ensure that one cannot form an isolated conformance when Self: Sendable
2025-04-02 23:00:47 -07:00
Erik Eckstein
1100bf9bfb SimplifyAllocStack: rename a variable and update a comment
NFC
2025-04-03 06:58:00 +02:00
Allan Shortlidge
0c5fd6a301 Merge pull request #80481 from tshortli/require-explicit-availability-extension-with-spi
Sema: Fix a regression in `-require-explicit-availability` diagnostics
swift-DEVELOPMENT-SNAPSHOT-2025-04-03-a
2025-04-02 21:57:09 -07:00
Erik Eckstein
f1fc864dc6 SIL: fix the ownership computation of struct_extract and tuple_extract
A struct or tuple value can have "none" ownership even if its type is not trivial.
This happens when the struct/tuple contains a non-trivial enum, but it's initialized with a trivial enum case (e.g. with `Optional.none`).

```
  %1 = enum $Optional<String>, #Optional.none!enumelt
  %2 = struct $S (%32)               // has ownership "none"
  %3 = struct_extract %2, #S.x       // should also have ownership "none" and not "guaranteed"
```

So far it got "guaranteed" ownership which is clearly wrong.

Fixes an assertion crash in redundant load elimination.

https://github.com/swiftlang/swift/issues/80430
rdar://148311534
2025-04-03 06:40:26 +02:00
Henrik G. Olsson
4d28cc61c9 [Swiftify] clean up (NFC) (#80400)
* [Swiftify] Extract static methods to free functions (NFC)

This will make the diff smaller with introducing
_SwiftifyImportProtocol.

* [Swiftify] Run swift-format (NFC)

* [Swiftify] Remove `try` from non-throwing expression (NFC)
2025-04-02 21:24:00 -07:00
nate-chandler
6647ba5751 Merge pull request #80469 from nate-chandler/bug/20250402/1
[IRGen] Fix LinkEntity::isTypeKind.
2025-04-02 20:10:29 -07:00
Doug Gregor
1c5372858b [SE-0470] Ensure that one cannot form an isolated conformance when Self: Sendable
While here, fix some issues around implied isolated conformances (we
could get into an inconsistent state). Also provide an educational
note discussing isolated conformances and the kinds of errors one can
see when they are used from outside of their isolation domain.
2025-04-02 18:19:09 -07:00
Guillaume Lessard
7539366c46 [stdlib] rename internal and private symbols 2025-04-02 17:53:13 -07:00