@@ -3220,13 +3220,6 @@ void PrintAST::printExtension(ExtensionDecl *decl) {
32203220 }
32213221}
32223222
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-
32303223static void
32313224suppressingFeatureLifetimes (PrintOptions &options,
32323225 llvm::function_ref<void ()> action) {
@@ -3854,17 +3847,7 @@ static void printParameterFlags(ASTPrinter &printer,
38543847 }
38553848
38563849 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, " " );
38683851 }
38693852
38703853 if (flags.isIsolated ()) {
@@ -4327,14 +4310,12 @@ void PrintAST::visitFuncDecl(FuncDecl *decl) {
43274310 Printer.printDeclResultTypePre (decl, ResultTyLoc);
43284311 Printer.callPrintStructurePre (PrintStructureKind::FunctionReturnType);
43294312
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 ()) {
43324318 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- }
43384319 }
43394320 }
43404321
@@ -4507,12 +4488,10 @@ void PrintAST::visitSubscriptDecl(SubscriptDecl *decl) {
45074488 Printer.printDeclResultTypePre (decl, elementTy);
45084489 Printer.callPrintStructurePre (PrintStructureKind::FunctionReturnType);
45094490
4510- if (!Options.SuppressSendingArgsAndResults ) {
45114491 if (decl->getElementTypeRepr ()) {
45124492 if (isa<SendingTypeRepr>(decl->getResultTypeRepr ()))
45134493 Printer << " sending " ;
45144494 }
4515- }
45164495
45174496 PrintWithOpaqueResultTypeKeywordRAII x (Options);
45184497 auto nrOptions = getNonRecursiveOptions (decl);
@@ -6798,8 +6777,7 @@ class TypePrinter : public TypeVisitor<TypePrinter, void, NonRecursivePrintOptio
67986777
67996778 Printer << " -> " ;
68006779
6801- if (!Options.SuppressSendingArgsAndResults && T->hasExtInfo () &&
6802- T->hasSendingResult ()) {
6780+ if (T->hasExtInfo () && T->hasSendingResult ()) {
68036781 Printer.printKeyword (" sending " , Options);
68046782 }
68056783
0 commit comments