@@ -281,9 +281,9 @@ class Node {
281
281
}
282
282
283
283
void print (OutputBuffer &OB) const {
284
- printLeft (OB );
284
+ OB. printLeft (* this );
285
285
if (RHSComponentCache != Cache::No)
286
- printRight (OB );
286
+ OB. printRight (* this );
287
287
}
288
288
289
289
// Print the "left" side of this Node into OutputBuffer.
@@ -458,11 +458,11 @@ class QualType final : public Node {
458
458
}
459
459
460
460
void printLeft (OutputBuffer &OB) const override {
461
- Child-> printLeft (OB );
461
+ OB. printLeft (*Child );
462
462
printQuals (OB);
463
463
}
464
464
465
- void printRight (OutputBuffer &OB) const override { Child-> printRight (OB ); }
465
+ void printRight (OutputBuffer &OB) const override { OB. printRight (*Child ); }
466
466
};
467
467
468
468
class ConversionOperatorType final : public Node {
@@ -491,7 +491,7 @@ class PostfixQualifiedType final : public Node {
491
491
template <typename Fn> void match (Fn F) const { F (Ty, Postfix); }
492
492
493
493
void printLeft (OutputBuffer &OB) const override {
494
- Ty-> printLeft (OB );
494
+ OB. printLeft (*Ty );
495
495
OB += Postfix;
496
496
}
497
497
};
@@ -577,7 +577,7 @@ struct AbiTagAttr : Node {
577
577
std::string_view getBaseName () const override { return Base->getBaseName (); }
578
578
579
579
void printLeft (OutputBuffer &OB) const override {
580
- Base-> printLeft (OB );
580
+ OB. printLeft (*Base );
581
581
OB += " [abi:" ;
582
582
OB += Tag;
583
583
OB += " ]" ;
@@ -644,7 +644,7 @@ class PointerType final : public Node {
644
644
// We rewrite objc_object<SomeProtocol>* into id<SomeProtocol>.
645
645
if (Pointee->getKind () != KObjCProtoName ||
646
646
!static_cast <const ObjCProtoName *>(Pointee)->isObjCObject ()) {
647
- Pointee-> printLeft (OB );
647
+ OB. printLeft (*Pointee );
648
648
if (Pointee->hasArray (OB))
649
649
OB += " " ;
650
650
if (Pointee->hasArray (OB) || Pointee->hasFunction (OB))
@@ -663,7 +663,7 @@ class PointerType final : public Node {
663
663
!static_cast <const ObjCProtoName *>(Pointee)->isObjCObject ()) {
664
664
if (Pointee->hasArray (OB) || Pointee->hasFunction (OB))
665
665
OB += " )" ;
666
- Pointee-> printRight (OB );
666
+ OB. printRight (*Pointee );
667
667
}
668
668
}
669
669
};
@@ -729,7 +729,7 @@ class ReferenceType : public Node {
729
729
std::pair<ReferenceKind, const Node *> Collapsed = collapse (OB);
730
730
if (!Collapsed.second )
731
731
return ;
732
- Collapsed. second -> printLeft (OB );
732
+ OB. printLeft (*Collapsed. second );
733
733
if (Collapsed.second ->hasArray (OB))
734
734
OB += " " ;
735
735
if (Collapsed.second ->hasArray (OB) || Collapsed.second ->hasFunction (OB))
@@ -746,7 +746,7 @@ class ReferenceType : public Node {
746
746
return ;
747
747
if (Collapsed.second ->hasArray (OB) || Collapsed.second ->hasFunction (OB))
748
748
OB += " )" ;
749
- Collapsed. second -> printRight (OB );
749
+ OB. printRight (*Collapsed. second );
750
750
}
751
751
};
752
752
@@ -766,7 +766,7 @@ class PointerToMemberType final : public Node {
766
766
}
767
767
768
768
void printLeft (OutputBuffer &OB) const override {
769
- MemberType-> printLeft (OB );
769
+ OB. printLeft (*MemberType );
770
770
if (MemberType->hasArray (OB) || MemberType->hasFunction (OB))
771
771
OB += " (" ;
772
772
else
@@ -778,7 +778,7 @@ class PointerToMemberType final : public Node {
778
778
void printRight (OutputBuffer &OB) const override {
779
779
if (MemberType->hasArray (OB) || MemberType->hasFunction (OB))
780
780
OB += " )" ;
781
- MemberType-> printRight (OB );
781
+ OB. printRight (*MemberType );
782
782
}
783
783
};
784
784
@@ -798,7 +798,7 @@ class ArrayType final : public Node {
798
798
bool hasRHSComponentSlow (OutputBuffer &) const override { return true ; }
799
799
bool hasArraySlow (OutputBuffer &) const override { return true ; }
800
800
801
- void printLeft (OutputBuffer &OB) const override { Base-> printLeft (OB ); }
801
+ void printLeft (OutputBuffer &OB) const override { OB. printLeft (*Base ); }
802
802
803
803
void printRight (OutputBuffer &OB) const override {
804
804
if (OB.back () != ' ]' )
@@ -807,7 +807,7 @@ class ArrayType final : public Node {
807
807
if (Dimension)
808
808
Dimension->print (OB);
809
809
OB += " ]" ;
810
- Base-> printRight (OB );
810
+ OB. printRight (*Base );
811
811
}
812
812
813
813
bool printInitListAsType (OutputBuffer &OB,
@@ -851,15 +851,15 @@ class FunctionType final : public Node {
851
851
// by printing out the return types's left, then print our parameters, then
852
852
// finally print right of the return type.
853
853
void printLeft (OutputBuffer &OB) const override {
854
- Ret-> printLeft (OB );
854
+ OB. printLeft (*Ret );
855
855
OB += " " ;
856
856
}
857
857
858
858
void printRight (OutputBuffer &OB) const override {
859
859
OB.printOpen ();
860
860
Params.printWithComma (OB);
861
861
OB.printClose ();
862
- Ret-> printRight (OB );
862
+ OB. printRight (*Ret );
863
863
864
864
if (CVQuals & QualConst)
865
865
OB += " const" ;
@@ -964,6 +964,8 @@ class FunctionEncoding final : public Node {
964
964
FunctionRefQual getRefQual () const { return RefQual; }
965
965
NodeArray getParams () const { return Params; }
966
966
const Node *getReturnType () const { return Ret; }
967
+ const Node *getAttrs () const { return Attrs; }
968
+ const Node *getRequires () const { return Requires; }
967
969
968
970
bool hasRHSComponentSlow (OutputBuffer &) const override { return true ; }
969
971
bool hasFunctionSlow (OutputBuffer &) const override { return true ; }
@@ -972,19 +974,21 @@ class FunctionEncoding final : public Node {
972
974
973
975
void printLeft (OutputBuffer &OB) const override {
974
976
if (Ret) {
975
- Ret-> printLeft (OB );
977
+ OB. printLeft (*Ret );
976
978
if (!Ret->hasRHSComponent (OB))
977
979
OB += " " ;
978
980
}
981
+
979
982
Name->print (OB);
980
983
}
981
984
982
985
void printRight (OutputBuffer &OB) const override {
983
986
OB.printOpen ();
984
987
Params.printWithComma (OB);
985
988
OB.printClose ();
989
+
986
990
if (Ret)
987
- Ret-> printRight (OB );
991
+ OB. printRight (*Ret );
988
992
989
993
if (CVQuals & QualConst)
990
994
OB += " const" ;
@@ -1324,14 +1328,14 @@ class NonTypeTemplateParamDecl final : public Node {
1324
1328
template <typename Fn> void match (Fn F) const { F (Name, Type); }
1325
1329
1326
1330
void printLeft (OutputBuffer &OB) const override {
1327
- Type-> printLeft (OB );
1331
+ OB. printLeft (*Type );
1328
1332
if (!Type->hasRHSComponent (OB))
1329
1333
OB += " " ;
1330
1334
}
1331
1335
1332
1336
void printRight (OutputBuffer &OB) const override {
1333
1337
Name->print (OB);
1334
- Type-> printRight (OB );
1338
+ OB. printRight (*Type );
1335
1339
}
1336
1340
};
1337
1341
@@ -1376,11 +1380,11 @@ class TemplateParamPackDecl final : public Node {
1376
1380
template <typename Fn> void match (Fn F) const { F (Param); }
1377
1381
1378
1382
void printLeft (OutputBuffer &OB) const override {
1379
- Param-> printLeft (OB );
1383
+ OB. printLeft (*Param );
1380
1384
OB += " ..." ;
1381
1385
}
1382
1386
1383
- void printRight (OutputBuffer &OB) const override { Param-> printRight (OB ); }
1387
+ void printRight (OutputBuffer &OB) const override { OB. printRight (*Param ); }
1384
1388
};
1385
1389
1386
1390
// / An unexpanded parameter pack (either in the expression or type context). If
@@ -1445,13 +1449,13 @@ class ParameterPack final : public Node {
1445
1449
initializePackExpansion (OB);
1446
1450
size_t Idx = OB.CurrentPackIndex ;
1447
1451
if (Idx < Data.size ())
1448
- Data[Idx]-> printLeft (OB );
1452
+ OB. printLeft (* Data[Idx]);
1449
1453
}
1450
1454
void printRight (OutputBuffer &OB) const override {
1451
1455
initializePackExpansion (OB);
1452
1456
size_t Idx = OB.CurrentPackIndex ;
1453
1457
if (Idx < Data.size ())
1454
- Data[Idx]-> printRight (OB );
1458
+ OB. printRight (* Data[Idx]);
1455
1459
}
1456
1460
};
1457
1461
@@ -1609,13 +1613,13 @@ struct ForwardTemplateReference : Node {
1609
1613
if (Printing)
1610
1614
return ;
1611
1615
ScopedOverride<bool > SavePrinting (Printing, true );
1612
- Ref-> printLeft (OB );
1616
+ OB. printLeft (*Ref );
1613
1617
}
1614
1618
void printRight (OutputBuffer &OB) const override {
1615
1619
if (Printing)
1616
1620
return ;
1617
1621
ScopedOverride<bool > SavePrinting (Printing, true );
1618
- Ref-> printRight (OB );
1622
+ OB. printRight (*Ref );
1619
1623
}
1620
1624
};
1621
1625
@@ -1767,7 +1771,7 @@ class DtorName : public Node {
1767
1771
1768
1772
void printLeft (OutputBuffer &OB) const override {
1769
1773
OB += " ~" ;
1770
- Base-> printLeft (OB );
1774
+ OB. printLeft (*Base );
1771
1775
}
1772
1776
};
1773
1777
@@ -2047,7 +2051,7 @@ class CastExpr : public Node {
2047
2051
{
2048
2052
ScopedOverride<unsigned > LT (OB.GtIsGt , 0 );
2049
2053
OB += " <" ;
2050
- To-> printLeft (OB );
2054
+ OB. printLeft (*To );
2051
2055
OB += " >" ;
2052
2056
}
2053
2057
OB.printOpen ();
@@ -6176,6 +6180,10 @@ struct ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {
6176
6180
Alloc>::AbstractManglingParser;
6177
6181
};
6178
6182
6183
+ inline void OutputBuffer::printLeft (const Node &N) { N.printLeft (*this ); }
6184
+
6185
+ inline void OutputBuffer::printRight (const Node &N) { N.printRight (*this ); }
6186
+
6179
6187
DEMANGLE_NAMESPACE_END
6180
6188
6181
6189
#if defined(__clang__)
0 commit comments