File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -1827,21 +1827,6 @@ class PartitionOpTranslator {
1827
1827
}
1828
1828
1829
1829
void translateNonIsolationCrossingSILApply (FullApplySite fas) {
1830
- SILIsolationInfo isolationInfo;
1831
-
1832
- // If self is an actor and we are isolated to it, propagate actor self.
1833
- if (fas.hasSelfArgument ()) {
1834
- auto &self = fas.getSelfArgumentOperand ();
1835
- if (fas.getArgumentParameterInfo (self).hasOption (
1836
- SILParameterInfo::Isolated)) {
1837
- if (auto *nomDecl =
1838
- self.get ()->getType ().getNominalOrBoundGenericNominal ()) {
1839
- // First try to see if this nom decl is isolated to an actor.
1840
- isolationInfo = SILIsolationInfo::getActorIsolated (nomDecl);
1841
- }
1842
- }
1843
- }
1844
-
1845
1830
// For non-self parameters, gather all of the transferring parameters and
1846
1831
// gather our non-transferring parameters.
1847
1832
SmallVector<SILValue, 8 > nonTransferringParameters;
@@ -1883,6 +1868,7 @@ class PartitionOpTranslator {
1883
1868
getApplyResults (*fas, applyResults);
1884
1869
1885
1870
auto type = fas.getSubstCalleeSILType ().castTo <SILFunctionType>();
1871
+ auto isolationInfo = SILIsolationInfo::get (*fas);
1886
1872
1887
1873
// If our result is not transferring, just do the normal multi-assign.
1888
1874
if (!type->hasTransferringResult ()) {
Original file line number Diff line number Diff line change @@ -48,6 +48,19 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) {
48
48
if (auto fas = FullApplySite::isa (inst)) {
49
49
if (auto crossing = fas.getIsolationCrossing ())
50
50
return SILIsolationInfo::getActorIsolated (crossing->getCalleeIsolation ());
51
+
52
+ if (fas.hasSelfArgument ()) {
53
+ auto &self = fas.getSelfArgumentOperand ();
54
+ if (fas.getArgumentParameterInfo (self).hasOption (
55
+ SILParameterInfo::Isolated)) {
56
+ if (auto *nomDecl =
57
+ self.get ()->getType ().getNominalOrBoundGenericNominal ()) {
58
+ // TODO: We should be doing this off of the instance... what if we
59
+ // have two instances of the same class?
60
+ return SILIsolationInfo::getActorIsolated (nomDecl);
61
+ }
62
+ }
63
+ }
51
64
}
52
65
53
66
if (auto *pai = dyn_cast<PartialApplyInst>(inst)) {
You can’t perform that action at this time.
0 commit comments