Skip to content

Commit 9579390

Browse files
committed
[SE-0304] Rename ConcurrentValue to Sendable
1 parent ec2d786 commit 9579390

File tree

101 files changed

+368
-360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+368
-360
lines changed

include/swift/AST/DeclContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ enum class ConformanceLookupKind : unsigned {
160160
/// All conformances except for inherited ones.
161161
NonInherited,
162162
/// All conformances except structurally-derived conformances, of which
163-
/// ConcurrentValue is the only one.
163+
/// Sendable is the only one.
164164
NonStructural,
165165
};
166166

include/swift/AST/DiagnosticsSema.def

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4421,20 +4421,20 @@ WARNING(non_concurrent_keypath_access,none,
44214421
(Type))
44224422
ERROR(non_concurrent_type_member,none,
44234423
"%select{stored property %1|associated value %1}0 of "
4424-
"'ConcurrentValue'-conforming %2 %3 has non-concurrent-value type %4",
4424+
"'Sendable'-conforming %2 %3 has non-concurrent-value type %4",
44254425
(bool, DeclName, DescriptiveDeclKind, DeclName, Type))
44264426
ERROR(concurrent_value_class_mutable_property,none,
4427-
"stored property %0 of 'ConcurrentValue'-conforming %1 %2 is mutable",
4427+
"stored property %0 of 'Sendable'-conforming %1 %2 is mutable",
44284428
(DeclName, DescriptiveDeclKind, DeclName))
44294429
ERROR(concurrent_value_outside_source_file,none,
4430-
"conformance to 'ConcurrentValue' must occur in the same source file as "
4431-
"%0 %1; use 'UnsafeConcurrentValue' for retroactive conformance",
4430+
"conformance to 'Sendable' must occur in the same source file as "
4431+
"%0 %1; use 'UnsafeSendable' for retroactive conformance",
44324432
(DescriptiveDeclKind, DeclName))
44334433
ERROR(concurrent_value_nonfinal_class,none,
4434-
"non-final class %0 cannot conform to `ConcurrentValue`; "
4435-
"use `UnsafeConcurrentValue`", (DeclName))
4434+
"non-final class %0 cannot conform to `Sendable`; "
4435+
"use `UnsafeSendable`", (DeclName))
44364436
ERROR(concurrent_value_inherit,none,
4437-
"`ConcurrentValue` class %1 cannot inherit from another class"
4437+
"`Sendable` class %1 cannot inherit from another class"
44384438
"%select{| other than 'NSObject'}0",
44394439
(bool, DeclName))
44404440

include/swift/AST/KnownProtocols.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ PROTOCOL(CodingKey)
8080
PROTOCOL(Encodable)
8181
PROTOCOL(Decodable)
8282

83-
PROTOCOL(ConcurrentValue)
84-
PROTOCOL(UnsafeConcurrentValue)
83+
PROTOCOL(Sendable)
84+
PROTOCOL(UnsafeSendable)
8585

8686
PROTOCOL_(ObjectiveCBridgeable)
8787
PROTOCOL_(DestructorSafeContainer)

include/swift/AST/TypeCheckRequests.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,9 +2898,9 @@ class SynthesizeMainFunctionRequest
28982898
};
28992899

