@@ -995,7 +995,7 @@ class Partition {
995
995
}
996
996
};
997
997
998
- class ValueIsolationRegionInfo {
998
+ class IsolationRegionInfo {
999
999
public:
1000
1000
// / The lattice is:
1001
1001
// /
@@ -1022,17 +1022,15 @@ class ValueIsolationRegionInfo {
1022
1022
> data;
1023
1023
// clang-format on
1024
1024
1025
- ValueIsolationRegionInfo (Kind kind,
1026
- std::optional<ActorIsolation> actorIsolation)
1025
+ IsolationRegionInfo (Kind kind, std::optional<ActorIsolation> actorIsolation)
1027
1026
: kind(kind), data(actorIsolation) {}
1028
- ValueIsolationRegionInfo (Kind kind, NominalTypeDecl *decl)
1027
+ IsolationRegionInfo (Kind kind, NominalTypeDecl *decl)
1029
1028
: kind(kind), data(decl) {}
1030
1029
1031
- ValueIsolationRegionInfo (Kind kind, SILValue value)
1032
- : kind(kind), data(value) {}
1030
+ IsolationRegionInfo (Kind kind, SILValue value) : kind(kind), data(value) {}
1033
1031
1034
1032
public:
1035
- ValueIsolationRegionInfo () : kind(Kind::Unknown), data() {}
1033
+ IsolationRegionInfo () : kind(Kind::Unknown), data() {}
1036
1034
1037
1035
operator bool () const { return kind != Kind::Unknown; }
1038
1036
@@ -1122,8 +1120,7 @@ class ValueIsolationRegionInfo {
1122
1120
return nullptr ;
1123
1121
}
1124
1122
1125
- [[nodiscard]] ValueIsolationRegionInfo
1126
- merge (ValueIsolationRegionInfo other) const {
1123
+ [[nodiscard]] IsolationRegionInfo merge (IsolationRegionInfo other) const {
1127
1124
// If we are greater than the other kind, then we are further along the
1128
1125
// lattice. We ignore the change.
1129
1126
if (unsigned (other.kind ) < unsigned (kind))
@@ -1147,22 +1144,21 @@ class ValueIsolationRegionInfo {
1147
1144
return other;
1148
1145
}
1149
1146
1150
- ValueIsolationRegionInfo withActorIsolated (ActorIsolation isolation) {
1151
- return ValueIsolationRegionInfo ::getActorIsolated (isolation);
1147
+ IsolationRegionInfo withActorIsolated (ActorIsolation isolation) {
1148
+ return IsolationRegionInfo ::getActorIsolated (isolation);
1152
1149
}
1153
1150
1154
- static ValueIsolationRegionInfo getDisconnected () {
1151
+ static IsolationRegionInfo getDisconnected () {
1155
1152
return {Kind::Disconnected, {}};
1156
1153
}
1157
1154
1158
- static ValueIsolationRegionInfo
1159
- getActorIsolated (ActorIsolation actorIsolation) {
1155
+ static IsolationRegionInfo getActorIsolated (ActorIsolation actorIsolation) {
1160
1156
return {Kind::Actor, actorIsolation};
1161
1157
}
1162
1158
1163
1159
// / Sometimes we may have something that is actor isolated or that comes from
1164
1160
// / a type. First try getActorIsolation and otherwise, just use the type.
1165
- static ValueIsolationRegionInfo getActorIsolated (NominalTypeDecl *nomDecl) {
1161
+ static IsolationRegionInfo getActorIsolated (NominalTypeDecl *nomDecl) {
1166
1162
auto actorIsolation = swift::getActorIsolation (nomDecl);
1167
1163
if (actorIsolation.isActorIsolated ())
1168
1164
return getActorIsolated (actorIsolation);
@@ -1171,7 +1167,7 @@ class ValueIsolationRegionInfo {
1171
1167
return {};
1172
1168
}
1173
1169
1174
- static ValueIsolationRegionInfo getTaskIsolated (SILValue value) {
1170
+ static IsolationRegionInfo getTaskIsolated (SILValue value) {
1175
1171
return {Kind::Task, value};
1176
1172
}
1177
1173
};
@@ -1218,14 +1214,14 @@ struct PartitionOpEvaluator {
1218
1214
// / Call handleTransferNonTransferrable on our CRTP subclass.
1219
1215
void handleTransferNonTransferrable (
1220
1216
const PartitionOp &op, Element elt,
1221
- ValueIsolationRegionInfo isolationRegionInfo) const {
1217
+ IsolationRegionInfo isolationRegionInfo) const {
1222
1218
return asImpl ().handleTransferNonTransferrable (op, elt,
1223
1219
isolationRegionInfo);
1224
1220
}
1225
1221
// / Just call our CRTP subclass.
1226
1222
void handleTransferNonTransferrable (
1227
1223
const PartitionOp &op, Element elt, Element otherElement,
1228
- ValueIsolationRegionInfo isolationRegionInfo) const {
1224
+ IsolationRegionInfo isolationRegionInfo) const {
1229
1225
return asImpl ().handleTransferNonTransferrable (op, elt, otherElement,
1230
1226
isolationRegionInfo);
1231
1227
}
@@ -1235,7 +1231,7 @@ struct PartitionOpEvaluator {
1235
1231
return asImpl ().isActorDerived (elt);
1236
1232
}
1237
1233
1238
- ValueIsolationRegionInfo getIsolationRegionInfo (Element elt) const {
1234
+ IsolationRegionInfo getIsolationRegionInfo (Element elt) const {
1239
1235
return asImpl ().getIsolationRegionInfo (elt);
1240
1236
}
1241
1237
@@ -1297,7 +1293,7 @@ struct PartitionOpEvaluator {
1297
1293
assert (p.isTrackingElement (op.getOpArgs ()[0 ]) &&
1298
1294
" Transfer PartitionOp's argument should already be tracked" );
1299
1295
1300
- ValueIsolationRegionInfo isolationRegionInfo =
1296
+ IsolationRegionInfo isolationRegionInfo =
1301
1297
getIsolationRegionInfo (op.getOpArgs ()[0 ]);
1302
1298
1303
1299
// If we know our direct value is actor derived... immediately emit an
@@ -1426,13 +1422,12 @@ struct PartitionOpEvaluatorBaseImpl : PartitionOpEvaluator<Subclass> {
1426
1422
1427
1423
// / This is called if we detect a never transferred element that was passed to
1428
1424
// / a transfer instruction.
1429
- void
1430
- handleTransferNonTransferrable (const PartitionOp &op, Element elt,
1431
- ValueIsolationRegionInfo regionInfo) const {}
1425
+ void handleTransferNonTransferrable (const PartitionOp &op, Element elt,
1426
+ IsolationRegionInfo regionInfo) const {}
1432
1427
1433
1428
void handleTransferNonTransferrable (
1434
1429
const PartitionOp &op, Element elt, Element otherElement,
1435
- ValueIsolationRegionInfo isolationRegionInfo) const {}
1430
+ IsolationRegionInfo isolationRegionInfo) const {}
1436
1431
1437
1432
// / This is used to determine if an element is actor derived. If we determine
1438
1433
// / that a region containing such an element is transferred, we emit an error
@@ -1445,8 +1440,8 @@ struct PartitionOpEvaluatorBaseImpl : PartitionOpEvaluator<Subclass> {
1445
1440
1446
1441
// / Returns the information about \p elt's isolation that we ascertained from
1447
1442
// / SIL and the AST.
1448
- ValueIsolationRegionInfo getIsolationRegionInfo (Element elt) const {
1449
- return ValueIsolationRegionInfo ();
1443
+ IsolationRegionInfo getIsolationRegionInfo (Element elt) const {
1444
+ return IsolationRegionInfo ();
1450
1445
}
1451
1446
1452
1447
// / Check if the representative value of \p elt is closure captured at \p
0 commit comments