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 @@ -6911,6 +6911,9 @@ class ParamDecl : public VarDecl {
6911
6911
6912
6912
// / Whether or not this parameter is 'sending'.
6913
6913
IsSending = 1 << 4 ,
6914
+
6915
+ // / Whether or not this parameter is isolated to a caller.
6916
+ IsCallerIsolated = 1 << 5 ,
6914
6917
};
6915
6918
6916
6919
// / The type repr and 3 bits used for flags.
@@ -7199,6 +7202,18 @@ class ParamDecl : public VarDecl {
7199
7202
removeFlag (Flag::IsSending);
7200
7203
}
7201
7204
7205
+ // / Whether or not this parameter is marked with 'nonisolated(nonsending)'.
7206
+ bool isCallerIsolated () const {
7207
+ return getOptions ().contains (Flag::IsCallerIsolated);
7208
+ }
7209
+
7210
+ void setCallerIsolated (bool value = true ) {
7211
+ if (value)
7212
+ addFlag (Flag::IsCallerIsolated);
7213
+ else
7214
+ removeFlag (Flag::IsCallerIsolated);
7215
+ }
7216
+
7202
7217
// / Whether or not this parameter is marked with '@_addressable'.
7203
7218
bool isAddressable () const {
7204
7219
return getOptions ().contains (Flag::IsAddressable);
Original file line number Diff line number Diff line change @@ -9010,6 +9010,12 @@ void ParamDecl::setTypeRepr(TypeRepr *repr) {
9010
9010
continue ;
9011
9011
}
9012
9012
9013
+ if (auto *callerIsolated =
9014
+ dyn_cast<CallerIsolatedTypeRepr>(unwrappedType)) {
9015
+ setCallerIsolated (true );
9016
+ unwrappedType = callerIsolated->getBase ();
9017
+ }
9018
+
9013
9019
break ;
9014
9020
}
9015
9021
}
@@ -11095,6 +11101,9 @@ AccessorDecl *AccessorDecl::createParsed(
11095
11101
if (subscriptParam->isSending ())
11096
11102
param->setSending ();
11097
11103
11104
+ if (subscriptParam->isCallerIsolated ())
11105
+ param->setCallerIsolated ();
11106
+
11098
11107
newParams.push_back (param);
11099
11108
}
11100
11109
Original file line number Diff line number Diff line change @@ -4117,6 +4117,7 @@ class DeclDeserializer {
4117
4117
bool isIsolated;
4118
4118
bool isCompileTimeLiteral, isConstValue;
4119
4119
bool isSending;
4120
+ bool isCallerIsolated;
4120
4121
uint8_t rawDefaultArg;
4121
4122
TypeID defaultExprType;
4122
4123
uint8_t rawDefaultArgIsolation;
@@ -4129,6 +4130,7 @@ class DeclDeserializer {
4129
4130
isCompileTimeLiteral,
4130
4131
isConstValue,
4131
4132
isSending,
4133
+ isCallerIsolated,
4132
4134
rawDefaultArg,
4133
4135
defaultExprType,
4134
4136
rawDefaultArgIsolation,
@@ -4174,6 +4176,7 @@ class DeclDeserializer {
4174
4176
param->setCompileTimeLiteral (isCompileTimeLiteral);
4175
4177
param->setConstValue (isConstValue);
4176
4178
param->setSending (isSending);
4179
+ param->setCallerIsolated (isCallerIsolated);
4177
4180
4178
4181
// Decode the default argument kind.
4179
4182
// 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 = 937 ; // remove @execution attr
61
+ const uint16_t SWIFTMODULE_VERSION_MINOR = 938 ; // `isCallerIsolated` parameter flag
62
62
63
63
// / A standard hash seed used for all string hashes in a serialized module.
64
64
// /
@@ -1733,6 +1733,7 @@ namespace decls_block {
1733
1733
BCFixed<1 >, // isCompileTimeLiteral?
1734
1734
BCFixed<1 >, // isConst?
1735
1735
BCFixed<1 >, // isSending?
1736
+ BCFixed<1 >, // isCallerIsolated?
1736
1737
DefaultArgumentField, // default argument kind
1737
1738
TypeIDField, // default argument type
1738
1739
ActorIsolationField, // default argument isolation
Original file line number Diff line number Diff line change @@ -4750,6 +4750,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
4750
4750
param->isCompileTimeLiteral (),
4751
4751
param->isConstVal (),
4752
4752
param->isSending (),
4753
+ param->isCallerIsolated (),
4753
4754
getRawStableDefaultArgumentKind (argKind),
4754
4755
S.addTypeRef (defaultExprType),
4755
4756
getRawStableActorIsolationKind (isolation.getKind ()),
You can’t perform that action at this time.
0 commit comments