@@ -475,7 +475,7 @@ void StreamPrinter::printText(StringRef Text) {
475
475
// / Whether we will be printing a TypeLoc by using the TypeRepr printer
476
476
static bool willUseTypeReprPrinting (TypeLoc tyLoc,
477
477
Type currentType,
478
- PrintOptions options) {
478
+ const PrintOptions & options) {
479
479
// Special case for when transforming archetypes
480
480
if (currentType && tyLoc.getType ())
481
481
return false ;
@@ -686,7 +686,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
686
686
}
687
687
}
688
688
689
- void printTypeWithOptions (Type T, PrintOptions options) {
689
+ void printTypeWithOptions (Type T, const PrintOptions & options) {
690
690
if (options.TransformContext ) {
691
691
// FIXME: it's not clear exactly what we want to keep from the existing
692
692
// options, and what we want to discard.
@@ -736,7 +736,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
736
736
printTransformedTypeWithOptions (T, Options);
737
737
}
738
738
739
- void printTypeLocWithOptions (const TypeLoc &TL, PrintOptions options) {
739
+ void printTypeLocWithOptions (const TypeLoc &TL, const PrintOptions & options) {
740
740
if (CurrentType && TL.getType ()) {
741
741
printTransformedTypeWithOptions (TL.getType (), options);
742
742
return ;
@@ -1076,7 +1076,7 @@ void PrintAST::printTypedPattern(const TypedPattern *TP) {
1076
1076
1077
1077
// / Determines if we are required to print the name of a property declaration,
1078
1078
// / or if we can elide it by printing a '_' instead.
1079
- static bool mustPrintPropertyName (VarDecl *decl, PrintOptions opts) {
1079
+ static bool mustPrintPropertyName (VarDecl *decl, const PrintOptions & opts) {
1080
1080
// If we're not allowed to omit the name, we must print it.
1081
1081
if (!opts.OmitNameOfInaccessibleProperties ) return true ;
1082
1082
@@ -2564,8 +2564,10 @@ static bool isEscaping(Type type) {
2564
2564
return false ;
2565
2565
}
2566
2566
2567
- static void printParameterFlags (ASTPrinter &printer, PrintOptions options,
2568
- ParameterTypeFlags flags, bool escaping) {
2567
+ static void printParameterFlags (ASTPrinter &printer,
2568
+ const PrintOptions &options,
2569
+ ParameterTypeFlags flags,
2570
+ bool escaping) {
2569
2571
if (!options.excludeAttrKind (TAK_autoclosure) && flags.isAutoClosure ())
2570
2572
printer.printAttrName (" @autoclosure " );
2571
2573
if (!options.excludeAttrKind (TAK_noDerivative) && flags.isNoDerivative ())
@@ -4608,12 +4610,13 @@ void GenericSignatureImpl::print(ASTPrinter &Printer, PrintOptions PO) const {
4608
4610
GenericSignature (const_cast <GenericSignatureImpl *>(this )).print (Printer, PO);
4609
4611
}
4610
4612
4611
- void GenericSignature::print (raw_ostream &OS, PrintOptions Opts) const {
4613
+ void GenericSignature::print (raw_ostream &OS, const PrintOptions & Opts) const {
4612
4614
StreamPrinter Printer (OS);
4613
4615
print (Printer, Opts);
4614
4616
}
4615
4617
4616
- void GenericSignature::print (ASTPrinter &Printer, PrintOptions Opts) const {
4618
+ void GenericSignature::print (ASTPrinter &Printer,
4619
+ const PrintOptions &Opts) const {
4617
4620
if (isNull ()) {
4618
4621
Printer << " <null>" ;
4619
4622
return ;
0 commit comments