@@ -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 ;
@@ -1081,7 +1081,7 @@ void PrintAST::printTypedPattern(const TypedPattern *TP) {
10811081
10821082// / Determines if we are required to print the name of a property declaration,
10831083// / or if we can elide it by printing a '_' instead.
1084- static bool mustPrintPropertyName (VarDecl *decl, PrintOptions opts) {
1084+ static bool mustPrintPropertyName (VarDecl *decl, const PrintOptions & opts) {
10851085 // If we're not allowed to omit the name, we must print it.
10861086 if (!opts.OmitNameOfInaccessibleProperties ) return true ;
10871087
@@ -2636,8 +2636,10 @@ static bool isEscaping(Type type) {
26362636 return false ;
26372637}
26382638
2639- static void printParameterFlags (ASTPrinter &printer, PrintOptions options,
2640- ParameterTypeFlags flags, bool escaping) {
2639+ static void printParameterFlags (ASTPrinter &printer,
2640+ const PrintOptions &options,
2641+ ParameterTypeFlags flags,
2642+ bool escaping) {
26412643 if (!options.excludeAttrKind (TAK_autoclosure) && flags.isAutoClosure ())
26422644 printer.printAttrName (" @autoclosure " );
26432645 if (!options.excludeAttrKind (TAK_noDerivative) && flags.isNoDerivative ())
@@ -4680,12 +4682,13 @@ void GenericSignatureImpl::print(ASTPrinter &Printer, PrintOptions PO) const {
46804682 GenericSignature (const_cast <GenericSignatureImpl *>(this )).print (Printer, PO);
46814683}
46824684
4683- void GenericSignature::print (raw_ostream &OS, PrintOptions Opts) const {
4685+ void GenericSignature::print (raw_ostream &OS, const PrintOptions & Opts) const {
46844686 StreamPrinter Printer (OS);
46854687 print (Printer, Opts);
46864688}
46874689
4688- void GenericSignature::print (ASTPrinter &Printer, PrintOptions Opts) const {
4690+ void GenericSignature::print (ASTPrinter &Printer,
4691+ const PrintOptions &Opts) const {
46894692 if (isNull ()) {
46904693 Printer << " <null>" ;
46914694 return ;
0 commit comments