Alex Hoppen
ec73a3a721
[AST] Move conversion of ClosureActorIsolation to ActorIsolation to its own function
...
Just a little bit of cleanup because this logic is really quite general and doesn't need to live in `getActorIsolationOfContext`.
2022-09-07 11:12:09 +02:00
swift-ci
6ce4bea5d1
Merge pull request #60688 from theblixguy/defer-isolation-closures
...
[Concurrency] Handle actor isolation for defers in closures
2022-08-31 19:21:13 -07:00
Pavel Yaskevich
e22fc3e34c
Merge pull request #60345 from xedin/type-wrappers
...
[TypeChecker] Type wrappers (experimental feature)
2022-08-29 12:06:27 -07:00
Doug Gregor
0db7246c59
Merge pull request #60799 from DougGregor/generalize-actor-isolation
2022-08-26 13:03:00 -07:00
Pavel Yaskevich
bf2519aed9
[Sema] Allow implicit parameter decls to have property wrapper attributes
2022-08-26 12:25:22 -07:00
Doug Gregor
141ffc2b8d
Model isolated parameters in ActorIsolation.
...
A function can be actor instance-isolated to one of its parameters.
Make sure that this is reflected in ActorIsolation, so such a function
doesn't get a different actor isolation.
2022-08-23 23:19:46 -07:00
Slava Pestov
5c32f2136e
AST: Introduce RequirementKind::SameCount
2022-08-23 11:12:00 -04:00
Suyash Srijan
dd668d357c
[Concurrency] Handle actor isolation for defers in closures
2022-08-22 14:11:25 +01:00
Allan Shortlidge
40eb1422bb
IRGen/SIL: Fix IR linkage computation for inlined function references from modules imported @_weakLinked.
...
Include the parent `ModuleDecl` when serializing a `SILFunction` so that it is available on deserialized functions even though the full `DeclContext` is not present. With the parent module always available we can reliably compute whether the `SILFunction` comes from a module that was imported `@_weakLinked`.
Serialize the `DeclContext` member of `SILFunction` so that it can be used to look up the module that a function belongs to in order to compute weak import status.
Resolves rdar://98521248
2022-08-19 09:56:45 -07:00
Allan Shortlidge
f71a3232cf
IRGen: Use extern_weak linkage for Clang symbols from @_weakLinked imported modules.
...
rdar://96098097
2022-08-11 11:02:57 -07:00
Allan Shortlidge
bc5f13cb6b
AST: Accept @_weakLinked on import decls to force weak linkage of symbols from a module.
...
The effect of declaring an import `@_weakLinked` is to treat every declaration from the module as if it were declared with `@_weakLinked`. This is useful in environments where entire modules may not be present at runtime. Although it is already possible to instruct the linker to weakly link an entire dylib, a Swift attribute provides a way to declare intent in source code and also opens the door to diagnostics and other compiler behaviors that depend on knowing that all the module's symbols will be weakly linked.
rdar://96098097
2022-08-11 11:02:57 -07:00
Slava Pestov
87871d7347
AST: Rename getOpenedArchetypeSignature() to getOpenedExistentialSignature()
2022-08-10 23:44:36 -04:00
Slava Pestov
9d96ed940f
AST: Rename 'canonical wrt. generic signature' to 'reduced'
...
We had two notions of canonical types, one is the structural property
where it doesn't contain sugared types, the other one where it does
not contain reducible type parameters with respect to a generic
signature.
Rename the second one to a 'reduced type'.
2022-08-09 12:46:31 -04:00
Slava Pestov
30c99b573a
AST: Remove ExtensionDecl::alreadyBoundToNominal()
2022-08-05 12:45:00 -04:00
Pavel Yaskevich
5ee5a22cf1
[TypeChecker] NFC: Add a dedicated method to get outermost attached wrapper
...
The outermost wrapper is the one at index `0` in the wrapper list
but it's easy for humans to make a reverse assumption since outermost
is the back of the list. Let's add a dedicated method to reduce error
probability of the property wrapper APIs.
2022-08-04 17:30:02 -07:00
Hamish Knight
6e51841d14
[AST] Enforce that composeTuple drops parameter flags
...
Callers may either assert that the parameter flags
are empty, or ask for them to be dropped.
2022-08-02 13:56:31 +01:00
Allan Shortlidge
34012dbc68
Frontend: Rename -enable-ad-hoc-availability to -weak-link-at-target.
...
I am separating the concern of weakly linking symbols that are introduced at the deployment target from the concern of type checking this new type of potential unavailability.
Resolves rdar://97925900
2022-08-01 11:57:06 -07:00
Zoe Carver
bd003bcd7f
Merge pull request #59509 from zoecarver/frt-with-ref-counting
...
[cxx-interop] Add support for reference counting operations on foreign reference types.
2022-07-23 20:51:39 -07:00
Michael Gottesman
afd8accb75
[move-only] Add a move only request to lookup if a ValueDecl is a "move only type".
...
I also created a SILType::isMoveOnly() helper that returns true if a type is
a move only wrapped type or a first class move only type. The verifier check
that move only types aren't copied in canonical SIL was rewired to use that as well.
2022-07-21 15:33:17 -07:00
zoecarver
13b0a5bc37
[nfc] Clang format changes.
2022-07-21 17:34:36 -04:00
zoecarver
74d76e2888
[cxx-interop] Add diagnostics and validation for retain/release function; require all foreign reference types to provide retain release functions or be immortal.
2022-07-21 12:25:21 -04:00
zoecarver
c9f54e1417
[nfc] Rename CxxCustom -> Custom and fix comments based on review feedback.
2022-07-21 10:25:57 -04:00
zoecarver
4021082a55
[wip][cxx-interop] Support for custom reference counting operations.
2022-07-21 10:25:57 -04:00
Pavel Yaskevich
225341e3d2
[Decl] Start storing and serializing "unavailability" bit per condition
2022-07-20 13:26:43 -07:00
Anton Korobeynikov
6e2c4faa34
[AutoDiff] Lookup for custom derivatives in non-primary source files ( #58965 )
...
* Lookup for custom derivatives in non-primary source files after typecheck is finished for the primary source.
This registers all custom derivatives before autodiff transformations and makes them available to them.
Fully resolves #55170
2022-07-18 11:52:02 -07:00
Konrad `ktoso` Malawski
728c007fb9
[Distributed] Implement witnesses for sync or non-throw dist reqs
...
[Distributed] generic and inner test; without one edge case
[Distributed] fix distributed_thunk test; unsure about those extra hops, could remove later
[Distributed] Remove type pretending in getSILFunctionType; it is not needed
It seems our constant replacement in the earlier phases is enough, and
we don't need this trick at all.
[Distributed] Use thunk when calling cross-actor on DA protocols
2022-07-04 19:02:11 +09:00
swift-ci
9aa2de4137
Merge pull request #41083 from kavon/inconvenienced-actors
...
[SE-327] Remove need for `convenience` for delegating initializers of an actor.
2022-06-30 14:56:32 -07:00
Konrad `ktoso` Malawski
ef525424f6
Merge pull request #59700 from xedin/distributed-computed-properties-via-accessor-thunk
...
[Distributed] Implement distributed computed properties via special accessor
2022-06-30 16:04:36 +09:00
Pavel Yaskevich
8d9962e605
[Distributed] Allow requesting distributed thunks on AbstractStorageDecl
...
One step towards future distributed subscripts.
2022-06-29 14:49:10 -07:00
Pavel Yaskevich
e8987b4c3e
[Distributed] Add a new access strategy - DispatchToDistributedThunk
...
This strategy is used to dispatch accesses to 'distributed' computed
property to distributed thunk accessor instead of a regular getter
when access happen outside actor isolation context.
2022-06-29 14:49:10 -07:00
Pavel Yaskevich
fce3b856e3
[AST] Add new member access semantics - DistributedThunk
...
`DistributedThunk` is to be used while accessing 'distributed'
computed property outside of its actor context.
2022-06-29 14:49:10 -07:00
Pavel Yaskevich
5bdf94f346
[Distributed] Remove commented out code and print statements
2022-06-29 14:49:10 -07:00
Konrad `ktoso` Malawski
febfef97d4
[Distributed] Skeleton implementation of distributed computed properties
2022-06-29 14:49:04 -07:00
Allan Shortlidge
2515f7a58d
Frontend: Introduce the -enable-experimental-ad-hoc-availability flag.
...
When developing a module for an OS or SDK, one may use declarations from other modules that were recently introduced in the in-development OS. Those declarations will be annotated as available at the deployment target of the client module and yet the symbols for that declaration are not available in all development builds of that OS. If the module strongly links those symbols, it will crash on older development builds of the OS. The `-enable-experimental-ad-hoc-availability` flag is designed to give developers the option of weakly linking all symbols in other modules that were introduced at the deployment target.
This change introduces the basic change in linking behavior but does not address typechecking. Use of the declarations that are made unavailable in this mode will need to be diagnosed and developers will need a way to detect the unavailability at runtime before use.
Resolves rdar://96011550
2022-06-29 11:44:07 -07:00
Pavel Yaskevich
add41afc47
[AST] Teach computeNominalType about nested ObjC protocols
...
Objective-C protocols unlike their Swift counterparts could be
nested in other types, so `computeNominalType` has to fetch a
parent for such protocols (if any) just like importer does.
Resolves: rdar://95084142
2022-06-28 12:06:26 -07:00
Kavon Farvardin
25b69d1e6e
make sure all actor kinds, including distributed, are "semantically final"
2022-06-27 15:45:52 -07:00
Konrad `ktoso` Malawski
e78a7cbacb
[Decl] remove not used and bad-idea isIsolated function
2022-06-22 15:36:43 +09:00
Holly Borla
429488f6c9
[Sema] Use ExistentialType for Any and AnyObject.
2022-06-17 18:29:15 -07:00
Konrad `ktoso` Malawski
0caf03d63f
[Distributed] adjust test to pass with less accurate diagnostics; while we work on getting them back
2022-06-17 12:35:54 -07:00
Pavel Yaskevich
b963c6d20f
[Distributed] Remove commented out code and print statements
2022-06-17 12:12:16 -07:00
Konrad `ktoso` Malawski
5a5b7c007c
towards distributed getters
2022-06-17 12:12:16 -07:00
Konrad `ktoso` Malawski
079bbcf517
wip
2022-06-17 12:12:16 -07:00
Becca Royal-Gordon
102f9a30c2
[NFC] Add isKnownObjC param to RenamedDeclRequest
...
This will be used to break cycles in a future commit.
2022-06-16 14:06:47 -07:00
Doug Gregor
774a94f69d
Make sure we can dig out the (distributed) actor from an archetype.
...
Fixes #59356 / rdar://94976378.
2022-06-14 10:57:29 -07:00
Konrad `ktoso` Malawski
bd052eedd7
improve FIXME to link to issue
2022-06-10 13:41:37 +09:00
Anton Korobeynikov
a1e138b2af
[AutoDiff] Implement cross-file lookup of derivatives ( #58644 )
...
Look-up for functions with @derivative attributes defined in non-primary source files
Fixes #55170
2022-05-11 08:18:51 -07:00
Alex Hoppen
f5c0c9cb35
[CodeCompletion] Maintain LeaveClosureBodiesUnchecked when checking pattern binding
...
Before, we were dropping `LeaveClosureBodiesUnchecked` when checking a pattern binding request which caused missing completions inside variables initialized by closures.
rdar://92603748 [#58610 ]
2022-05-04 16:08:48 +02:00
Josh Soref
81d3ad76ac
Spelling ast ( #42463 )
...
* spelling: accessor
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: accommodates
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: argument
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: associated
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: availability
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: available
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: belongs
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: bookkeeping
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: building
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: clazz
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: clonable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: closure
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: concatenated
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: conformance
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: context
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: conversion
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: correspondence
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: declarations
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: declared
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: defining
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: delayed
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: dependency
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: deployed
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: descendants
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: diagnose
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: diagnostic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: equitable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: evaluation
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: exclusivity
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: existence
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: existential
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: explicit
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: expressed
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: for
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: foreign
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: function
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: identifier
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: implicit
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: indices
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: information
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: instance
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: interchangeable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: interface
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: introduced
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: invalid
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: kind-in
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: least
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: library
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: location
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: namespace
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: necessary
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: nonexistent
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: not
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: number
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: obtains
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: occurs
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: opaque
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: overridden
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: parameter
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: precede
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: preceding
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: property
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: protocol
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: qualified
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: recognized
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: recursively
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: references
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: relaxing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: represented
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: request
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: requirement
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: requirements
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: retrieve
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: returned
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: satisfied
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: satisfy
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: scanner
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: siblings
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: simplified
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: something
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: source
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: specializations
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: specially
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: statement
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: stripped
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: structure
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: substitution
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: the
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: transform
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: transformed
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: transitively
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: transparent
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: typecheck
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: unknown
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: unlabeled
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: unqualified
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: whether
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: with
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: scanner
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com >
2022-04-21 12:57:16 -07:00
Doug Gregor
4116d7a3d7
Rename the -strict-concurrency= options to be more descriptive.
...
The three options are now:
* `explicit`: Enforce Sendable constraints where it has been explicitly adopted and perform actor-isolation checking wherever code has adopted concurrency. (This is the default)
* `targeted`: Enforce Sendable constraints and perform actor-isolation checking wherever code has adopted concurrency, including code that has explicitly adopted Sendable.
* `complete`: Enforce Sendable constraints and actor-isolation checking throughout the entire module.
2022-04-20 18:17:33 -07:00
Doug Gregor
12a11e5416
Merge pull request #42445 from DougGregor/strict-concurrency-flag
2022-04-19 08:07:30 -07:00