Commit Graph

182439 Commits

Author SHA1 Message Date
Konrad 'ktoso' Malawski
5c9d952fb0 Disable test on windows since %env not supported 2025-04-07 13:11:41 +09:00
Konrad 'ktoso' Malawski
39ada7102d [Distributed] Dont emit TBD also for distributed thunks
This resolves pedantic "all" TBD validation issues, i.e. we dont emit
unexpected records anymore - we would before as we only checked for
is_distributed but we also want to skip those for is_distributed_thunk

resolves rdar://128284016
2025-04-07 13:11:40 +09:00
Konrad 'ktoso' Malawski
c3c3ed5ad2 [Distributed] Accessor must be available cross module in resilient mode
This is an important fix for libraries using @Resolvable in resilient
libraries. Without the fix we're missing an accessor and this will fail
some remote calls which make use of remote calls on resolvable
protocols. This would manifest as missing accessor error thrown by the
executeDistributedTarget function.

resolves rdar://148224780
2025-04-07 13:11:40 +09:00
Gábor Horváth
5ef33db967 Merge pull request #80568 from swiftlang/gaborh/rvalue-ref-calling-conv 2025-04-06 23:40:42 +01:00
Gabor Horvath
6b863f9575 [cxx-interop] Fix calling rvalue ref of a trivial type
The Swift compiler used to generate a direct call to functions taking
rvalue references to trivial types even though they expected an indirect
calling conventions. This PR changes the calling convention on the Swift
side to match C++.

rdar://148585343
2025-04-06 18:58:12 +01:00
Hamish Knight
5a814ce506 Merge pull request #80532 from hamishknight/xcodegen-timing
[test] Use release mode in `swift-xcodegen.test`
2025-04-06 16:43:08 +01:00
Allan Shortlidge
374fc90b42 Merge pull request #80563 from tshortli/member-import-visibility-objc-overloads-in-extensions
AST: Filter out some Obj-C overrides when MemberImportVisibility is enabled
2025-04-06 03:26:38 -07:00
Hamish Knight
2eff1620a3 [test] Use release mode in swift-xcodegen.test
This takes about twice as long to build in CI, but runs significantly
quicker (~22x). The exact time taken varies quite a bit between runs,
but this brings the worst-case overall run-time down from ~500s to
~200s. While here, make sure we pass `--skip-build` to the second
invocation to ensure we avoid building twice. Also disable using the
dependency cache since we want to test a clean build, and we just
want swiftpm to use the local deps.
2025-04-06 10:55:14 +01:00
eeckstein
98739a412a Merge pull request #80543 from eeckstein/isolated-conformance-opt
CastOptimizer: handle isolated conformances
2025-04-06 10:59:51 +02:00
Allan Shortlidge
c5e5311cc8 Merge pull request #80560 from tshortli/member-import-visibility-diags-implicit
Parse/Sema: Add source locations to implicit code for `MemberImportVisibility` diagnostics
2025-04-05 18:07:55 -07:00
Allan Shortlidge
eafb84713e AST: Filter out some Obj-C overrides when MemberImportVisibility is enabled.
Unlike in Swift, Obj-C allows method overrides to be declared in extensions
(categories), even outside of the module that defines the type that is being
extended. When MemberImportVisibility is enabled, these overrides must be
filtered out to prevent them from hijacking name lookup and causing the
compiler to insist that the module that defines the extension be imported.

Resolves rdar://145329988.
2025-04-05 17:34:21 -07:00
Pavel Yaskevich
ca1320e43d Merge pull request #80551 from xedin/fix-new-distributed-test
[Tests] Distributed: Use `%target-swift-6.0-abi-triple` to avoid avai…
2025-04-05 14:11:28 -07:00
Allan Shortlidge
3e9db90203 Tests: Add missing coverage to members_transitive_compiler_protocols.swift. 2025-04-05 09:48:21 -07:00
Allan Shortlidge
703126a3ce Parse: Improve MemberImportVisibility diags for appendLiteral(_:) calls.
Ensure compiler generated calls to `appendLiteral(_:)` have source locations for
diagnostics.

