File tree Expand file tree Collapse file tree 5 files changed +30
-1
lines changed Expand file tree Collapse file tree 5 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -6902,6 +6902,9 @@ class ParamDecl : public VarDecl {
6902
6902
6903
6903
// / Whether or not this parameter is 'sending'.
6904
6904
IsSending = 1 << 4 ,
6905
+
6906
+ // / Whether or not this parameter is isolated to a caller.
6907
+ IsCallerIsolated = 1 << 5 ,
6905
6908
};
6906
6909
6907
6910
// / The type repr and 3 bits used for flags.
@@ -7190,6 +7193,18 @@ class ParamDecl : public VarDecl {
7190
7193
removeFlag (Flag::IsSending);
7191
7194
}
7192
7195
7196
+ // / Whether or not this parameter is marked with 'nonisolated(nonsending)'.
7197
+ bool isCallerIsolated () const {
7198
+ return getOptions ().contains (Flag::IsCallerIsolated);
7199
+ }
7200
+
7201
+ void setCallerIsolated (bool value = true ) {
7202
+ if (value)
7203
+ addFlag (Flag::IsCallerIsolated);
7204
+ else
7205
+ removeFlag (Flag::IsCallerIsolated);
7206
+ }
7207
+
7193
7208
// / Whether or not this parameter is marked with '@_addressable'.
7194
7209
bool isAddressable () const {
7195
7210
return getOptions ().contains (Flag::IsAddressable);
Original file line number Diff line number Diff line change @@ -8940,6 +8940,12 @@ void ParamDecl::setTypeRepr(TypeRepr *repr) {
8940
8940
continue ;
8941
8941
}
8942
8942
8943
+ if (auto *callerIsolated =
8944
+ dyn_cast<CallerIsolatedTypeRepr>(unwrappedType)) {
8945
+ setCallerIsolated (true );
8946
+ unwrappedType = callerIsolated->getBase ();
8947
+ }
8948
+
8943
8949
break ;
8944
8950
}
8945
8951
}
@@ -11025,6 +11031,9 @@ AccessorDecl *AccessorDecl::createParsed(
11025
11031
if (subscriptParam->isSending ())
11026
11032
param->setSending ();
11027
11033
11034
+ if (subscriptParam->isCallerIsolated ())
11035
+ param->setCallerIsolated ();
11036
+
11028
11037
newParams.push_back (param);
11029
11038
}
11030
11039
Original file line number Diff line number Diff line change @@ -4110,6 +4110,7 @@ class DeclDeserializer {
4110
4110
bool isIsolated;
4111
4111
bool isCompileTimeLiteral, isConstValue;
4112
4112
bool isSending;
4113
+ bool isCallerIsolated;
4113
4114
uint8_t rawDefaultArg;
4114
4115
TypeID defaultExprType;
4115
4116
uint8_t rawDefaultArgIsolation;
@@ -4122,6 +4123,7 @@ class DeclDeserializer {
4122
4123
isCompileTimeLiteral,
4123
4124
isConstValue,
4124
4125
isSending,
4126
+ isCallerIsolated,
4125
4127
rawDefaultArg,
4126
4128
defaultExprType,
4127
4129
rawDefaultArgIsolation,
@@ -4167,6 +4169,7 @@ class DeclDeserializer {
4167
4169
param->setCompileTimeLiteral (isCompileTimeLiteral);
4168
4170
param->setConstValue (isConstValue);
4169
4171
param->setSending (isSending);
4172
+ param->setCallerIsolated (isCallerIsolated);
4170
4173
4171
4174
// Decode the default argument kind.
4172
4175
// FIXME: Default argument expression, if available.
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
58
58
// / describe what change you made. The content of this comment isn't important;
59
59
// / it just ensures a conflict if two people change the module format.
60
60
// / Don't worry about adhering to the 80-column limit for this line.
61
- const uint16_t SWIFTMODULE_VERSION_MINOR = 941 ; // remove @execution attr
61
+ const uint16_t SWIFTMODULE_VERSION_MINOR = 942 ; // `isCallerIsolated` parameter flag
62
62
63
63
// / A standard hash seed used for all string hashes in a serialized module.
64
64
// /
@@ -1728,6 +1728,7 @@ namespace decls_block {
1728
1728
BCFixed<1 >, // isCompileTimeLiteral?
1729
1729
BCFixed<1 >, // isConst?
1730
1730
BCFixed<1 >, // isSending?
1731
+ BCFixed<1 >, // isCallerIsolated?
1731
1732
DefaultArgumentField, // default argument kind
1732
1733
TypeIDField, // default argument type
1733
1734
ActorIsolationField, // default argument isolation
Original file line number Diff line number Diff line change @@ -4745,6 +4745,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
4745
4745
param->isCompileTimeLiteral (),
4746
4746
param->isConstVal (),
4747
4747
param->isSending (),
4748
+ param->isCallerIsolated (),
4748
4749
getRawStableDefaultArgumentKind (argKind),
4749
4750
S.addTypeRef (defaultExprType),
4750
4751
getRawStableActorIsolationKind (isolation.getKind ()),
You can’t perform that action at this time.
0 commit comments