Skip to content

Commit 2201e05

Browse files
committed
Merge remote-tracking branch 'origin/main' into rebranch
2 parents c28f079 + 34195ff commit 2201e05

Some content is hidden

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

52 files changed

+68
-834
lines changed

include/swift/ABI/MetadataValues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ class TargetExtendedFunctionTypeFlags {
11971197
// Values for the enumerated isolation kinds
11981198
IsolatedAny = 0x00000002U,
11991199

1200-
// Values if we have a transferring result.
1200+
// Values if we have a sending result.
12011201
HasSendingResult = 0x00000010U,
12021202

12031203
/// A InvertibleProtocolSet in the high bits.

include/swift/AST/ASTBridging.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,6 @@ enum ENUM_EXTENSIBILITY_ATTR(open) BridgedAttributedTypeSpecifier : size_t {
15501550
BridgedAttributedTypeSpecifierLegacyOwned,
15511551
BridgedAttributedTypeSpecifierConst,
15521552
BridgedAttributedTypeSpecifierIsolated,
1553-
BridgedAttributedTypeSpecifierTransferring,
15541553
BridgedAttributedTypeSpecifierSending,
15551554
};
15561555

include/swift/AST/DiagnosticsParse.def

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,19 +2204,10 @@ ERROR(lifetime_dependence_invalid_init_return, PointsToFirstBadToken,
22042204
"specifiers",
22052205
())
22062206

2207-
ERROR(transferring_after_parameter_specifier,none,
2208-
"'transferring' must be placed before specifier '%0'", (StringRef))
2209-
ERROR(transferring_repeated,none,
2210-
"parameter may have at most one 'transferring' specifier", ())
22112207
ERROR(sending_before_parameter_specifier,none,
22122208
"'sending' must be placed after specifier '%0'", (StringRef))
22132209
ERROR(sending_repeated,none,
22142210
"parameter may have at most one 'sending' specifier", ())
2215-
ERROR(sending_and_transferring_used_together,none,
2216-
"'transferring' and 'sending' may not be used together", ())
2217-
WARNING(transferring_is_now_sendable,none,
2218-
"'transferring' has been renamed to 'sending' and the 'transferring' spelling will be removed shortly",
2219-
())
22202211
ERROR(sending_cannot_be_used_with_borrowing,none,
22212212
"'%0' cannot be used together with 'borrowing'", (StringRef))
22222213

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7979,16 +7979,9 @@ ERROR(lifetime_dependence_immortal_conflict_name, none,
79797979
"conflict between the parameter name and immortal keyword", ())
79807980

79817981
//===----------------------------------------------------------------------===//
7982-
// MARK: Transferring
7982+
// MARK: Sending
79837983
//===----------------------------------------------------------------------===//
79847984

7985-
ERROR(transferring_unsupported_param_specifier, none,
7986-
"'%0' cannot be applied to a 'transferring' parameter", (StringRef))
7987-
7988-
ERROR(transferring_only_on_parameters_and_results, none,
7989-
"'transferring' may only be used on parameters and results", ())
7990-
ERROR(transferring_cannot_be_applied_to_tuple_elt, none,
7991-
"'transferring' cannot be applied to tuple elements", ())
79927985
ERROR(sending_unsupported_param_specifier, none,
79937986
"'%0' cannot be applied to a 'sending' parameter", (StringRef))
79947987
ERROR(sending_only_on_parameters_and_results, none,

include/swift/AST/ExtInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,15 +486,15 @@ class ASTExtInfoBuilder {
486486
DifferentiabilityKind::NonDifferentiable, nullptr,
487487
FunctionTypeIsolation::forNonIsolated(),
488488
LifetimeDependenceInfo(),
489-
false /*transferringResult*/) {}
489+
false /*sendingResult*/) {}
490490

491491
// Constructor for polymorphic type.
492492
ASTExtInfoBuilder(Representation rep, bool throws, Type thrownError)
493493
: ASTExtInfoBuilder(rep, false, throws, thrownError,
494494
DifferentiabilityKind::NonDifferentiable, nullptr,
495495
FunctionTypeIsolation::forNonIsolated(),
496496
LifetimeDependenceInfo(),
497-
false /*transferringResult*/) {}
497+
false /*sendingResult*/) {}
498498

