Commit Graph

2092 Commits

Author SHA1 Message Date
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
swift-ci
f445b8e95a Merge remote-tracking branch 'origin/main' into rebranch 2024-08-12 18:17:04 -07:00
Alex Hoppen
bdc6fc60d2 Merge pull request #75666 from ahoppen/share-is-static
[IDE] Call into `matchWitnessStructure` to check if we should inherit a comment from an overridden declaration
2024-08-12 18:02:56 -07:00
Slava Pestov
b601c294ac AST: Replace remaining uses of Type::transform() with transformRec() 2024-08-12 16:05:43 -04:00
Ben Barham
467e528200 Merge remote-tracking branch 'origin/main' into manual-rebranch-merge
Conflicts:
  - `lib/Serialization/ModuleFormat.h` bumped version to account for
    differences between main and rebranch.
2024-08-09 15:22:39 -07:00
Alex Hoppen
3ed457ab3b [Sema] Move getDocCommentProvidingDecl and getCascadingDocComment from AST to Sema
This allows use to re-use logic from Sema in those requests.

This commit just moves functions around and does not change any functionality.
2024-08-09 11:38:26 -07:00
Slava Pestov
375363a473 AST: Move global conformance lookup entry points to ConformanceLookup.h 2024-08-08 23:35:58 -04:00
swift-ci
9e7bb3d1de Merge remote-tracking branch 'origin/main' into rebranch 2024-08-06 14:34:29 -07:00
Sima Nerush
6400a294a8 Merge pull request #70227 from simanerush/same-element-requirements
[Requirement Machine] Implement same-element requirements.
2024-08-06 14:24:33 -07:00
swift-ci
402a7d60fa Merge remote-tracking branch 'origin/main' into rebranch 2024-08-02 11:37:06 -07:00
Allan Shortlidge
403156b088 Revert "AST: Don't print convenience on actor initializers."
This reverts commit 3453b136c3.
2024-08-02 07:50:51 -07:00
Ben Barham
3a4c1b8d51 Merge pull request #75633 from bnbarham/final-rebranch-pass
Changes to compile on macOS for stable/20240723 LLVM
2024-08-01 16:28:51 -07:00
Ben Barham
5b2d9e96b3 [AST] Rename getOriginalNamespace to getFirstDecl
`getOriginalNamespace` was removed in LLVM upstream in
e6ec7c8f74d1be778f4ddf794d0e2fb63b0dc3be. Use `getFirstDecl` instead.
2024-07-31 08:55:41 -07:00
Greg Titus
d87e049cde Improve diagnoses of generic specializations
Always add constraints, find fixes during simplify.
New separate fix for allow generic function specialization.
Improve parse heuristic for isGenericTypeDisambiguatingToken.
Degrade concrete type specialization fix to warning for macros.
2024-07-30 18:51:34 -07:00
Holly Borla
2ea4586580 [Requirement Machine] Implement same-element requirements. 2024-07-15 10:19:32 -07:00
Pavel Yaskevich
cfb50a0aef Merge pull request #75191 from xedin/inlinable-init-accessors
[AST/Sema] Make it possible to use init accessors in inlinable initializers
2024-07-15 09:16:30 -07:00
Hamish Knight
bfa3ad063d [ASTPrinter] Print some as a keyword
This is consistent with how the TypeRepr is
printed.
2024-07-13 14:55:35 +01:00
Pavel Yaskevich
be3396821e [AST] Print init accessors when they are ABI-public
Using init accessors from inlinable code requires `@usableFromInline`
annotation, which means that we need to print them in swift interfaces
and serialize them.
2024-07-12 09:54:08 -07:00
Allan Shortlidge
3453b136c3 AST: Don't print convenience on actor initializers.
Although actor initializers can be classified as convenience initializers by
the internals of the compiler, they are not written that way in source and
should not be printed with the `convenience` keyword.

Resolves rdar://130926278.
2024-07-11 11:47:19 -07:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00
Mykola Pokhylets
2cb7e8d7b8 Implemented suppressing isolated deinit for compatibility with older compiler versions 2024-07-11 13:09:08 +02:00
Andrew Trick
12acde2215 Merge pull request #75096 from meg-gupta/lifetimedeparg
Add support for lifetime dependence in parameter position
2024-07-10 22:56:23 -07:00
Meghana Gupta
2b28da6dd7 Update ASTPrinting of lifetime dependence 2024-07-10 14:48:34 -07:00
Meghana Gupta
8137aed238 Rename LifetimeDependentReturnTypeRepr -> LifetimeDependentTypeRepr 2024-07-10 14:20:03 -07:00
Michael Gottesman
63146bcbcd [sending] Change suppression to use __owned instead of consuming.
The reason why I am doing this is that consuming could cause no implicit
copy errors. Instead __owned will just potentially cause an error if
someone assigns into sending.

