@@ -541,100 +541,3 @@ void SILGenFunction::emitDistributedActorSystemResignIDCall(
541
541
SILType (),
542
542
{ idRef });
543
543
}
544
-
545
- void
546
- SILGenFunction::emitConditionalResignIdentityCall (SILLocation loc,
547
- ClassDecl *actorDecl,
548
- ManagedValue actorSelf,
549
- SILBasicBlock *continueBB,
550
- SILBasicBlock *finishBB) {
551
- assert (actorDecl->isDistributedActor () &&
552
- " only distributed actors have actorSystem lifecycle hooks in deinit" );
553
- assert (continueBB && finishBB &&
554
- " need valid continue and finish basic blocks" );
555
-
556
- auto selfTy = F.mapTypeIntoContext (actorDecl->getDeclaredInterfaceType ());
557
-
558
- // we only system.resignID if we are a local actor,
559
- // and thus the address was created by system.assignID.
560
- auto isRemoteBB = createBasicBlock (" isRemoteBB" );
561
- auto isLocalBB = createBasicBlock (" isLocalBB" );
562
-
563
- // if __isRemoteActor(self) {
564
- // ...
565
- // } else {
566
- // ...
567
- // }
568
- emitDistributedIfRemoteBranch (loc,
569
- actorSelf, selfTy,
570
- /* if remote*/ isRemoteBB,
571
- /* if local*/ isLocalBB);
572
-
573
- // if remote, return early; the user defined deinit should not run.
574
- {
575
- B.emitBlock (isRemoteBB);
576
- B.createBranch (loc, finishBB);
577
- }
578
-
579
- // if local, resign identity.
580
- {
581
- B.emitBlock (isLocalBB);
582
-
583
- emitDistributedActorSystemResignIDCall (loc, actorDecl, actorSelf);
584
-
585
- B.createBranch (loc, continueBB);
586
- }
587
- }
588
-
589
- /* *****************************************************************************/
590
- /* ****************** DISTRIBUTED DEINIT: class memberwise destruction *********/
591
- /* *****************************************************************************/
592
-
593
- void SILGenFunction::emitDistributedActorClassMemberDestruction (
594
- SILLocation cleanupLoc, ManagedValue selfValue, ClassDecl *cd,
595
- SILBasicBlock *normalMemberDestroyBB,
596
- SILBasicBlock *remoteMemberDestroyBB,
597
- SILBasicBlock *finishBB) {
598
- auto selfTy = cd->getDeclaredInterfaceType ();
599
-
600
- Scope scope (Cleanups, CleanupLocation (cleanupLoc));
601
-
602
- auto isLocalBB = createBasicBlock (" isLocalBB" );
603
-
604
- // if __isRemoteActor(self) {
605
- // ...
606
- // } else {
607
- // ...
608
- // }
609
- emitDistributedIfRemoteBranch (cleanupLoc,
610
- selfValue, selfTy,
611
- /* if remote*/ remoteMemberDestroyBB,
612
- /* if local*/ isLocalBB);
613
-
614
- // // if __isRemoteActor(self)
615
- // {
616
- // // destroy only self.id and self.actorSystem
617
- // }
618
- {
619
- B.emitBlock (remoteMemberDestroyBB);
620
-
621
- for (VarDecl *vd : cd->getStoredProperties ()) {
622
- if (getActorIsolation (vd) == ActorIsolation::ActorInstance)
623
- continue ;
624
-
625
- destroyClassMember (cleanupLoc, selfValue, vd);
626
- }
627
-
628
- B.createBranch (cleanupLoc, finishBB);
629
- }
630
-
631
- // // else (local distributed actor)
632
- // {
633
- // <continue normal deinit>
634
- // }
635
- {
636
- B.emitBlock (isLocalBB);
637
-
638
- B.createBranch (cleanupLoc, normalMemberDestroyBB);
639
- }
640
- }
0 commit comments