499499
// Constructor with no defaults.
500500
ASTExtInfoBuilder(Representation rep, bool isNoEscape, bool throws,

include/swift/AST/TypeRepr.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,6 @@ class SpecifierTypeRepr : public TypeRepr {
11191119
T->getKind() == TypeReprKind::Isolated ||
11201120
T->getKind() == TypeReprKind::CompileTimeConst ||
11211121
T->getKind() == TypeReprKind::LifetimeDependentReturn ||
1122-
T->getKind() == TypeReprKind::Transferring ||
11231122
T->getKind() == TypeReprKind::Sending;
11241123
}
11251124
static bool classof(const SpecifierTypeRepr *T) { return true; }
@@ -1191,21 +1190,6 @@ class CompileTimeConstTypeRepr : public SpecifierTypeRepr {
11911190
static bool classof(const CompileTimeConstTypeRepr *T) { return true; }
11921191
};
11931192

1194-
/// A transferring type.
1195-
/// \code
1196-
/// x : transferring Int
1197-
/// \endcode
1198-
class TransferringTypeRepr : public SpecifierTypeRepr {
1199-
public:
1200-
TransferringTypeRepr(TypeRepr *Base, SourceLoc InOutLoc)
1201-
: SpecifierTypeRepr(TypeReprKind::Transferring, Base, InOutLoc) {}
1202-
1203-
static bool classof(const TypeRepr *T) {
1204-
return T->getKind() == TypeReprKind::Transferring;
1205-
}
1206-
static bool classof(const TransferringTypeRepr *T) { return true; }
1207-
};
1208-
12091193
/// A sending type.
12101194
/// \code
12111195
/// x : sending Int
@@ -1621,7 +1605,6 @@ inline bool TypeRepr::isSimple() const {
16211605
case TypeReprKind::Array:
16221606
case TypeReprKind::SILBox:
16231607
case TypeReprKind::Isolated:
1624-
case TypeReprKind::Transferring:
16251608
case TypeReprKind::Sending:
16261609
case TypeReprKind::Placeholder:
16271610
case TypeReprKind::CompileTimeConst:

include/swift/AST/TypeReprNodes.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ ABSTRACT_TYPEREPR(Specifier, TypeRepr)
7070
SPECIFIER_TYPEREPR(Ownership, SpecifierTypeRepr)
7171
SPECIFIER_TYPEREPR(Isolated, SpecifierTypeRepr)
7272
SPECIFIER_TYPEREPR(CompileTimeConst, SpecifierTypeRepr)
73-
SPECIFIER_TYPEREPR(Transferring, SpecifierTypeRepr)
7473
SPECIFIER_TYPEREPR(Sending, SpecifierTypeRepr)
7574
TYPEREPR(Fixed, TypeRepr)
7675
TYPEREPR(SILBox, TypeRepr)

include/swift/AST/Types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2429,7 +2429,7 @@ class YieldTypeFlags {
24292429
/*nonEphemeral*/ false, getOwnershipSpecifier(),
24302430
/*isolated*/ false, /*noDerivative*/ false,
24312431
/*compileTimeConst*/ false,
2432-
/*is transferring*/ false);
2432+
/*is sending*/ false);
24332433
}
24342434

