Skip to content

Commit a62b090

Browse files
committed
fix deinit sil test
1 parent 3b36e26 commit a62b090

17 files changed

+320
-214
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3312,7 +3312,6 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33123312
/// Find, or potentially synthesize, the implicit 'id' property of this actor.
33133313
ValueDecl *getDistributedActorIDProperty() const;
33143314

3315-
33163315
/// Collect the set of protocols to which this type should implicitly
33173316
/// conform, such as AnyObject (for classes).
33183317
void getImplicitProtocols(SmallVectorImpl<ProtocolDecl *> &protocols);

include/swift/AST/KnownIdentifiers.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,6 @@ IDENTIFIER(resolve)
268268
IDENTIFIER(system)
269269
IDENTIFIER(ID)
270270
IDENTIFIER(id)
271-
//IDENTIFIER(identity) // TODO(distributed): remove
272-
//IDENTIFIER(identifier)
273271
IDENTIFIER(Invocation)
274272
IDENTIFIER(_distributedActorRemoteInitialize)
275273
IDENTIFIER(_distributedActorDestroy)

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
872872

873873
/// Assert that two types are equal.
874874
void requireSameType(SILType type1, SILType type2, const Twine &complaint) {
875-
_require(type1 == type2, complaint, // FIXME(distributed): REMOVE THIS !!!!! fprintf(stderr, "[
876-
[&] { llvm::dbgs() << " got: " << type1 << "\n expected: " << type2 << '\n'; });
875+
_require(type1 == type2, complaint,
876+
[&] { llvm::dbgs() << " " << type1 << "\n " << type2 << '\n'; });
877877
}
878878

879879
/// Require two function types to be ABI-compatible.

