@@ -4053,8 +4053,8 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
40534053 info.getSILRepresentation () == SILFunctionType::Representation::Thick)
40544054 return ;
40554055
4056- bool printNameOnly = Options.PrintFunctionRepresentationAttrs ==
4057- PrintOptions::FunctionRepresentationMode::NameOnly ;
4056+ bool printClangType = Options.PrintFunctionRepresentationAttrs ==
4057+ PrintOptions::FunctionRepresentationMode::Full ;
40584058 Printer.callPrintStructurePre (PrintStructureKind::BuiltinAttribute);
40594059 Printer.printAttrName (" @convention" );
40604060 Printer << " (" ;
@@ -4067,13 +4067,13 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
40674067 break ;
40684068 case SILFunctionType::Representation::Block:
40694069 Printer << " block" ;
4070+ if (printClangType && !info.getClangTypeInfo ().empty ())
4071+ printCType (Ctx, Printer, info);
40704072 break ;
40714073 case SILFunctionType::Representation::CFunctionPointer:
40724074 Printer << " c" ;
4073- // [TODO: Clang-type-plumbing] Remove the second check.
4074- if (printNameOnly || info.getClangTypeInfo ().empty ())
4075- break ;
4076- printCType (Ctx, Printer, info);
4075+ if (printClangType && !info.getClangTypeInfo ().empty ())
4076+ printCType (Ctx, Printer, info);
40774077 break ;
40784078 case SILFunctionType::Representation::Method:
40794079 Printer << " method" ;
@@ -4120,8 +4120,8 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
41204120 info.getRepresentation () == SILFunctionType::Representation::Thick)
41214121 break ;
41224122
4123- bool printNameOnly = Options.PrintFunctionRepresentationAttrs ==
4124- PrintOptions::FunctionRepresentationMode::NameOnly ;
4123+ bool printClangType = Options.PrintFunctionRepresentationAttrs ==
4124+ PrintOptions::FunctionRepresentationMode::Full ;
41254125 Printer.callPrintStructurePre (PrintStructureKind::BuiltinAttribute);
41264126 Printer.printAttrName (" @convention" );
41274127 Printer << " (" ;
@@ -4133,13 +4133,13 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
41334133 break ;
41344134 case SILFunctionType::Representation::Block:
41354135 Printer << " block" ;
4136+ if (printClangType)
4137+ printCType (Ctx, Printer, info);
41364138 break ;
41374139 case SILFunctionType::Representation::CFunctionPointer:
41384140 Printer << " c" ;
4139- // [TODO: Clang-type-plumbing] Remove the second check.
4140- if (printNameOnly || info.getClangTypeInfo ().empty ())
4141- break ;
4142- printCType (Ctx, Printer, info);
4141+ if (printClangType)
4142+ printCType (Ctx, Printer, info);
41434143 break ;
41444144 case SILFunctionType::Representation::Method:
41454145 Printer << " method" ;
0 commit comments