@@ -475,7 +475,7 @@ void StreamPrinter::printText(StringRef Text) {
475475// / Whether we will be printing a TypeLoc by using the TypeRepr printer
476476static bool willUseTypeReprPrinting (TypeLoc tyLoc,
477477 Type currentType,
478- PrintOptions options) {
478+ const PrintOptions & options) {
479479 // Special case for when transforming archetypes
480480 if (currentType && tyLoc.getType ())
481481 return false ;
@@ -686,7 +686,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
686686 }
687687 }
688688
689- void printTypeWithOptions (Type T, PrintOptions options) {
689+ void printTypeWithOptions (Type T, const PrintOptions & options) {
690690 if (options.TransformContext ) {
691691 // FIXME: it's not clear exactly what we want to keep from the existing
692692 // options, and what we want to discard.
@@ -736,7 +736,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
736736 printTransformedTypeWithOptions (T, Options);
737737 }
738738
739- void printTypeLocWithOptions (const TypeLoc &TL, PrintOptions options) {
739+ void printTypeLocWithOptions (const TypeLoc &TL, const PrintOptions & options) {
740740 if (CurrentType && TL.getType ()) {
741741 printTransformedTypeWithOptions (TL.getType (), options);
742742 return ;
@@ -1076,7 +1076,7 @@ void PrintAST::printTypedPattern(const TypedPattern *TP) {
10761076
10771077// / Determines if we are required to print the name of a property declaration,
10781078// / 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) {
10801080 // If we're not allowed to omit the name, we must print it.
10811081 if (!opts.OmitNameOfInaccessibleProperties ) return true ;
10821082
@@ -2564,8 +2564,10 @@ static bool isEscaping(Type type) {
25642564 return false ;
25652565}
25662566
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) {
25692571 if (!options.excludeAttrKind (TAK_autoclosure) && flags.isAutoClosure ())
25702572 printer.printAttrName (" @autoclosure " );
25712573 if (!options.excludeAttrKind (TAK_noDerivative) && flags.isNoDerivative ())
@@ -4608,12 +4610,13 @@ void GenericSignatureImpl::print(ASTPrinter &Printer, PrintOptions PO) const {
46084610 GenericSignature (const_cast <GenericSignatureImpl *>(this )).print (Printer, PO);
46094611}
46104612
4611- void GenericSignature::print (raw_ostream &OS, PrintOptions Opts) const {
4613+ void GenericSignature::print (raw_ostream &OS, const PrintOptions & Opts) const {
46124614 StreamPrinter Printer (OS);
46134615 print (Printer, Opts);
46144616}
46154617
4616- void GenericSignature::print (ASTPrinter &Printer, PrintOptions Opts) const {
4618+ void GenericSignature::print (ASTPrinter &Printer,
4619+ const PrintOptions &Opts) const {
46174620 if (isNull ()) {
46184621 Printer << " <null>" ;
46194622 return ;
0 commit comments