Partially resolves rdar://144535697.
2025-04-05 09:48:20 -07:00
Allan Shortlidge
b97ec5bbe5 Sema: Improve MemberImportVisibility diags for for-in loops.
Ensure that source locations are attached to the implicit calls to
`makeIterator()` and `next()` for diagnostics.

Partially resolves rdar://144535697.
2025-04-05 09:47:56 -07:00
Anthony Latsis
ddd9914230 Merge pull request #80524 from AnthonyLatsis/diag-descriptive-decl-kind
AST: Cut down on `DescriptiveDeclKind` usage in diagnostics
2025-04-05 17:13:22 +01:00
Anthony Latsis
5c190b9613 AST: Cut down on DescriptiveDeclKind usage in DiagnosticsSIL.def 2025-04-05 12:31:20 +01:00
Anthony Latsis
3c3dd54f39 AST: Cut down on DescriptiveDeclKind usage in DiagnosticsParse.def 2025-04-05 12:31:20 +01:00
Anthony Latsis
2d899d0e73 AST: Cut down on DescriptiveDeclKind usage in DiagnosticsCommon.def 2025-04-05 12:31:20 +01:00
Anthony Latsis
cdb2aaccfd AST: Cut down on DescriptiveDeclKind usage in DiagnosticsClangImporter.def 2025-04-05 12:31:20 +01:00
Anthony Latsis
a0930dec31 AST: Cut down on DescriptiveDeclKind usage in DiagnosticsSema.def 2025-04-05 12:31:19 +01:00
Anthony Latsis
d93b6a4e4d DiagnosticEngine: Do not describe an extension's nominal for %kindonly
This is the desired behavior is most cases. In the future, we should
consider adding format specifiers for short/detailed descriptions.
2025-04-05 12:31:19 +01:00
Anthony Latsis
96be6cf6a6 DiagnosticEngine: Do not describe an accessor's storage for %kindonly
This is the desired behavior is most cases. In the future, we should
consider adding format specifiers for short/detailed descriptions.
2025-04-05 12:31:19 +01:00
Anthony Latsis
08d46d2542 Merge pull request #80473 from AnthonyLatsis/diag_type_attr
DiagnosticEngine: Support `TypeAttribute` diagnostic arguments
2025-04-05 12:25:45 +01:00
Anthony Latsis
835e30560d Merge pull request #80529 from AnthonyLatsis/ammanita-pantherina
[NFC] Sema: Factor out some sources into subdirectories
2025-04-05 10:31:38 +01:00
Hamish Knight
ccdff3259c Merge pull request #80546 from hamishknight/mangle-less
[Mangler] Avoid mangling local discriminator for attached macros
2025-04-05 10:14:49 +01:00
Erik Eckstein
f5ca12d42b Simplification: check for isolated conformances when simplifying metatype casts
rdar://147417762
2025-04-05 09:00:30 +02:00
Erik Eckstein
75a0cc031b CastOptimizer: handle isolated conformances
Check the isolation of conformances to avoid wrong folding of dynamic casts
rdar://147417762
2025-04-05 09:00:30 +02:00
Erik Eckstein
e18bedaa87 CastOptimizer: pass the SIL function to the cast-classify APIs, instead of the module decl
NFC
2025-04-05 09:00:30 +02:00
Erik Eckstein
9df1039379 SIL: add matchesActorIsolation
Returns true if the conformance is not isolated or if its isolation matches the isolation `inFunction`.
2025-04-05 09:00:30 +02:00
Anthony Latsis
3fd8f0a008 [NFC] Sema: Factor out derived conformance sources into subdirectory 2025-04-05 05:32:37 +01:00
Allan Shortlidge
bcf845c620 Merge pull request #80537 from tshortli/custom-availability-windows
Tests: Use `#include` instead of `#import` for compatibility on Windows
2025-04-04 17:48:16 -07:00
nate-chandler
0063af561f Merge pull request #80520 from nate-chandler/general-coro/20250403/1
[CoroutineAccessors] Use async bit in descriptors.
2025-04-04 15:47:19 -07:00
Egor Zhdan
1f80e50376 Merge pull request #80539 from swiftlang/egorzhdan/test-switch-flag
[cxx-interop] Switch to non-experimental flag in tests
2025-04-04 22:55:53 +01:00
Pavel Yaskevich
ffe25be16f [Tests] Distributed: Use %target-swift-6.0-abi-triple to avoid availability issues 2025-04-04 14:45:10 -07:00
QuietMisdreavus
3f4519e7a5 add Sendable to the allowed attributes in declaration fragments (#80465)
rdar://142903358
2025-04-04 14:33:20 -06:00
Hamish Knight
af5ec3eb1e Merge pull request #80533 from hamishknight/gen-time
[xcodegen] Print the time taken to generate
2025-04-04 21:29:23 +01:00
Hamish Knight
da1d37de26 [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-04 19:41:04 +01:00
eeckstein
6f68a86c3e Merge pull request #80530 from eeckstein/fix-sil-linker
embedded: fix two problems in the SILLinker
2025-04-04 19:34:05 +02:00
Artem Chikin
6eaa07a880 Merge pull request #80540 from swiftlang/revert-80452-lifetimeinout
Revert "Add support for inout lifetime dependence"
2025-04-04 09:31:46 -07:00
Joe Groff
e75ee3f4cf Merge pull request #80507 from jckarter/builtin-emplace-double-free
SILGen: Correct ownership forwarding of `Builtin.emplace`.
2025-04-04 09:25:35 -07:00
Joe Groff
b4fb5296f9 Merge pull request #80519 from jckarter/canonicalize-integer-generic-parameters
Canonicalize different spellings of the same integer generic parameter.
2025-04-04 09:25:18 -07:00
Pavel Yaskevich
8bf8c24bf9 Merge pull request #80503 from xedin/extensible-attr
[AST/Sema] Add `@extensible` attribute on `enum` declarations
2025-04-04 09:17:56 -07:00
Gábor Horváth
95bd08660e Merge pull request #80495 from swiftlang/gaborh/nested-reverse-interop-fixes
[cxx-interop] Fix nested structs for non-opaque types
2025-04-04 17:00:37 +01:00
Artem Chikin
39e1791b67 Revert "Add support for inout lifetime dependence" 2025-04-04 09:00:09 -07:00
Egor Zhdan
124256d282 [cxx-interop] Switch to non-experimental flag in tests
This gets rid of the flag deprecation warning that was printed for `enable-experimental-cxx-interop`.
2025-04-04 16:35:31 +01:00
Allan Shortlidge
a200cf518e Tests: Use #include instead of #import for compatibility on Windows.
The `#import` directive is not supported by Clang in MSVC compatibility mode,
so use `#include` instead for compatibility in the ClangImporter tests for
custom availability domains.

Resolves rdar://147122406.
2025-04-04 07:53:55 -07:00
Slava Pestov
9148ae32bd Merge pull request #80482 from slavapestov/abstract-conformance-cleanup
AST: Simplify ProtocolConformanceRef operations a little bit
2025-04-04 10:37:49 -04:00
David Cummings
7836aff72b Merge pull request #80504 from daveyc123/doccForDiagnostics
Prepare diagnostics docs for docc generation
2025-04-04 10:23:28 -04:00
Slava Pestov
b77fdb6bce Merge pull request #80511 from slavapestov/fix-issue-79367
Sema: Fix regression with 'Failure' type witness inference hack
2025-04-04 09:22:38 -04:00