rdar://131066640
2024-07-10 12:43:33 -07:00
Allan Shortlidge
45f3e94b46 AST: Promote AssociatedTypeImplements feature to baseline. 2024-07-09 14:28:30 -07:00
Allan Shortlidge
b71e73d04c AST: Promote RetroactiveAttribute feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
e7ae787516 AST: Promote ConformanceSuppression feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
b85da32707 AST: Promote OptionalIsolatedParameters feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
8093783e21 AST: Promote ExtensionMacroAttr feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
8dad141136 AST: Promote Extern feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
c8a6a5041a AST: Remove unused functions in FeatureSet.cpp. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
6b9b7bcd83 AST: Promote PrimaryAssociatedTypes2 feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
b5acc6b07d AST: Promote AsyncSequenceFailure feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
6f972fc275 AST: Promote AssociatedTypeAvailability feature to the baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
9e5a9b963f AST: Remove NoncopyableGenerics feature suppression.
It is no longer necessary to produce `.swiftinterface` files the support older
compilers that lack support for the NoncopyableGenerics feature. Cleaning this
up makes the stdlib `.swiftinterface` far more readable.
2024-07-08 17:44:24 -07:00
Michael Gottesman
fdd435a782 [sending] Replace sending with consuming when suppressing sending from arguments in swiftinterface files.
Previously we would just not print sending. This causes problems since sending
implies a +1 parameter and by removing it we convert the parameter to a +0
parameter, breaking ABI. In this commit, I make it so that when we suppress
sending from argument parameters, we just replace it with consuming so that we
preserve ABI even for callers who do not support sending.

rdar://131066640
2024-07-08 12:34:18 -07:00
Slava Pestov
86d567f95a AST: ModuleDecl::lookupConformance() is a static method 2024-07-06 12:05:47 -04:00
Slava Pestov
1901862afc AST: Remove LookUpConformanceInSignature 2024-07-06 12:05:46 -04:00
Slava Pestov
fae01d9776 AST: Remove ModuleDecl parameter from more places 2024-07-06 12:05:46 -04:00
Akira Hatanaka
42bc49d3fe Add a new parameter convention @in_cxx for non-trivial C++ classes that are passed indirectly and destructed by the caller (#73019)
This corresponds to the parameter-passing convention of the Itanium C++
ABI, in which the argument is passed indirectly and possibly modified,
but not destroyed, by the callee.

@in_cxx is handled the same way as @in in callers and @in_guaranteed in
callees. OwnershipModelEliminator emits the call to destroy_addr that is
needed to destroy the argument in the caller.

rdar://122707697
2024-06-27 09:44:04 -07:00
Kavon Farvardin
545844ce8f ASTPrinter: fix nested signatures with inverses
A generic signature's `getInnermostGenericParams` will find the generic
parameters in the innermost scope. That's not quite right for printing
inverses, since we don't want to print an inverse for `T` when emitting
the generic signature of `f` below:

```swift
    struct S<T: ~Copyable, E> {
        func f() where E == Never {}
    }
```

Since `f` has its own generic signature, but doesn't define any generic
parameters, it shouldn't have an inverse emitted. The solution here is
to filter inverses by depth of the generic parameter.

We also want to print _all_ of the inverses in other situations, rather
than just the innermost ones. This aids in debugging and other
tools like the API digester.

resolves rdar://130179698
2024-06-25 12:06:23 -07:00
Kavon Farvardin
80c99973d7 NFC: introduce isAddingConformanceToInvertible
Removes duplicated code between Sema and the ASTPrinter.
2024-06-24 15:34:58 -07:00
Tim Kientzle
1098054291 Merge branch 'main' into tbkka-assertions2 2024-06-18 17:52:00 -07:00
Kavon Farvardin
9eba052ab2 Merge pull request #74322 from kavon/se427-noimplicit-for-invertible
SE-427: Make conditional conformances to Copyable more explicit.
2024-06-12 22:03:49 -07:00
Kavon Farvardin
a1e14ae0c7 Sema: ext's must add solo invertible conformances
This helps prevent confusion after not inferring requirements if the
extension adds a Copyable conformance.
2024-06-12 14:44:22 -07:00
Kavon Farvardin
ec4a125f3e NCGenerics: ext's might not infer invertible req's
If the extension adds conformance to an invertible protocol, it's
confusing for people to also infer conditional requirements on the
generic parameters for those invertible protocols. This came up in the
review of SE-427.
2024-06-12 14:44:22 -07:00
Artem Chikin
71ec06e656 Cache visible Clang modules for interface printing in 'ModuleDecl'
Instead of caching the collection of visible Clang modules in the 'TypePrinter', compute and cache them in the 'ModuleDecl'. When printing a textual interface, the compiler will instantiate many new instances of 'TypePrinter', which means caching them there is not useful.
2024-06-11 13:04:16 -07:00
Becca Royal-Gordon
91afad2fb0 Merge pull request #74135 from beccadax/objcimpl-the-final-countdown
Fix two objcImpl resyntaxing bugs
2024-06-06 13:42:28 -07:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00