@@ -205,8 +205,10 @@ class alignas(1 << TypeReprAlignInBits) TypeRepr
205
205
206
206
// *** Allocation Routines ************************************************/
207
207
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 ;
210
212
SWIFT_DEBUG_DUMP;
211
213
void dump (raw_ostream &OS, unsigned indent = 0 ) const ;
212
214
};
@@ -252,7 +254,8 @@ class ErrorTypeRepr : public TypeRepr {
252
254
private:
253
255
SourceLoc getStartLocImpl () const { return Range.Start ; }
254
256
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 ;
256
259
friend class TypeRepr ;
257
260
};
258
261
@@ -303,7 +306,7 @@ class AttributedTypeRepr final
303
306
ReferenceOwnership getSILOwnership () const ;
304
307
305
308
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 ;
307
310
308
311
static bool classof (const TypeRepr *T) {
309
312
return T->getKind () == TypeReprKind::Attributed;
@@ -321,7 +324,8 @@ class AttributedTypeRepr final
321
324
}
322
325
SourceLoc getEndLocImpl () const { return Ty->getEndLoc (); }
323
326
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 ;
325
329
friend class TypeRepr ;
326
330
};
327
331
@@ -417,7 +421,8 @@ class DeclRefTypeRepr : public TypeRepr {
417
421
SourceLoc getLocImpl () const ;
418
422
SourceLoc getEndLocImpl () const ;
419
423
420
- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
424
+ void printImpl (ASTPrinter &Printer, const PrintOptions &Opts,
425
+ NonRecursivePrintOptions nrOpts) const ;
421
426
422
427
friend class TypeRepr ;
423
428
};
@@ -610,7 +615,8 @@ class FunctionTypeRepr : public TypeRepr {
610
615
SourceLoc getEndLocImpl () const { return RetTy->getEndLoc (); }
611
616
SourceLoc getLocImpl () const { return ArrowLoc; }
612
617
613
- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
618
+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
619
+ NonRecursivePrintOptions nrOpts) const ;
614
620
friend class TypeRepr ;
615
621
};
616
622
@@ -637,7 +643,8 @@ class ArrayTypeRepr : public TypeRepr {
637
643
private:
638
644
SourceLoc getStartLocImpl () const { return Brackets.Start ; }
639
645
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 ;
641
648
friend class TypeRepr ;
642
649
};
643
650
@@ -666,7 +673,8 @@ class InlineArrayTypeRepr : public TypeRepr {
666
673
private:
667
674
SourceLoc getStartLocImpl () const { return Brackets.Start ; }
668
675
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 ;
670
678
friend class TypeRepr ;
671
679
};
672
680
@@ -699,7 +707,8 @@ class DictionaryTypeRepr : public TypeRepr {
699
707
private:
700
708
SourceLoc getStartLocImpl () const { return Brackets.Start ; }
701
709
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 ;
703
712
friend class TypeRepr ;
704
713
};
705
714
@@ -731,7 +740,8 @@ class OptionalTypeRepr : public TypeRepr {
731
740
SourceLoc getLocImpl () const {
732
741
return QuestionLoc.isValid () ? QuestionLoc : Base->getLoc ();
733
742
}
734
- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
743
+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
744
+ NonRecursivePrintOptions nrOpts) const ;
735
745
friend class TypeRepr ;
736
746
};
737
747
@@ -760,7 +770,8 @@ class ImplicitlyUnwrappedOptionalTypeRepr : public TypeRepr {
760
770
SourceLoc getStartLocImpl () const { return Base->getStartLoc (); }
761
771
SourceLoc getEndLocImpl () const { return ExclamationLoc; }
762
772
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 ;
764
775
friend class TypeRepr ;
765
776
};
766
777
@@ -801,7 +812,8 @@ class VarargTypeRepr final : public TypeRepr {
801
812
SourceLoc getStartLocImpl () const { return Element->getEndLoc (); }
802
813
SourceLoc getEndLocImpl () const { return EllipsisLoc; }
803
814
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 ;
805
817
friend class TypeRepr ;
806
818
};
807
819
@@ -832,7 +844,8 @@ class PackExpansionTypeRepr final : public TypeRepr {
832
844
SourceLoc getStartLocImpl () const { return RepeatLoc; }
833
845
SourceLoc getEndLocImpl () const { return Pattern->getEndLoc (); }
834
846
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 ;
836
849
friend class TypeRepr ;
837
850
};
838
851
@@ -880,7 +893,8 @@ class PackTypeRepr final
880
893
SourceLoc getStartLocImpl () const { return KeywordLoc; }
881
894
SourceLoc getEndLocImpl () const { return BraceLocs.End ; }
882
895
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 ;
884
898
friend class TypeRepr ;
885
899
};
886
900
@@ -915,7 +929,8 @@ class PackElementTypeRepr: public TypeRepr {
915
929
SourceLoc getStartLocImpl () const { return EachLoc; }
916
930
SourceLoc getEndLocImpl () const { return PackType->getEndLoc (); }
917
931
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 ;
919
934
friend class TypeRepr ;
920
935
};
921
936
@@ -1010,7 +1025,8 @@ class TupleTypeRepr final : public TypeRepr,
1010
1025
private:
1011
1026
SourceLoc getStartLocImpl () const { return Parens.Start ; }
1012
1027
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 ;
1014
1030
friend class TypeRepr ;
1015
1031
};
1016
1032
@@ -1066,7 +1082,8 @@ class CompositionTypeRepr final : public TypeRepr,
1066
1082
SourceLoc getStartLocImpl () const { return FirstTypeLoc; }
1067
1083
SourceLoc getLocImpl () const { return CompositionRange.Start ; }
1068
1084
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 ;
1070
1087
friend class TypeRepr ;
1071
1088
};
1072
1089
@@ -1095,7 +1112,8 @@ class MetatypeTypeRepr : public TypeRepr {
1095
1112
SourceLoc getStartLocImpl () const { return Base->getStartLoc (); }
1096
1113
SourceLoc getEndLocImpl () const { return MetaLoc; }
1097
1114
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 ;
1099
1117
friend class TypeRepr ;
1100
1118
};
1101
1119
@@ -1124,7 +1142,8 @@ class ProtocolTypeRepr : public TypeRepr {
1124
1142
SourceLoc getStartLocImpl () const { return Base->getStartLoc (); }
1125
1143
SourceLoc getEndLocImpl () const { return ProtocolLoc; }
1126
1144
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 ;
1128
1147
friend class TypeRepr ;
1129
1148
};
1130
1149
@@ -1155,7 +1174,8 @@ class SpecifierTypeRepr : public TypeRepr {
1155
1174
private:
1156
1175
SourceLoc getStartLocImpl () const { return SpecifierLoc; }
1157
1176
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 ;
1159
1179
friend class TypeRepr ;
1160
1180
};
1161
1181
@@ -1274,7 +1294,8 @@ class CallerIsolatedTypeRepr : public TypeRepr {
1274
1294
SourceLoc getStartLocImpl () const { return Loc; }
1275
1295
SourceLoc getEndLocImpl () const { return Base->getEndLoc (); }
1276
1296
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 ;
1278
1299
friend class TypeRepr ;
1279
1300
};
1280
1301
@@ -1311,7 +1332,8 @@ class FixedTypeRepr : public TypeRepr {
1311
1332
private:
1312
1333
SourceLoc getStartLocImpl () const { return Loc; }
1313
1334
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 ;
1315
1337
friend class TypeRepr ;
1316
1338
};
1317
1339
@@ -1338,7 +1360,8 @@ class SelfTypeRepr : public TypeRepr {
1338
1360
private:
1339
1361
SourceLoc getStartLocImpl () const { return Loc; }
1340
1362
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 ;
1342
1365
friend class TypeRepr ;
1343
1366
};
1344
1367
@@ -1391,7 +1414,8 @@ class OpaqueReturnTypeRepr : public TypeRepr {
1391
1414
SourceLoc getStartLocImpl () const { return OpaqueLoc; }
1392
1415
SourceLoc getEndLocImpl () const { return Constraint->getEndLoc (); }
1393
1416
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 ;
1395
1419
friend class TypeRepr ;
1396
1420
};
1397
1421
@@ -1426,7 +1450,8 @@ class NamedOpaqueReturnTypeRepr : public TypeRepr {
1426
1450
SourceLoc getStartLocImpl () const ;
1427
1451
SourceLoc getEndLocImpl () const ;
1428
1452
SourceLoc getLocImpl () const ;
1429
- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1453
+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1454
+ NonRecursivePrintOptions nrOpts) const ;
1430
1455
friend class TypeRepr ;
1431
1456
};
1432
1457
@@ -1455,7 +1480,8 @@ class ExistentialTypeRepr: public TypeRepr {
1455
1480
SourceLoc getStartLocImpl () const { return AnyLoc; }
1456
1481
SourceLoc getEndLocImpl () const { return Constraint->getEndLoc (); }
1457
1482
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 ;
1459
1485
friend class TypeRepr ;
1460
1486
};
1461
1487
@@ -1483,7 +1509,8 @@ class InverseTypeRepr : public TypeRepr {
1483
1509
SourceLoc getStartLocImpl () const { return TildeLoc; }
1484
1510
SourceLoc getEndLocImpl () const { return Constraint->getEndLoc (); }
1485
1511
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 ;
1487
1514
friend class TypeRepr ;
1488
1515
};
1489
1516
@@ -1511,7 +1538,8 @@ class PlaceholderTypeRepr: public TypeRepr {
1511
1538
SourceLoc getStartLocImpl () const { return UnderscoreLoc; }
1512
1539
SourceLoc getEndLocImpl () const { return UnderscoreLoc; }
1513
1540
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 ;
1515
1543
friend class TypeRepr ;
1516
1544
};
1517
1545
@@ -1600,7 +1628,8 @@ class SILBoxTypeRepr final : public TypeRepr,
1600
1628
SourceLoc getStartLocImpl () const ;
1601
1629
SourceLoc getEndLocImpl () const ;
1602
1630
SourceLoc getLocImpl () const ;
1603
- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1631
+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1632
+ NonRecursivePrintOptions nrOpts) const ;
1604
1633
friend TypeRepr;
1605
1634
};
1606
1635
@@ -1627,7 +1656,8 @@ class LifetimeDependentTypeRepr final : public SpecifierTypeRepr {
1627
1656
SourceLoc getStartLocImpl () const ;
1628
1657
SourceLoc getEndLocImpl () const ;
1629
1658
SourceLoc getLocImpl () const ;
1630
- void printImpl (ASTPrinter &Printer, const PrintOptions &Opts) const ;
1659
+ void printImpl (ASTPrinter &Printer, const PrintOptions &opts,
1660
+ NonRecursivePrintOptions nrOpts) const ;
1631
1661
friend class TypeRepr ;
1632
1662
};
1633
1663
@@ -1668,7 +1698,8 @@ class IntegerTypeRepr final : public TypeRepr {
1668
1698
1669
1699
SourceLoc getEndLocImpl () const { return Loc; }
1670
1700
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 ;
1672
1703
friend class TypeRepr ;
1673
1704
};
1674
1705
0 commit comments