Commit Graph

263 Commits

Author SHA1 Message Date
Andrew Trick
0e33dfc8b6 Fix LifetimeDependence feature guard for variable accessors.
Guard variable declarations by `#if $LifetimeDependence` if they have a
~Escapable type. Accessing the declaration implies a lifetime dependence.
2025-01-14 15:41:58 -08:00
Rintaro Ishizaki
660a2ea39a Merge pull request #78335 from rintaro/revert-revert-77140-swift-lexical-lookup-validation
Reapply "[SwiftLexicalLookup] New unqualified lookup implementation validation"
2025-01-06 09:12:45 -08:00
Joe Groff
5c4406b5e8 Add an @_addressableForDependencies type attribute.
This attribute makes it so that a parameter of the annotated type, as well as
any type structurally containing that type as a field, becomes passed as
if `@_addressable` if the return value of the function has a dependency on
the parameter. This allows nonescapable values to take interior pointers into
such types.
2025-01-02 21:33:51 -08:00
Michael Gottesman
328629e7fa [concurrency] Add feature NonIsolatedAsyncInheritsIsolationFromContext.
rdar://125193256
2025-01-02 13:18:29 -08:00
Rintaro Ishizaki
a0d7068162 Revert "Merge pull request #78280 from swiftlang/revert-77140-swift-lexical-lookup-validation"
This reverts commit ae88aaca8f, reversing
changes made to b0123bca14.
2024-12-20 16:37:36 -08:00
Becca Royal-Gordon
a6df4ef85c Merge pull request #76878 from beccadax/abi-changed-your-name 2024-12-20 10:30:48 -08:00
Slava Pestov
3f1491e2b4 Merge pull request #78298 from slavapestov/remove-one-way-bind
Sema: Remove -experimental-one-way-closure-params
2024-12-19 19:37:10 -05:00
Becca Royal-Gordon
0d34b4da5b Print @abi into module interface (suppressibly) 2024-12-19 15:49:34 -08:00
Becca Royal-Gordon
94ff062edd Parse and serialize @abi attribute
This attribute will allow you to specify an alternate version of the declaration used for mangling. It will allow minor adjustments to be made to declarations so long as they’re still compatible at the calling convention level, such as refining isolation or sendability, renaming without breaking ABI, etc.

