@@ -4053,8 +4053,8 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
4053
4053
info.getSILRepresentation () == SILFunctionType::Representation::Thick)
4054
4054
return ;
4055
4055
4056
- bool printNameOnly = Options.PrintFunctionRepresentationAttrs ==
4057
- PrintOptions::FunctionRepresentationMode::NameOnly ;
4056
+ bool printClangType = Options.PrintFunctionRepresentationAttrs ==
4057
+ PrintOptions::FunctionRepresentationMode::Full ;
4058
4058
Printer.callPrintStructurePre (PrintStructureKind::BuiltinAttribute);
4059
4059
Printer.printAttrName (" @convention" );
4060
4060
Printer << " (" ;
@@ -4067,13 +4067,13 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
4067
4067
break ;
4068
4068
case SILFunctionType::Representation::Block:
4069
4069
Printer << " block" ;
4070
+ if (printClangType && !info.getClangTypeInfo ().empty ())
4071
+ printCType (Ctx, Printer, info);
4070
4072
break ;
4071
4073
case SILFunctionType::Representation::CFunctionPointer:
4072
4074
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);
4077
4077
break ;
4078
4078
case SILFunctionType::Representation::Method:
4079
4079
Printer << " method" ;
@@ -4120,8 +4120,8 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
4120
4120
info.getRepresentation () == SILFunctionType::Representation::Thick)
4121
4121
break ;
4122
4122
4123
- bool printNameOnly = Options.PrintFunctionRepresentationAttrs ==
4124
- PrintOptions::FunctionRepresentationMode::NameOnly ;
4123
+ bool printClangType = Options.PrintFunctionRepresentationAttrs ==
4124
+ PrintOptions::FunctionRepresentationMode::Full ;
4125
4125
Printer.callPrintStructurePre (PrintStructureKind::BuiltinAttribute);
4126
4126
Printer.printAttrName (" @convention" );
4127
4127
Printer << " (" ;
@@ -4133,13 +4133,13 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
4133
4133
break ;
4134
4134
case SILFunctionType::Representation::Block:
4135
4135
Printer << " block" ;
4136
+ if (printClangType)
4137
+ printCType (Ctx, Printer, info);
4136
4138
break ;
4137
4139
case SILFunctionType::Representation::CFunctionPointer:
4138
4140
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);
4143
4143
break ;
4144
4144
case SILFunctionType::Representation::Method:
4145
4145
Printer << " method" ;
0 commit comments