29002900
/// Retrieve the implicit conformance for the given nominal type to
2901-
/// the ConcurrentValue protocol.
2902-
class GetImplicitConcurrentValueRequest :
2903-
public SimpleRequest<GetImplicitConcurrentValueRequest,
2901+
/// the Sendable protocol.
2902+
class GetImplicitSendableRequest :
2903+
public SimpleRequest<GetImplicitSendableRequest,
29042904
NormalProtocolConformance *(NominalTypeDecl *),
29052905
RequestFlags::Cached> {
29062906
public:

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,6 @@ SWIFT_REQUEST(TypeChecker, SimpleDidSetRequest,
317317
bool(AccessorDecl *), Cached, NoLocationInfo)
318318
SWIFT_REQUEST(TypeChecker, SynthesizeMainFunctionRequest,
319319
FuncDecl *(Decl *), Cached, NoLocationInfo)
320-
SWIFT_REQUEST(TypeChecker, GetImplicitConcurrentValueRequest,
320+
SWIFT_REQUEST(TypeChecker, GetImplicitSendableRequest,
321321
NormalProtocolConformance *(NominalTypeDecl *),
322322
Cached, NoLocationInfo)

include/swift/Basic/LangOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ namespace swift {
253253
/// Enable experimental flow-sensitive concurrent captures.
254254
bool EnableExperimentalFlowSensitiveConcurrentCaptures = false;
255255

256-
/// Enable inference of ConcurrentValue conformances for public types.
257-
bool EnableInferPublicConcurrentValue = false;
256+
/// Enable inference of Sendable conformances for public types.
257+
bool EnableInferPublicSendable = false;
258258

259259
/// Enable experimental derivation of `Codable` for enums.
260260
bool EnableExperimentalEnumCodableDerivation = false;

include/swift/Option/FrontendOptions.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ def disable_copy_propagation : Flag<["-"], "disable-copy-propagation">,
194194
HelpText<"Don't run SIL copy propagation to preserve object lifetime.">;
195195

196196
def enable_infer_public_concurrent_value : Flag<["-"], "enable-infer-public-concurrent-value">,
197-
HelpText<"Enable inference of ConcurrentValue conformances for public structs and enums">;
197+
HelpText<"Enable inference of Sendable conformances for public structs and enums">;
198198

199199
def disable_infer_public_concurrent_value : Flag<["-"], "disable-infer-public-concurrent-value">,
200-
HelpText<"Disable inference of ConcurrentValue conformances for public structs and enums">;
200+
HelpText<"Disable inference of Sendable conformances for public structs and enums">;
201201

202202
} // end let Flags = [FrontendOption, NoDriverOption]
203203

lib/AST/Module.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -968,12 +968,12 @@ ModuleDecl::lookupExistentialConformance(Type type, ProtocolDecl *protocol) {
968968
ProtocolConformanceRef ModuleDecl::lookupConformance(Type type,
969969
ProtocolDecl *protocol) {
970970
// If we are recursively checking for implicit conformance of a nominal
971-
// type to ConcurrentValue, fail without evaluating this request. This
971+
// type to Sendable, fail without evaluating this request. This
972972
// squashes cycles.
973973
LookupConformanceInModuleRequest request{{this, type, protocol}};
974-
if (protocol->isSpecificProtocol(KnownProtocolKind::ConcurrentValue)) {
974+
if (protocol->isSpecificProtocol(KnownProtocolKind::Sendable)) {
975975
if (auto nominal = type->getAnyNominal()) {
976-
GetImplicitConcurrentValueRequest icvRequest{nominal};
976+
GetImplicitSendableRequest icvRequest{nominal};
977977
if (getASTContext().evaluator.hasActiveRequest(icvRequest) ||
978978
getASTContext().evaluator.hasActiveRequest(request))
979979
return ProtocolConformanceRef::forInvalid();
@@ -1047,11 +1047,11 @@ LookupConformanceInModuleRequest::evaluate(
10471047
// Find the (unspecialized) conformance.
10481048
SmallVector<ProtocolConformance *, 2> conformances;
10491049
if (!nominal->lookupConformance(mod, protocol, conformances)) {
1050-
if (!protocol->isSpecificProtocol(KnownProtocolKind::ConcurrentValue))
1050+
if (!protocol->isSpecificProtocol(KnownProtocolKind::Sendable))
10511051
return ProtocolConformanceRef::forInvalid();
10521052

1053-
// Try to infer ConcurrentValue conformance.
1054-
GetImplicitConcurrentValueRequest cvRequest{nominal};
1053+
// Try to infer Sendable conformance.
1054+
GetImplicitSendableRequest cvRequest{nominal};
10551055
if (auto conformance = evaluateOrDefault(
10561056
ctx.evaluator, cvRequest, nullptr)) {
10571057
conformances.clear();

lib/AST/ProtocolConformance.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,9 +1326,9 @@ IterableDeclContext::getLocalProtocols(ConformanceLookupKind lookupKind) const {
13261326
return result;
13271327
}
13281328

1329-
/// Find a synthesized ConcurrentValue conformance in this declaration context,
1329+
/// Find a synthesized Sendable conformance in this declaration context,
13301330
/// if there is one.
1331-
static ProtocolConformance *findSynthesizedConcurrentValueConformance(
1331+
static ProtocolConformance *findSynthesizedSendableConformance(
13321332
const DeclContext *dc) {
13331333
auto nominal = dc->getSelfNominalTypeDecl();
13341334
if (!nominal)
@@ -1341,7 +1341,7 @@ static ProtocolConformance *findSynthesizedConcurrentValueConformance(
13411341
return nullptr;
13421342

13431343
auto cvProto = nominal->getASTContext().getProtocol(
1344-
KnownProtocolKind::ConcurrentValue);
1344+
KnownProtocolKind::Sendable);
13451345
if (!cvProto)
13461346
return nullptr;
13471347

@@ -1438,10 +1438,10 @@ IterableDeclContext::getLocalConformances(ConformanceLookupKind lookupKind)
14381438
switch (lookupKind) {
14391439
case ConformanceLookupKind::All:
14401440
case ConformanceLookupKind::NonInherited: {
1441-
// Look for a ConcurrentValue conformance globally. If it is synthesized
1441+
// Look for a Sendable conformance globally. If it is synthesized
14421442
// and matches this declaration context, use it.
14431443
auto dc = getAsGenericContext();
1444-
if (auto conformance = findSynthesizedConcurrentValueConformance(dc))
1444+
if (auto conformance = findSynthesizedSendableConformance(dc))
14451445
result.push_back(conformance);
14461446
break;
14471447
}

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
385385

386386
Opts.EnableExperimentalConcurrency |=
387387
Args.hasArg(OPT_enable_experimental_concurrency);
388-
Opts.EnableInferPublicConcurrentValue |=
388+
Opts.EnableInferPublicSendable |=
389389
Args.hasFlag(OPT_enable_infer_public_concurrent_value,
390390
OPT_disable_infer_public_concurrent_value,
391391
false);

0 commit comments

Comments
 (0)