@@ -3220,13 +3220,6 @@ void PrintAST::printExtension(ExtensionDecl *decl) {
3220
3220
}
3221
3221
}
3222
3222
3223
- static void
3224
- suppressingFeatureSendingArgsAndResults (PrintOptions &options,
3225
- llvm::function_ref<void ()> action) {
3226
- llvm::SaveAndRestore<bool > scope (options.SuppressSendingArgsAndResults , true );
3227
- action ();
3228
- }
3229
-
3230
3223
static void
3231
3224
suppressingFeatureLifetimes (PrintOptions &options,
3232
3225
llvm::function_ref<void ()> action) {
@@ -3854,17 +3847,7 @@ static void printParameterFlags(ASTPrinter &printer,
3854
3847
}
3855
3848
3856
3849
if (flags.isSending ()) {
3857
- if (!options.SuppressSendingArgsAndResults ) {
3858
- printer.printKeyword (" sending" , options, " " );
3859
- } else if (flags.getOwnershipSpecifier () ==
3860
- ParamSpecifier::ImplicitlyCopyableConsuming) {
3861
- // Ok. We are suppressing sending. If our ownership specifier was
3862
- // originally implicitly copyable consuming our argument was being passed
3863
- // at +1. By not printing sending, we would be changing the API
3864
- // potentially to take the parameter at +0 instead of +1. To work around
3865
- // this, print out consuming so that we preserve the +1 parameter.
3866
- printer.printKeyword (" __owned" , options, " " );
3867
- }
3850
+ printer.printKeyword (" sending" , options, " " );
3868
3851
}
3869
3852
3870
3853
if (flags.isIsolated ()) {
@@ -4327,14 +4310,12 @@ void PrintAST::visitFuncDecl(FuncDecl *decl) {
4327
4310
Printer.printDeclResultTypePre (decl, ResultTyLoc);
4328
4311
Printer.callPrintStructurePre (PrintStructureKind::FunctionReturnType);
4329
4312
4330
- if (!Options.SuppressSendingArgsAndResults ) {
4331
- if (decl->hasSendingResult ()) {
4313
+ if (decl->hasSendingResult ()) {
4314
+ Printer << " sending " ;
4315
+ } else if (auto *ft = llvm::dyn_cast_if_present<AnyFunctionType>(
4316
+ decl->getInterfaceType ())) {
4317
+ if (ft->hasExtInfo () && ft->hasSendingResult ()) {
4332
4318
Printer << " sending " ;
4333
- } else if (auto *ft = llvm::dyn_cast_if_present<AnyFunctionType>(
4334
- decl->getInterfaceType ())) {
4335
- if (ft->hasExtInfo () && ft->hasSendingResult ()) {
4336
- Printer << " sending " ;
4337
- }
4338
4319
}
4339
4320
}
4340
4321
@@ -4507,12 +4488,10 @@ void PrintAST::visitSubscriptDecl(SubscriptDecl *decl) {
4507
4488
Printer.printDeclResultTypePre (decl, elementTy);
4508
4489
Printer.callPrintStructurePre (PrintStructureKind::FunctionReturnType);
4509
4490
4510
- if (!Options.SuppressSendingArgsAndResults ) {
4511
4491
if (decl->getElementTypeRepr ()) {
4512
4492
if (isa<SendingTypeRepr>(decl->getResultTypeRepr ()))
4513
4493
Printer << " sending " ;
4514
4494
}
4515
- }
4516
4495
4517
4496
PrintWithOpaqueResultTypeKeywordRAII x (Options);
4518
4497
auto nrOptions = getNonRecursiveOptions (decl);
@@ -6798,8 +6777,7 @@ class TypePrinter : public TypeVisitor<TypePrinter, void, NonRecursivePrintOptio
6798
6777
6799
6778
Printer << " -> " ;
6800
6779
6801
- if (!Options.SuppressSendingArgsAndResults && T->hasExtInfo () &&
6802
- T->hasSendingResult ()) {
6780
+ if (T->hasExtInfo () && T->hasSendingResult ()) {
6803
6781
Printer.printKeyword (" sending " , Options);
6804
6782
}
6805
6783
0 commit comments