@@ -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 ;
@@ -1081,7 +1081,7 @@ void PrintAST::printTypedPattern(const TypedPattern *TP) {
1081
1081
1082
1082
// / Determines if we are required to print the name of a property declaration,
1083
1083
// / 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) {
1085
1085
// If we're not allowed to omit the name, we must print it.
1086
1086
if (!opts.OmitNameOfInaccessibleProperties ) return true ;
1087
1087
@@ -2636,8 +2636,10 @@ static bool isEscaping(Type type) {
2636
2636
return false ;
2637
2637
}
2638
2638
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) {
2641
2643
if (!options.excludeAttrKind (TAK_autoclosure) && flags.isAutoClosure ())
2642
2644
printer.printAttrName (" @autoclosure " );
2643
2645
if (!options.excludeAttrKind (TAK_noDerivative) && flags.isNoDerivative ())
@@ -4680,12 +4682,13 @@ void GenericSignatureImpl::print(ASTPrinter &Printer, PrintOptions PO) const {
4680
4682
GenericSignature (const_cast <GenericSignatureImpl *>(this )).print (Printer, PO);
4681
4683
}
4682
4684
4683
- void GenericSignature::print (raw_ostream &OS, PrintOptions Opts) const {
4685
+ void GenericSignature::print (raw_ostream &OS, const PrintOptions & Opts) const {
4684
4686
StreamPrinter Printer (OS);
4685
4687
print (Printer, Opts);
4686
4688
}
4687
4689
4688
- void GenericSignature::print (ASTPrinter &Printer, PrintOptions Opts) const {
4690
+ void GenericSignature::print (ASTPrinter &Printer,
4691
+ const PrintOptions &Opts) const {
4689
4692
if (isNull ()) {
4690
4693
Printer << " <null>" ;
4691
4694
return ;
0 commit comments