The attribute is behind the experimental feature flag `ABIAttribute`.
2024-12-19 15:48:54 -08:00
Slava Pestov
bb55d9c59a Sema: Remove -experimental-one-way-closure-params 2024-12-19 13:14:11 -05:00
Paul LeMarquand
ae88aaca8f Merge pull request #78280 from swiftlang/revert-77140-swift-lexical-lookup-validation
Revert "[SwiftLexicalLookup] New unqualified lookup implementation validation"
2024-12-19 12:40:31 -05:00
Andrew Trick
5581ab876b Remove the experimental LifetimeDependenceDiagnoseTrivial feature.
This was never used to generate a .swiftinterface, so can be safely removed. It
was used to guard compiler fixes that might break older .swiftinterface
files. Now, we guard the same fixes by checking the source file type.
2024-12-18 17:11:32 -08:00
Ben Barham
e06d0b9357 Revert "[SwiftLexicalLookup] New unqualified lookup implementation validation" 2024-12-18 15:04:16 -08:00
Jakub Florek
5dbe202087 Merge pull request #77140 from MAJKFL/swift-lexical-lookup-validation
[SwiftLexicalLookup] New unqualified lookup implementation validation
2024-12-18 17:29:47 +01:00
Andrew Trick
c71e53d363 Add LifetimeDependenceDiagnoseTrivial feature.
A feature flag is needed so that newer compilers can build older standard
library interfaces.
2024-12-16 16:09:37 -08:00
Henrik G. Olsson
ec8ea94fb9 Infer @PointerBounds macro from clang __counted_by parameters (#77387)
This results in an automatic wrapper function with safe pointer types
when the imported function has bounds attributes. This exercises similar
pathways as the recently added functionality for specifying macros from
swift_attr. The new functionality is guarded by the experimental
language feature SafeInteropWrappers.

rdar://97942270
2024-12-11 13:36:56 -08:00
Joe Groff
ac7a61679d Add an @_addressableSelf attribute to mark the self param of methods as addressable. 2024-12-06 16:54:01 -08:00
Joe Groff
3c0b08dbcb Prototype an @_addressable attribute that puts an argument at a stable address.
Many APIs using nonescapable types would like to vend interior pointers to their
parameter bindings, but this isn't normally always possible because of representation
changes the caller may do around the call, such as moving the value in or out of memory,
bridging or reabstracting it, etc. `@_addressable` forces the corresponding parameter
to be passed indirectly in memory, in its maximally-abstracted representation.
[TODO] If return values have a lifetime dependency on this parameter, the caller must
keep this in-memory representation alive for the duration of the dependent value's
lifetime.
2024-12-03 20:39:23 -08:00
Jakub Florek
866f1c1c04 Merge branch 'main' into swift-lexical-lookup-validation 2024-11-26 09:37:23 +01:00
Meghana Gupta
ae28d667ff Introduce LifetimeDependence experimental feature 2024-11-18 18:08:32 -08:00
Jakub Florek
4b544e963a Merge branch 'main' into swift-lexical-lookup-validation 2024-11-13 15:54:30 +01:00
Doug Gregor
531a1ab4c4 Temporarily put uses of "Span" and "RawSpan" behind an experimental feature flag
While Span is present, we don't yet have an official way to create Span
instances. Until then, put uses of Span and RawSpan behind an
experimental feature flag (`Span`) that must be set to use these.

Addresses rdar://139308307.
2024-11-11 16:18:33 -08:00
Rintaro Ishizaki
29482f3b0f [AST] Remove 'usesFeatureParserDiagnostics(Decl *)' function
'ParserDiagnostics' experimental feature has been removed.
2024-11-06 10:57:17 -08:00
Sima Nerush
4ee76c55b4 [SE-0449] Remove GlobalActorInferenceCutoff feature flag. 2024-11-04 12:15:55 -08:00
Pavel Yaskevich
5d77f3ca01 [Frontend] NFC: Remove KeyPathWithStaticMembers feature flag
This is a temporary way to land SE-0438 changes without disrupting
anything else.
2024-10-30 10:53:42 -07:00
Jakub Florek
1d94844322 Add SwiftLexicalLookup validation. 2024-10-20 12:12:22 +02:00
Michael Gottesman
0e0665bfbd [concurrency] Add support for HopToMainActorIfNeededThunk.
It is behind the experimental flag GenerateForceToMainActorThunks.
2024-10-17 13:31:39 -07:00
Nate Chandler
49a2831d3f [CoroutineAccessors] Old ABI may be used via flag.
Add a setting to IRGenOptions and key off of it to emit yield_once_2
coroutines using either (1) the same code-path as yield_once coroutines
or (2) a new, not-yet implemented code-path.

Add flags to set the value in both directions.  During bringup, by
default, use the existing caller-allocated ABI.
2024-10-11 08:25:02 -07:00
Nate Chandler
11b5d27594 [CoroutineAccessors] Add flag to observe errors.
Temporarily allow the legacy behavior of allowing caller coroutine
accessors to observe errors (i.e. by executing no code after the yield
if the caller threw an error) behind the
CoroutineAccessorsUnwindOnCallerError flag.
2024-10-11 08:25:02 -07:00
Gabor Horvath
cf3b333eb6 [cxx-interop] Add flag to assume C++ types are resilient
Currently, C++ types cannot appear in resilient interfaces. There are
some cases where this is overly restrictive. We plan to improve the
logic to detect what types should not appear on resilient moduel
boundaries. In the meantime, this PR introduces a flag to disable these
errors. Users relying on this flag are on their own, this should only be
a temporary workaround until we land further improvements to this
diagnostic.

rdar://137457118
2024-10-09 11:47:10 +01:00
Doug Gregor
70980b95f8 Add experimental feature MacrosOnImporters for applying macro to imported decl
This is still very much experimental and we don't want to accidentally
enable it everywhere.
2024-10-08 11:12:55 -07:00
Konrad `ktoso` Malawski
dea3b59331 Merge pull request #76250 from ktoso/wip-experimental-isolated-deinit 2024-10-03 17:19:10 +09:00
nate-chandler
ba8f8ea282 Merge pull request #76526 from nate-chandler/general-coro/20240906/1
[CoroutineAccessors] Initial framing.
2024-09-30 07:04:04 -07:00
Konrad `ktoso` Malawski
45b97f146b Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-30 13:47:39 +09:00
Amritpan Kaur
6066418340 Merge pull request #73242 from amritpan/metatype-kp-implementation 2024-09-28 02:46:15 -07:00
Amritpan Kaur
8ebc928649 Guard feature behind experimental flag. 2024-09-27 22:42:04 -07:00
Nate Chandler
98a2e6a7df [CoroutineAccessors] Added modify.
The name is a placeholder for the mutating single-yield coroutine
accessor.
2024-09-26 18:10:39 -07:00
Nate Chandler
66e6c59681 [Features] Added CoroutineAccessors. 2024-09-26 18:10:38 -07:00
Allan Shortlidge
d373036805 SE-0444: Promote MemberImportVisibility to an upcoming feature.
The proposal has been accepted, so `MemberImportVisibility` is no longer
experimental.

Resolves rdar://126284512.
2024-09-26 13:41:14 -07:00
Allan Shortlidge
0fb36a5f39 AST: Make $SpecializeAttributeWithAvailability a baseline feature.
It has been available since at least Swift 5.8.
2024-09-23 21:48:09 -07:00
Konrad `ktoso` Malawski
d89347bed0 Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-20 18:34:45 +09:00
Sima Nerush
7e5a57a07a Guard the changes behind an experimental feature flag. 2024-09-19 10:09:56 -07:00
Gábor Horváth
4d01253674 Merge pull request #76429 from swiftlang/gaborh/safe-cxx-interop-mode
[cxx-interop] Introduce a safe C++ interop mode
2024-09-19 17:25:28 +01:00
Michael Gottesman
fb281331b3 Merge pull request #76558 from gottesmm/pr-39b63781333d46b16f086a7c192efc67b26255db
[concurrency] Behind the flag UnspecifiedMeansMainActorIsolated, try inferring by default main actor isolation instead of nonisolated for unspecified.
2024-09-19 09:18:33 -07:00
Gabor Horvath
929c0ca7d8 [cxx-interop] Introduce a safe C++ interop mode
In this mode all C++ types are imported as unsafe by default. Users
explicitly marking types are escapable or not escapable can make them
imported as safe. In the future, we also want to import unannotated
functions as unsafe and add more logic to infer types that are actually
safe, like agregates of escapable types.
2024-09-19 12:34:07 +01:00
Michael Gottesman
3843899c19 [concurrency] Behind the flag UnspecifiedMeansMainActorIsolated, try inferring by default main actor isolation instead of nonisolated for unspecified.
Just to play with.
2024-09-18 13:23:23 -07:00
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Meghana Gupta
68bfc0d3b4 Make NonEscapableTypes as a suppressible experimental feature 2024-09-13 13:13:17 -07:00
Alejandro Alonso
451e7259a1 Add ValueGenerics experimental feature 2024-09-04 15:13:49 -07:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00