24352435
bool operator ==(const YieldTypeFlags &other) const {

include/swift/Basic/Features.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ SUPPRESSIBLE_LANGUAGE_FEATURE(NoncopyableGenerics, 427, "Noncopyable generics")
196196
SUPPRESSIBLE_LANGUAGE_FEATURE(ConformanceSuppression, 426, "Suppressible inferred conformances")
197197
SUPPRESSIBLE_LANGUAGE_FEATURE(BitwiseCopyable2, 426, "BitwiseCopyable feature")
198198
LANGUAGE_FEATURE(BodyMacros, 415, "Function body macros")
199-
LANGUAGE_FEATURE(TransferringArgsAndResults, 430, "Transferring args and results")
200199
SUPPRESSIBLE_LANGUAGE_FEATURE(SendingArgsAndResults, 430, "Sending arg and results")
201200
LANGUAGE_FEATURE(BorrowingSwitch, 432, "Noncopyable type pattern matching")
202201
CONDITIONALLY_SUPPRESSIBLE_LANGUAGE_FEATURE(IsolatedAny, 431, "@isolated(any) function types")

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,11 +1377,6 @@ def disable_experimental_parser_round_trip : Flag<["-"],
13771377
"disable-experimental-parser-round-trip">,
13781378
HelpText<"Disable round trip through the new swift parser">;
13791379

1380-
def disable_transferring_args_and_results_with_region_isolation : Flag<["-"],
1381-
"disable-transferring-args-and-results-with-region-based-isolation">,
1382-
HelpText<"Disable transferring args and results when region based isolation is enabled. Only enabled with asserts">,
1383-
Flags<[HelpHidden]>;
1384-
13851380
def disable_sending_args_and_results_with_region_isolation : Flag<["-"],
13861381
"disable-sending-args-and-results-with-region-based-isolation">,
13871382
HelpText<"Disable sending args and results when region based isolation is enabled. Only enabled with asserts">,

include/swift/Parse/Parser.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,9 +1211,6 @@ class Parser {
12111211
Tok.isContextualKeyword("isolated") ||
12121212
Tok.isContextualKeyword("_const"))
12131213
return true;
1214-
if (Context.LangOpts.hasFeature(Feature::TransferringArgsAndResults) &&
1215-
Tok.isContextualKeyword("transferring"))
1216-
return true;
12171214
if (Context.LangOpts.hasFeature(Feature::SendingArgsAndResults) &&
12181215
Tok.isContextualKeyword("sending"))
12191216
return true;
@@ -1264,7 +1261,6 @@ class Parser {
12641261
SourceLoc SpecifierLoc;
12651262
SourceLoc IsolatedLoc;
12661263
SourceLoc ConstLoc;
1267-
SourceLoc TransferringLoc;
12681264
SourceLoc SendingLoc;
12691265
SmallVector<TypeOrCustomAttr> Attributes;
12701266
SmallVector<LifetimeDependenceSpecifier> lifetimeDependenceSpecifiers;
@@ -1577,9 +1573,6 @@ class Parser {
15771573
/// The location of the '_const' keyword, if present.
15781574
SourceLoc CompileConstLoc;
15791575

1580-
/// The location of the 'transferring' keyword if present.
1581-
SourceLoc TransferringLoc;
1582-
15831576
/// The location of the 'sending' keyword if present.
15841577
SourceLoc SendingLoc;
15851578

lib/AST/ASTBridging.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,6 @@ BridgedParamDecl BridgedParamDecl_createParsed(
877877
paramDecl->setIsolated(true);
878878
else if (isa<CompileTimeConstTypeRepr>(STR))
879879
paramDecl->setCompileTimeConst(true);
880-
else if (isa<TransferringTypeRepr>(STR))
881-
paramDecl->setSending(true);
882880
else if (isa<SendingTypeRepr>(STR))
883881
paramDecl->setSending(true);
884882

@@ -2225,9 +2223,6 @@ BridgedSpecifierTypeRepr BridgedSpecifierTypeRepr_createParsed(
22252223
return new (context)
22262224
OwnershipTypeRepr(baseType, ParamSpecifier::LegacyOwned, loc);
22272225
}
2228-
case BridgedAttributedTypeSpecifierTransferring: {
2229-
return new (context) TransferringTypeRepr(baseType, loc);
2230-
}
22312226
case BridgedAttributedTypeSpecifierSending: {
22322227
return new (context) SendingTypeRepr(baseType, loc);
22332228
}

lib/AST/ASTDumper.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,12 +3448,6 @@ class PrintTypeRepr : public TypeReprVisitor<PrintTypeRepr, void, StringRef>,
34483448
printFoot();
34493449
}
34503450

3451-
void visitTransferringTypeRepr(TransferringTypeRepr *T, StringRef label) {
3452-
printCommon("transferring", label);
3453-
printRec(T->getBase());
3454-
printFoot();
3455-
}
3456-
34573451
void visitSendingTypeRepr(SendingTypeRepr *T, StringRef label) {
34583452
printCommon("sending", label);
34593453
printRec(T->getBase());

lib/AST/ASTMangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ void ASTMangler::appendImplFunctionType(SILFunctionType *fn,
21662166
appendType(param.getInterfaceType(), sig, forDecl);
21672167
}
21682168

2169-
// Mangle if we have a transferring result.
2169+
// Mangle if we have a sending result.
21702170
if (isInRecursion && fn->hasSendingResult())
21712171
OpArgs.push_back('T');
21722172

lib/AST/ASTWalker.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,10 +2337,6 @@ bool Traversal::visitIsolatedTypeRepr(IsolatedTypeRepr *T) {
23372337
return doIt(T->getBase());
23382338
}
23392339

2340-
bool Traversal::visitTransferringTypeRepr(TransferringTypeRepr *T) {
2341-
return doIt(T->getBase());
2342-
}
2343-
23442340
bool Traversal::visitSendingTypeRepr(SendingTypeRepr *T) {
23452341
return doIt(T->getBase());
23462342
}

lib/AST/Builtins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ static ValueDecl *getStartAsyncLet(ASTContext &ctx, Identifier id) {
16861686
bool hasSendingResult =
16871687
ctx.LangOpts.hasFeature(Feature::RegionBasedIsolation);
16881688

1689-
// operation async function pointer: () async throws -> transferring T
1689+
// operation async function pointer: () async throws -> sending T
16901690
auto extInfo = ASTExtInfoBuilder()
16911691
.withAsync()
16921692
.withThrows()

lib/AST/Decl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10371,8 +10371,7 @@ FuncDecl *FuncDecl::create(ASTContext &Context, SourceLoc StaticLoc,
1037110371
ClangNode());
1037210372
FD->setParameters(BodyParams);
1037310373
FD->FnRetType = TypeLoc(ResultTyR);
10374-
if (llvm::isa_and_nonnull<TransferringTypeRepr>(ResultTyR) ||
10375-
llvm::isa_and_nonnull<SendingTypeRepr>(ResultTyR))
10374+
if (llvm::isa_and_nonnull<SendingTypeRepr>(ResultTyR))
1037610375
FD->setSendingResult();
1037710376
return FD;
1037810377
}

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ UNINTERESTING_FEATURE(BitwiseCopyable)
638638
UNINTERESTING_FEATURE(FixedArrays)
639639
UNINTERESTING_FEATURE(GroupActorErrors)
640640

641-
UNINTERESTING_FEATURE(TransferringArgsAndResults)
642641
static bool usesFeatureSendingArgsAndResults(Decl *decl) {
643642
auto isFunctionTypeWithSending = [](Type type) {
644643
auto fnType = type->getAs<AnyFunctionType>();

lib/AST/NameLookup.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3180,7 +3180,6 @@ directReferencesForTypeRepr(Evaluator &evaluator,
31803180
case TypeReprKind::NamedOpaqueReturn:
31813181
case TypeReprKind::Existential:
31823182
case TypeReprKind::LifetimeDependentReturn:
3183-
case TypeReprKind::Transferring:
31843183
case TypeReprKind::Sending:
31853184
return result;
31863185

lib/AST/TypeRepr.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,6 @@ void SpecifierTypeRepr::printImpl(ASTPrinter &Printer,
852852
case TypeReprKind::Isolated:
853853
Printer.printKeyword("isolated", Opts, " ");
854854
break;
855-
case TypeReprKind::Transferring:
856-
Printer.printKeyword("transferring", Opts, " ");
857-
break;
858855
case TypeReprKind::Sending:
859856
Printer.printKeyword("sending", Opts, " ");
860857
break;

lib/ASTGen/Sources/ASTGen/SourceFile.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ extension Parser.ExperimentalFeatures {
6060
mapFeature(.ThenStatements, to: .thenStatements)
6161
mapFeature(.DoExpressions, to: .doExpressions)
6262
mapFeature(.NonescapableTypes, to: .nonescapableTypes)
63-
mapFeature(.TransferringArgsAndResults, to: .transferringArgsAndResults)
6463
mapFeature(.SendingArgsAndResults, to: .sendingArgsAndResults)
6564
}
6665
}

lib/ClangImporter/ClangImporter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,8 @@ void importer::getNormalInvocationArguments(
676676
}
677677
}
678678

679-
// If we support TransferringArgsAndResults, set the -D flag to signal that it
679+
// If we support SendingArgsAndResults, set the -D flag to signal that it
680680
// is supported.
681-
if (LangOpts.hasFeature(Feature::TransferringArgsAndResults))
682-
invocationArgStrs.push_back("-D__SWIFT_ATTR_SUPPORTS_TRANSFERRING=1");
683681
if (LangOpts.hasFeature(Feature::SendingArgsAndResults))
684682
invocationArgStrs.push_back("-D__SWIFT_ATTR_SUPPORTS_SENDING=1");
685683

lib/ClangImporter/ImportDecl.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8061,18 +8061,6 @@ ClangImporter::Implementation::importSwiftAttrAttributes(Decl *MappedDecl) {
80618061
nominal->registerProtocolConformance(conformance, /*synthesized=*/true);
80628062
}
80638063

8064-
if (swiftAttr->getAttribute() == "transferring") {
8065-
// Swallow this if the feature is not enabled.
8066-
if (!SwiftContext.LangOpts.hasFeature(
8067-
Feature::TransferringArgsAndResults))
8068-
continue;
8069-
auto *funcDecl = dyn_cast<FuncDecl>(MappedDecl);
8070-
if (!funcDecl)
8071-
continue;
8072-
funcDecl->setSendingResult();
8073-
continue;
8074-
}
8075-
80768064
if (swiftAttr->getAttribute() == "sending") {
80778065
// Swallow this if the feature is not enabled.
80788066
if (!SwiftContext.LangOpts.hasFeature(Feature::SendingArgsAndResults))

lib/ClangImporter/ImportType.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,19 +2649,8 @@ static ParamDecl *getParameterInfo(ClangImporter::Implementation *impl,
26492649
impl->importSourceLoc(param->getLocation()), bodyName,
26502650
impl->ImportedHeaderUnit);
26512651

2652-
// If TransferringArgsAndResults are enabled and we have a transferring
2653-
// argument, set that the param was transferring.
2654-
if (paramInfo->getASTContext().LangOpts.hasFeature(
2655-
Feature::TransferringArgsAndResults)) {
2656-
if (auto *attr = param->getAttr<clang::SwiftAttrAttr>()) {
2657-
if (attr->getAttribute() == "transferring") {
2658-
paramInfo->setSending();
2659-
}
2660-
}
2661-
}
2662-
2663-
// If TransferringArgsAndResults are enabled and we have a transferring
2664-
// argument, set that the param was transferring.
2652+
// If SendingArgsAndResults are enabled and we have a sending argument,
2653+
// set that the param was sending.
26652654
if (paramInfo->getASTContext().LangOpts.hasFeature(
26662655
Feature::SendingArgsAndResults)) {
26672656
if (auto *attr = param->getAttr<clang::SwiftAttrAttr>()) {

lib/Migrator/APIDiffMigratorPass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ class ChildIndexFinder : public TypeReprVisitor<ChildIndexFinder, FoundResult> {
157157
return visit(T->getBase());
158158
}
159159

160-
FoundResult visitTransferringTypeRepr(TransferringTypeRepr *T) {
161-
return visit(T->getBase());
162-
}
163-
164160
FoundResult visitSendingTypeRepr(SendingTypeRepr *T) {
165161
return visit(T->getBase());
166162
}

0 commit comments

Comments
 (0)