@@ -205,8 +205,10 @@ class alignas(1 << TypeReprAlignInBits) TypeRepr
205205
206206 // *** Allocation Routines ************************************************/
207207
208- void print (raw_ostream &OS, const PrintOptions &Opts = PrintOptions ()) const ;
209- void print (ASTPrinter &Printer, const PrintOptions &Opts) const ;
208+ void print (raw_ostream &OS, const PrintOptions &opts = PrintOptions (),
209+ NonRecursivePrintOptions nrOpts = std::nullopt ) const ;
210+ void print (ASTPrinter &Printer, const PrintOptions &opts,
211+ NonRecursivePrintOptions nrOpts = std::nullopt ) const ;
210212 SWIFT_DEBUG_DUMP;
211213 void dump (raw_ostream &OS, unsigned indent = 0 ) const ;
212214};
@@ -252,7 +254,8 @@ class ErrorTypeRepr : public TypeRepr {
252254private:
253255 SourceLoc getStartLocImpl () const { return Range.Start ; }
254256 SourceLoc getEndLocImpl () const { return Range.End ; }
255- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
257+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
258+ NonRecursivePrintOptions nrOpts) const ;
256259 friend class TypeRepr ;
257260};
258261
@@ -303,7 +306,7 @@ class AttributedTypeRepr final
303306 ReferenceOwnership getSILOwnership () const ;
304307
305308 void printAttrs (llvm::raw_ostream &OS) const ;
306- void printAttrs (ASTPrinter &Printer, const PrintOptions &Options ) const ;
309+ void printAttrs (ASTPrinter &Printer, const PrintOptions &options ) const ;
307310
308311 static bool classof (const TypeRepr *T) {
309312 return T->getKind () == TypeReprKind::Attributed;
@@ -321,7 +324,8 @@ class AttributedTypeRepr final
321324 }
322325 SourceLoc getEndLocImpl () const { return Ty->getEndLoc (); }
323326 SourceLoc getLocImpl () const { return Ty->getLoc (); }
324- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
327+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
328+ NonRecursivePrintOptions nrOpts) const ;
325329 friend class TypeRepr ;
326330};
327331
@@ -417,7 +421,8 @@ class DeclRefTypeRepr : public TypeRepr {
417421 SourceLoc getLocImpl () const ;
418422 SourceLoc getEndLocImpl () const ;
419423
420- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
424+ void printImpl (ASTPrinter &Printer, const PrintOptions &Opts,
425+ NonRecursivePrintOptions nrOpts) const ;
421426
422427 friend class TypeRepr ;
423428};
@@ -610,7 +615,8 @@ class FunctionTypeRepr : public TypeRepr {
610615 SourceLoc getEndLocImpl () const { return RetTy->getEndLoc (); }
611616 SourceLoc getLocImpl () const { return ArrowLoc; }
612617
613- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
618+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
619+ NonRecursivePrintOptions nrOpts) const ;
614620 friend class TypeRepr ;
615621};
616622
@@ -637,7 +643,8 @@ class ArrayTypeRepr : public TypeRepr {
637643private:
638644 SourceLoc getStartLocImpl () const { return Brackets.Start ; }
639645 SourceLoc getEndLocImpl () const { return Brackets.End ; }
640- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
646+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
647+ NonRecursivePrintOptions nrOpts) const ;
641648 friend class TypeRepr ;
642649};
643650
@@ -666,7 +673,8 @@ class InlineArrayTypeRepr : public TypeRepr {
666673private:
667674 SourceLoc getStartLocImpl () const { return Brackets.Start ; }
668675 SourceLoc getEndLocImpl () const { return Brackets.End ; }
669- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
676+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
677+ NonRecursivePrintOptions nrOpts) const ;
670678 friend class TypeRepr ;
671679};
672680
@@ -699,7 +707,8 @@ class DictionaryTypeRepr : public TypeRepr {
699707private:
700708 SourceLoc getStartLocImpl () const { return Brackets.Start ; }
701709 SourceLoc getEndLocImpl () const { return Brackets.End ; }
702- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
710+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
711+ NonRecursivePrintOptions nrOpts) const ;
703712 friend class TypeRepr ;
704713};
705714
@@ -731,7 +740,8 @@ class OptionalTypeRepr : public TypeRepr {
731740 SourceLoc getLocImpl () const {
732741 return QuestionLoc.isValid () ? QuestionLoc : Base->getLoc ();
733742 }
734- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
743+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
744+ NonRecursivePrintOptions nrOpts) const ;
735745 friend class TypeRepr ;
736746};
737747
@@ -760,7 +770,8 @@ class ImplicitlyUnwrappedOptionalTypeRepr : public TypeRepr {
760770 SourceLoc getStartLocImpl () const { return Base->getStartLoc (); }
761771 SourceLoc getEndLocImpl () const { return ExclamationLoc; }
762772 SourceLoc getLocImpl () const { return ExclamationLoc; }
763- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
773+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
774+ NonRecursivePrintOptions nrOpts) const ;
764775 friend class TypeRepr ;
765776};
766777
@@ -801,7 +812,8 @@ class VarargTypeRepr final : public TypeRepr {
801812 SourceLoc getStartLocImpl () const { return Element->getEndLoc (); }
802813 SourceLoc getEndLocImpl () const { return EllipsisLoc; }
803814 SourceLoc getLocImpl () const { return EllipsisLoc; }
804- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
815+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
816+ NonRecursivePrintOptions nrOpts) const ;
805817 friend class TypeRepr ;
806818};
807819
@@ -832,7 +844,8 @@ class PackExpansionTypeRepr final : public TypeRepr {
832844 SourceLoc getStartLocImpl () const { return RepeatLoc; }
833845 SourceLoc getEndLocImpl () const { return Pattern->getEndLoc (); }
834846 SourceLoc getLocImpl () const { return RepeatLoc; }
835- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
847+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
848+ NonRecursivePrintOptions nrOpts) const ;
836849 friend class TypeRepr ;
837850};
838851
@@ -880,7 +893,8 @@ class PackTypeRepr final
880893 SourceLoc getStartLocImpl () const { return KeywordLoc; }
881894 SourceLoc getEndLocImpl () const { return BraceLocs.End ; }
882895 SourceLoc getLocImpl () const { return KeywordLoc; }
883- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
896+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
897+ NonRecursivePrintOptions nrOpts) const ;
884898 friend class TypeRepr ;
885899};
886900
@@ -915,7 +929,8 @@ class PackElementTypeRepr: public TypeRepr {
915929 SourceLoc getStartLocImpl () const { return EachLoc; }
916930 SourceLoc getEndLocImpl () const { return PackType->getEndLoc (); }
917931 SourceLoc getLocImpl () const { return EachLoc; }
918- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
932+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
933+ NonRecursivePrintOptions nrOpts) const ;
919934 friend class TypeRepr ;
920935};
921936
@@ -1010,7 +1025,8 @@ class TupleTypeRepr final : public TypeRepr,
10101025private:
10111026 SourceLoc getStartLocImpl () const { return Parens.Start ; }
10121027 SourceLoc getEndLocImpl () const { return Parens.End ; }
1013- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1028+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1029+ NonRecursivePrintOptions nrOpts) const ;
10141030 friend class TypeRepr ;
10151031};
10161032
@@ -1066,7 +1082,8 @@ class CompositionTypeRepr final : public TypeRepr,
10661082 SourceLoc getStartLocImpl () const { return FirstTypeLoc; }
10671083 SourceLoc getLocImpl () const { return CompositionRange.Start ; }
10681084 SourceLoc getEndLocImpl () const { return CompositionRange.End ; }
1069- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1085+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1086+ NonRecursivePrintOptions nrOpts) const ;
10701087 friend class TypeRepr ;
10711088};
10721089
@@ -1095,7 +1112,8 @@ class MetatypeTypeRepr : public TypeRepr {
10951112 SourceLoc getStartLocImpl () const { return Base->getStartLoc (); }
10961113 SourceLoc getEndLocImpl () const { return MetaLoc; }
10971114 SourceLoc getLocImpl () const { return MetaLoc; }
1098- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1115+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1116+ NonRecursivePrintOptions nrOpts) const ;
10991117 friend class TypeRepr ;
11001118};
11011119
@@ -1124,7 +1142,8 @@ class ProtocolTypeRepr : public TypeRepr {
11241142 SourceLoc getStartLocImpl () const { return Base->getStartLoc (); }
11251143 SourceLoc getEndLocImpl () const { return ProtocolLoc; }
11261144 SourceLoc getLocImpl () const { return ProtocolLoc; }
1127- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1145+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1146+ NonRecursivePrintOptions nrOpts) const ;
11281147 friend class TypeRepr ;
11291148};
11301149
@@ -1155,7 +1174,8 @@ class SpecifierTypeRepr : public TypeRepr {
11551174private:
11561175 SourceLoc getStartLocImpl () const { return SpecifierLoc; }
11571176 SourceLoc getEndLocImpl () const { return Base->getEndLoc (); }
1158- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1177+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1178+ NonRecursivePrintOptions nrOpts) const ;
11591179 friend class TypeRepr ;
11601180};
11611181
@@ -1274,7 +1294,8 @@ class CallerIsolatedTypeRepr : public TypeRepr {
12741294 SourceLoc getStartLocImpl () const { return Loc; }
12751295 SourceLoc getEndLocImpl () const { return Base->getEndLoc (); }
12761296 SourceLoc getLocImpl () const { return Base->getLoc (); }
1277- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1297+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1298+ NonRecursivePrintOptions nrOpts) const ;
12781299 friend class TypeRepr ;
12791300};
12801301
@@ -1311,7 +1332,8 @@ class FixedTypeRepr : public TypeRepr {
13111332private:
13121333 SourceLoc getStartLocImpl () const { return Loc; }
13131334 SourceLoc getEndLocImpl () const { return Loc; }
1314- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1335+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1336+ NonRecursivePrintOptions nrOpts) const ;
13151337 friend class TypeRepr ;
13161338};
13171339
@@ -1338,7 +1360,8 @@ class SelfTypeRepr : public TypeRepr {
13381360private:
13391361 SourceLoc getStartLocImpl () const { return Loc; }
13401362 SourceLoc getEndLocImpl () const { return Loc; }
1341- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1363+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1364+ NonRecursivePrintOptions nrOpts) const ;
13421365 friend class TypeRepr ;
13431366};
13441367
@@ -1391,7 +1414,8 @@ class OpaqueReturnTypeRepr : public TypeRepr {
13911414 SourceLoc getStartLocImpl () const { return OpaqueLoc; }
13921415 SourceLoc getEndLocImpl () const { return Constraint->getEndLoc (); }
13931416 SourceLoc getLocImpl () const { return OpaqueLoc; }
1394- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1417+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1418+ NonRecursivePrintOptions nrOpts) const ;
13951419 friend class TypeRepr ;
13961420};
13971421
@@ -1426,7 +1450,8 @@ class NamedOpaqueReturnTypeRepr : public TypeRepr {
14261450 SourceLoc getStartLocImpl () const ;
14271451 SourceLoc getEndLocImpl () const ;
14281452 SourceLoc getLocImpl () const ;
1429- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1453+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1454+ NonRecursivePrintOptions nrOpts) const ;
14301455 friend class TypeRepr ;
14311456};
14321457
@@ -1455,7 +1480,8 @@ class ExistentialTypeRepr: public TypeRepr {
14551480 SourceLoc getStartLocImpl () const { return AnyLoc; }
14561481 SourceLoc getEndLocImpl () const { return Constraint->getEndLoc (); }
14571482 SourceLoc getLocImpl () const { return AnyLoc; }
1458- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1483+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1484+ NonRecursivePrintOptions nrOpts) const ;
14591485 friend class TypeRepr ;
14601486};
14611487
@@ -1483,7 +1509,8 @@ class InverseTypeRepr : public TypeRepr {
14831509 SourceLoc getStartLocImpl () const { return TildeLoc; }
14841510 SourceLoc getEndLocImpl () const { return Constraint->getEndLoc (); }
14851511 SourceLoc getLocImpl () const { return TildeLoc; }
1486- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1512+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1513+ NonRecursivePrintOptions nrOpts) const ;
14871514 friend class TypeRepr ;
14881515};
14891516
@@ -1511,7 +1538,8 @@ class PlaceholderTypeRepr: public TypeRepr {
15111538 SourceLoc getStartLocImpl () const { return UnderscoreLoc; }
15121539 SourceLoc getEndLocImpl () const { return UnderscoreLoc; }
15131540 SourceLoc getLocImpl () const { return UnderscoreLoc; }
1514- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1541+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1542+ NonRecursivePrintOptions nrOpts) const ;
15151543 friend class TypeRepr ;
15161544};
15171545
@@ -1600,7 +1628,8 @@ class SILBoxTypeRepr final : public TypeRepr,
16001628 SourceLoc getStartLocImpl () const ;
16011629 SourceLoc getEndLocImpl () const ;
16021630 SourceLoc getLocImpl () const ;
1603- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1631+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1632+ NonRecursivePrintOptions nrOpts) const ;
16041633 friend TypeRepr;
16051634};
16061635
@@ -1627,7 +1656,8 @@ class LifetimeDependentTypeRepr final : public SpecifierTypeRepr {
16271656 SourceLoc getStartLocImpl () const ;
16281657 SourceLoc getEndLocImpl () const ;
16291658 SourceLoc getLocImpl () const ;
1630- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1659+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1660+ NonRecursivePrintOptions nrOpts) const ;
16311661 friend class TypeRepr ;
16321662};
16331663
@@ -1668,7 +1698,8 @@ class IntegerTypeRepr final : public TypeRepr {
16681698
16691699 SourceLoc getEndLocImpl () const { return Loc; }
16701700 SourceLoc getLocImpl () const { return Loc; }
1671- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1701+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1702+ NonRecursivePrintOptions nrOpts) const ;
16721703 friend class TypeRepr ;
16731704};
16741705
0 commit comments