Commit Graph

81 Commits

Author SHA1 Message Date
Anthony Latsis
bda6edb85c AST: Rename GenericContext::isGeneric to hasGenericParamList
`isGeneric` is a misleading name because this method checks for the
existence of a `GenericParamList`, which is not implied by genericity.
2025-11-11 15:55:16 +00:00
Hamish Knight
adb7aaa8cd [AST] NFC: Rename SpecialDistributedProperty -> SpecialDistributedActorProperty
Disambiguate from `distributed var`.
2025-11-04 13:54:34 +00:00
Hamish Knight
0f58eb2104 [Sema] Fix and cleanup distributed id/actorSystem synthesis (#85245) 2025-11-04 10:17:05 +09:00
Hamish Knight
6a0278c59f [Sema] NFC: Remove GetDistributedMethodWitnessedProtocolRequirements (#85274)
This has been unused for over a year now (since #71801), let's just
remove it.
2025-11-03 06:10:23 -08:00
Konrad Malawski
dd9dc0936b [Distributed] We're currently not using this isDistributedThunk func 2025-09-05 08:26:23 +09:00
Konrad Malawski
c1491c8022 [Concurrency/Distributed] nonisolated-nonsending by default breaks distributed thunks
the new NonisolatedNonsendingByDefault upcoming feature breaks remote
calls in distributed actors, because the expected isolation doesn't
match and the runtime swift_distributed_execute_target_resume will
crash.

This is a short term fix to unblock adopters, however preferably we
should mark the thunks as nonisolated(nonsending), though that seems to
be more involved.

resolves rdar://159247975
2025-08-28 21:53:41 +09:00
Slava Pestov
ec0dfc8716 AST: Add new form of SubstitutionMap::getProtocolSubstitutions() 2025-04-03 17:35:33 -04:00
Slava Pestov
00766f7deb AST: Remove type parameter from ProtocolConformanceRef::getTypeWitnessByName() 2025-04-03 17:35:32 -04:00
Konrad 'ktoso' Malawski
6ca5ace32d [Distributed] Harden detecting adhoc req methods, don't crash when missing protocol decls
This issue manifested in crashing when in Xcode one would do the Archive
workflow, and we would be missing the Distributed module types and
proceed to run into a nullpointer when faced with code like this:

```
public class TestViewModel {
    public init() {}

    public func onReturn() {
        print("on return executed!")
    }
}
```

where the name matched one of the ad hoc requirements, but we'd get null
for the protocol lookup since this does not import the distributed
module.

resolves rdar://148327936
2025-04-02 18:44:31 +09:00
Anthony Latsis
a84dfc8387 [Gardening] Fix some set but not used variables 2025-01-30 21:34:38 +00:00
Slava Pestov
8d05362f89 AST: Simplify some lookupConformance() callers 2024-11-16 16:16:06 -05:00
Slava Pestov
375363a473 AST: Move global conformance lookup entry points to ConformanceLookup.h 2024-08-08 23:35:58 -04:00
Konrad `ktoso` Malawski
e53cd7d079 [Distributed] Handle #isolation param in DA as known to not cross isolation (#75327)
The isolation checker was assuming that one can only be isolated to a
specific var, but that's not true for distributed actors -- because the
default parameter emitted by #isolation is a method call -- converting
the self into an any Actor.

We must handle this in isolation checker in order to avoid thinking
we're crossing isolation boundaries and making methods implicitly async
etc, when we're actually not.

resolves rdar://131874709
2024-07-19 09:47:24 +09:00
Slava Pestov
86d567f95a AST: ModuleDecl::lookupConformance() is a static method 2024-07-06 12:05:47 -04: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
Konrad `ktoso` Malawski
168bc7b454 [Concurrency] Fix how we obtain DA-as-A conformance for cross module
Resolves rdar://127206143
2024-05-28 13:37:21 +09:00
Konrad `ktoso` Malawski
6132386371 [Distributed] Complete handling of protocol calls and witnesses using adjusted mangling scheme (#72416) 2024-03-23 23:54:23 +09:00
Konrad `ktoso` Malawski
143d8f9801 [Distributed] Handle distributed thunk requirements/witnesses (#72151)
Co-authored-by: Pavel Yaskevich <pyaskevich@apple.com>
2024-03-11 02:07:22 -07:00
Konrad `ktoso` Malawski
3f1ccd0fd5 Improve test to confirm round-trip compilation from module or swiftinterface 2024-03-08 21:23:00 +09:00
Konrad `ktoso` Malawski
b7ff16baf7 [Distributed] Only synthesize Codable for DA where the ID is Codable (#72081) 2024-03-07 22:40:00 -08:00
Pavel Yaskevich
1da0164692 [AST] Distributed: Simplify handling of SerializationRequirement expressed through a conformance constraint 2024-03-06 15:03:43 -08:00
Pavel Yaskevich
7b7716cda9 [AST/Sema] Distributed: Introduced unified way to retrieve serialization requirements for actors 2024-03-06 13:51:14 -08:00
Pavel Yaskevich
35478a6f21 [AST] Distributed: De-duplicate methods that retrieve types from distributed system 2024-03-06 13:51:14 -08:00
Pavel Yaskevich
53c9049b99 [AST] NFC: Move distributed actor methods from ASTContext into swift namespace 2024-03-06 13:51:14 -08:00
Pavel Yaskevich
4c15c890f9 [AST/Sema] Distributed: Simplify getAssociatedTypeOfDistributedSystemOfActor 2024-03-06 13:51:14 -08:00
Konrad `ktoso` Malawski
c56a1e8be7 [Distributed] Handle mangling thunks in extensions with generic AS and $Stubs (#71914) 2024-02-29 04:22:00 -08:00
Pavel Yaskevich
f9ec3b1d7e Merge pull request #71796 from xedin/make-dist-new-requirements-conditionally-available
[Distributed] Make new protocol requirements conditionally available
2024-02-22 15:18:52 -08:00
Konrad `ktoso` Malawski
1d44e2e8e0 [Distributed] Undo new record and mangling scheme for dist.p.witnesses (#71801) 2024-02-22 23:02:29 +09:00
Pavel Yaskevich
39b81ac783 [AST] Handle generic actor system when trying to produce a ref to decodeNextArgument 2024-02-21 13:29:47 -08:00
Konrad `ktoso` Malawski
e9c7f3c382 [Distributed] Target identifiers for protocol calls (#70928) 2024-02-16 07:19:20 -08:00
Pavel Yaskevich
0cc26cf490 [AST] Distributed: Make sure that prospective remoteCall declaration is in type context 2024-02-12 14:26:30 -08:00
Slava Pestov
4a46717325 Distributed: Fixes for non-copyable generics 2024-01-31 21:55:52 -05:00
Konrad `ktoso` Malawski
1219d4b8a4 [Distributed] Remove redundant isa check in getting SR 2023-11-16 11:48:17 +09:00
Konrad `ktoso` Malawski
cd23ddad85 [Distributed] Another fix for getting required protocols for SR 2023-11-15 08:16:54 +09:00
Konrad `ktoso` Malawski
0f5e564bbf handle conformance requirement on extension in distributed funcs 2023-11-14 22:06:35 +09:00
Konrad `ktoso` Malawski
436ecb240b Use more of getConcreteReplacementForMemberSerializationRequirement 2023-11-14 20:57:34 +09:00
Slava Pestov
f91b12bd0e Distributed: Simplify extractDistributedSerializationRequirements() 2023-11-14 20:57:34 +09:00
Slava Pestov
4c22395d94 Distributed: Remove flattenDistributedSerializationTypeToRequiredProtocols() 2023-11-14 20:57:34 +09:00
Slava Pestov
cbde18680f Distributed: Some cleanups 2023-11-14 20:57:34 +09:00
Konrad `ktoso` Malawski
30653a8091 [Distributed] Don't crash in thunk generation when missing SR conformance 2023-11-14 20:57:33 +09:00
Slava Pestov
19b3d0997f Distributed: Simplify extractDistributedSerializationRequirements() 2023-11-10 10:33:57 -05:00
Slava Pestov
31f922ae5c Distributed: Remove flattenDistributedSerializationTypeToRequiredProtocols() 2023-11-10 10:33:57 -05:00
Slava Pestov
bacabc1cd6 Distributed: Some cleanups 2023-11-10 10:33:57 -05:00
Slava Pestov
5c4c65b569 Distributed: Remove unnecessary unwrapping of TypeAliasType 2023-10-30 23:18:15 -04:00
Doug Gregor
9292231e1f [Macros] Start recording expanded macro definitions and replacements
Handle a trivial macro defined in terms of another macro.
2023-03-29 16:32:28 -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
d68961d407 [Distributed] Synthesize thunks for distributed computed properties 2022-06-29 14:49:10 -07:00
Konrad `ktoso` Malawski
22b20afce6 [Distributed] make witness be the distributed thunk 2022-06-27 17:08:55 +09:00
Konrad `ktoso` Malawski
6a2778645f Revert "Merge pull request #59481 from xedin/distributed-computed-properties"
This reverts commit 8125a85a8f, reversing
changes made to 728971c5b7.
2022-06-25 08:49:00 +09:00