lib/SILGen/SILGenDistributed.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void emitDistributedIfRemoteBranch(SILGenFunction &SGF,
126126
// MARK: local instance initialization
127127

128128
/// For the initialization of a local distributed actor instance, emits code to initialize the instance's
129-
/// stored property corresponding to the transport.
129+
/// stored property corresponding to the system.
130130
static void emitTransportInit(SILGenFunction &SGF,
131131
ConstructorDecl *ctor,
132132
SILLocation loc,
@@ -148,7 +148,7 @@ static void emitTransportInit(SILGenFunction &SGF,
148148
///
149149
/// Specifically, it performs:
150150
/// \verbatim
151-
/// self.id = transport.assignID(Self.self)
151+
/// self.id = system.assignID(Self.self)
152152
/// \endverbatim
153153
static void emitIdentityInit(SILGenFunction &SGF, ConstructorDecl *ctor,
154154
SILLocation loc, ManagedValue borrowedSelfArg) {
@@ -259,7 +259,7 @@ static void createDistributedActorFactory_resolve(
259259
auto loc = SILLocation(fd);
260260
loc.markAutoGenerated();
261261

262-
// // ---- actually call transport.resolve(id: id, as: Self.self)
262+
// // ---- actually call system.resolve(id: id, as: Self.self)
263263
emitDistributedActorSystemWitnessCall(
264264
B, loc, C.Id_resolve, actorSystemValue, SGF.getLoweredType(selfTy),
265265
{idValue, selfMetatypeValue },
@@ -316,7 +316,7 @@ void SILGenFunction::emitDistributedActorFactory(FuncDecl *fd) { // TODO(distrib
316316

317317
auto optionalReturnTy = SILType::getOptionalType(returnTy);
318318

319-
// ==== Call `try transport.resolve(id: id, as: Self.self)`
319+
// ==== Call `try system.resolve(id: id, as: Self.self)`
320320
{
321321
createDistributedActorFactory_resolve(
322322
*this, C, fd, idArg, actorSystemArg, selfTy, selfMetatypeValue,
@@ -399,7 +399,7 @@ void SILGenFunction::emitDistributedActorFactory(FuncDecl *fd) { // TODO(distrib
399399
}
400400
}
401401

402-
// MARK: transport.resignID()
402+
// MARK: system.resignID()
403403

404404
void SILGenFunction::emitResignIDCall(SILLocation loc,
405405
ClassDecl *actorDecl,
@@ -435,8 +435,8 @@ SILGenFunction::emitConditionalResignIdentityCall(SILLocation loc,
435435

436436
auto selfTy = actorDecl->getDeclaredInterfaceType();
437437

438-
// we only transport.resignID if we are a local actor,
439-
// and thus the address was created by transport.assignID.
438+
// we only system.resignID if we are a local actor,
439+
// and thus the address was created by system.assignID.
440440
auto isRemoteBB = createBasicBlock();
441441
auto isLocalBB = createBasicBlock();
442442

lib/SILGen/SILGenFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
20332033
/// Specifically, this code emits SIL that performs the call
20342034
///
20352035
/// \verbatim
2036-
/// self.transport.resignID(self.id)
2036+
/// self.system.resignID(self.id)
20372037
/// \endverbatim
20382038
///
20392039
/// using the current builder's state as the injection point.

stdlib/public/Distributed/DistributedActorSystem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public protocol DistributedActorSystem: Sendable {
6262
///
6363
/// The address MUST uniquely identify the actor, and allow resolving it.
6464
/// E.g. if an actor is created under address `addr1` then immediately invoking
65-
/// `transport.resolve(id: addr1, as: Greeter.self)` MUST return a reference
65+
/// `system.resolve(id: addr1, as: Greeter.self)` MUST return a reference
6666
/// to the same actor.
6767
func assignID<Act>(_ actorType: Act.Type) -> ActorID
6868
where Act: DistributedActor,
@@ -280,7 +280,7 @@ public struct RemoteCallTarget {
280280
///
281281
/// ## Decoding an invocation
282282
/// Since every actor system is going to deal with a concrete invocation type, they may
283-
/// implement decoding them whichever way is most optimal for the given transport.
283+
/// implement decoding them whichever way is most optimal for the given system.
284284
///
285285
/// Once decided, the invocation must be passed to `executeDistributedTarget`
286286
/// which will decode the substitutions, argument values, return and error types (in that order).

test/Distributed/Inputs/FakeDistributedActorSystems.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ public struct FakeActorSystem: DistributedActorSystem {
4040
public typealias Invocation = FakeInvocation
4141
public typealias SerializationRequirement = Codable
4242

43+
// just so that the struct does not get optimized away entirely
44+
let someValue: String = ""
45+
let someValue2: String = ""
46+
let someValue3: String = ""
47+
let someValue4: String = ""
48+
4349
init() {
4450
print("Initialized new FakeActorSystem")
4551
}

test/Distributed/SIL/distributed_actor_default_deinit_sil.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/../Inputs/FakeDistributedActorSystems.swift
3-
// RUN: %target-swift-frontend -module-name default_deinit -primary-file %s -emit-sil -enable-experimental-distributed -disable-availability-checking -I %t | %FileCheck %s --enable-var-scope --dump-input=always
3+
// RUN: %target-swift-frontend -module-name default_deinit -primary-file %s -emit-sil -enable-experimental-distributed -disable-availability-checking -I %t | %FileCheck %s --enable-var-scope --color
44
// REQUIRES: concurrency
55
// REQUIRES: distributed
66

@@ -9,7 +9,7 @@ import FakeDistributedActorSystems
99

1010
typealias DefaultDistributedActorSystem = FakeActorSystem
1111

12-
class SomeClass {}
12+
final class SomeClass: Sendable {}
1313

1414
distributed actor MyDistActor {
1515
let localOnlyField: SomeClass
@@ -39,7 +39,7 @@ distributed actor MyDistActor {
3939
// CHECK: [[SYS_REF:%[0-9]+]] = ref_element_addr [[SELF]] : $MyDistActor, #MyDistActor.actorSystem
4040
// CHECK: [[ID_LOAD:%[0-9]+]] = load [[ID_REF]] : $*ActorAddress
4141
// CHECK: [[SYS_LOAD:%[0-9]+]] = load [[SYS_REF]] : $*FakeActorSystem
42-
// CHECK: [[RESIGN:%[0-9]+]] = function_ref @$s16FakeDistributedActorSystems0aB6SystemV8resignIDyyAA0B7AddressVF : $@convention(method) (@guaranteed ActorAddress, FakeActorSystem) -> ()
42+
// CHECK: [[RESIGN:%[0-9]+]] = function_ref @$s27FakeDistributedActorSystems0aC6SystemV8resignIDyyAA0C7AddressVF : $@convention(method) (@guaranteed ActorAddress, @guaranteed FakeActorSystem) -> ()
4343
// CHECK: apply [[RESIGN]]([[ID_LOAD]], [[SYS_LOAD]])
4444
// CHECK: br [[CONTINUE:bb[0-9]+]]
4545

test/Distributed/SIL/distributed_actor_default_init_sil.swift

Lines changed: 0 additions & 193 deletions
This file was deleted.

0 commit comments

Comments
 (0)