@@ -281,9 +281,9 @@ class Node {
281281 }
282282
283283 void print (OutputBuffer &OB) const {
284- printLeft (OB );
284+ OB. printLeft (* this );
285285 if (RHSComponentCache != Cache::No)
286- printRight (OB );
286+ OB. printRight (* this );
287287 }
288288
289289 // Print the "left" side of this Node into OutputBuffer.
@@ -458,11 +458,11 @@ class QualType final : public Node {
458458 }
459459
460460 void printLeft (OutputBuffer &OB) const override {
461- Child-> printLeft (OB );
461+ OB. printLeft (*Child );
462462 printQuals (OB);
463463 }
464464
465- void printRight (OutputBuffer &OB) const override { Child-> printRight (OB ); }
465+ void printRight (OutputBuffer &OB) const override { OB. printRight (*Child ); }
466466};
467467
468468class ConversionOperatorType final : public Node {
@@ -491,7 +491,7 @@ class PostfixQualifiedType final : public Node {
491491 template <typename Fn> void match (Fn F) const { F (Ty, Postfix); }
492492
493493 void printLeft (OutputBuffer &OB) const override {
494- Ty-> printLeft (OB );
494+ OB. printLeft (*Ty );
495495 OB += Postfix;
496496 }
497497};
@@ -577,7 +577,7 @@ struct AbiTagAttr : Node {
577577 std::string_view getBaseName () const override { return Base->getBaseName (); }
578578
579579 void printLeft (OutputBuffer &OB) const override {
580- Base-> printLeft (OB );
580+ OB. printLeft (*Base );
581581 OB += " [abi:" ;
582582 OB += Tag;
583583 OB += " ]" ;
@@ -644,7 +644,7 @@ class PointerType final : public Node {
644644 // We rewrite objc_object<SomeProtocol>* into id<SomeProtocol>.
645645 if (Pointee->getKind () != KObjCProtoName ||
646646 !static_cast <const ObjCProtoName *>(Pointee)->isObjCObject ()) {
647- Pointee-> printLeft (OB );
647+ OB. printLeft (*Pointee );
648648 if (Pointee->hasArray (OB))
649649 OB += " " ;
650650 if (Pointee->hasArray (OB) || Pointee->hasFunction (OB))
@@ -663,7 +663,7 @@ class PointerType final : public Node {
663663 !static_cast <const ObjCProtoName *>(Pointee)->isObjCObject ()) {
664664 if (Pointee->hasArray (OB) || Pointee->hasFunction (OB))
665665 OB += " )" ;
666- Pointee-> printRight (OB );
666+ OB. printRight (*Pointee );
667667 }
668668 }
669669};
@@ -729,7 +729,7 @@ class ReferenceType : public Node {
729729 std::pair<ReferenceKind, const Node *> Collapsed = collapse (OB);
730730 if (!Collapsed.second )
731731 return ;
732- Collapsed. second -> printLeft (OB );
732+ OB. printLeft (*Collapsed. second );
733733 if (Collapsed.second ->hasArray (OB))
734734 OB += " " ;
735735 if (Collapsed.second ->hasArray (OB) || Collapsed.second ->hasFunction (OB))
@@ -746,7 +746,7 @@ class ReferenceType : public Node {
746746 return ;
747747 if (Collapsed.second ->hasArray (OB) || Collapsed.second ->hasFunction (OB))
748748 OB += " )" ;
749- Collapsed. second -> printRight (OB );
749+ OB. printRight (*Collapsed. second );
750750 }
751751};
752752
@@ -766,7 +766,7 @@ class PointerToMemberType final : public Node {
766766 }
767767
768768 void printLeft (OutputBuffer &OB) const override {
769- MemberType-> printLeft (OB );
769+ OB. printLeft (*MemberType );
770770 if (MemberType->hasArray (OB) || MemberType->hasFunction (OB))
771771 OB += " (" ;
772772 else
@@ -778,7 +778,7 @@ class PointerToMemberType final : public Node {
778778 void printRight (OutputBuffer &OB) const override {
779779 if (MemberType->hasArray (OB) || MemberType->hasFunction (OB))
780780 OB += " )" ;
781- MemberType-> printRight (OB );
781+ OB. printRight (*MemberType );
782782 }
783783};
784784
@@ -798,7 +798,7 @@ class ArrayType final : public Node {
798798 bool hasRHSComponentSlow (OutputBuffer &) const override { return true ; }
799799 bool hasArraySlow (OutputBuffer &) const override { return true ; }
800800
801- void printLeft (OutputBuffer &OB) const override { Base-> printLeft (OB ); }
801+ void printLeft (OutputBuffer &OB) const override { OB. printLeft (*Base ); }
802802
803803 void printRight (OutputBuffer &OB) const override {
804804 if (OB.back () != ' ]' )
@@ -807,7 +807,7 @@ class ArrayType final : public Node {
807807 if (Dimension)
808808 Dimension->print (OB);
809809 OB += " ]" ;
810- Base-> printRight (OB );
810+ OB. printRight (*Base );
811811 }
812812
813813 bool printInitListAsType (OutputBuffer &OB,
@@ -851,15 +851,15 @@ class FunctionType final : public Node {
851851 // by printing out the return types's left, then print our parameters, then
852852 // finally print right of the return type.
853853 void printLeft (OutputBuffer &OB) const override {
854- Ret-> printLeft (OB );
854+ OB. printLeft (*Ret );
855855 OB += " " ;
856856 }
857857
858858 void printRight (OutputBuffer &OB) const override {
859859 OB.printOpen ();
860860 Params.printWithComma (OB);
861861 OB.printClose ();
862- Ret-> printRight (OB );
862+ OB. printRight (*Ret );
863863
864864 if (CVQuals & QualConst)
865865 OB += " const" ;
@@ -964,6 +964,8 @@ class FunctionEncoding final : public Node {
964964 FunctionRefQual getRefQual () const { return RefQual; }
965965 NodeArray getParams () const { return Params; }
966966 const Node *getReturnType () const { return Ret; }
967+ const Node *getAttrs () const { return Attrs; }
968+ const Node *getRequires () const { return Requires; }
967969
968970 bool hasRHSComponentSlow (OutputBuffer &) const override { return true ; }
969971 bool hasFunctionSlow (OutputBuffer &) const override { return true ; }
@@ -972,19 +974,21 @@ class FunctionEncoding final : public Node {
972974
973975 void printLeft (OutputBuffer &OB) const override {
974976 if (Ret) {
975- Ret-> printLeft (OB );
977+ OB. printLeft (*Ret );
976978 if (!Ret->hasRHSComponent (OB))
977979 OB += " " ;
978980 }
981+
979982 Name->print (OB);
980983 }
981984
982985 void printRight (OutputBuffer &OB) const override {
983986 OB.printOpen ();
984987 Params.printWithComma (OB);
985988 OB.printClose ();
989+
986990 if (Ret)
987- Ret-> printRight (OB );
991+ OB. printRight (*Ret );
988992
989993 if (CVQuals & QualConst)
990994 OB += " const" ;
@@ -1324,14 +1328,14 @@ class NonTypeTemplateParamDecl final : public Node {
13241328 template <typename Fn> void match (Fn F) const { F (Name, Type); }
13251329
13261330 void printLeft (OutputBuffer &OB) const override {
1327- Type-> printLeft (OB );
1331+ OB. printLeft (*Type );
13281332 if (!Type->hasRHSComponent (OB))
13291333 OB += " " ;
13301334 }
13311335
13321336 void printRight (OutputBuffer &OB) const override {
13331337 Name->print (OB);
1334- Type-> printRight (OB );
1338+ OB. printRight (*Type );
13351339 }
13361340};
13371341
@@ -1376,11 +1380,11 @@ class TemplateParamPackDecl final : public Node {
13761380 template <typename Fn> void match (Fn F) const { F (Param); }
13771381
13781382 void printLeft (OutputBuffer &OB) const override {
1379- Param-> printLeft (OB );
1383+ OB. printLeft (*Param );
13801384 OB += " ..." ;
13811385 }
13821386
1383- void printRight (OutputBuffer &OB) const override { Param-> printRight (OB ); }
1387+ void printRight (OutputBuffer &OB) const override { OB. printRight (*Param ); }
13841388};
13851389
13861390// / An unexpanded parameter pack (either in the expression or type context). If
@@ -1445,13 +1449,13 @@ class ParameterPack final : public Node {
14451449 initializePackExpansion (OB);
14461450 size_t Idx = OB.CurrentPackIndex ;
14471451 if (Idx < Data.size ())
1448- Data[Idx]-> printLeft (OB );
1452+ OB. printLeft (* Data[Idx]);
14491453 }
14501454 void printRight (OutputBuffer &OB) const override {
14511455 initializePackExpansion (OB);
14521456 size_t Idx = OB.CurrentPackIndex ;
14531457 if (Idx < Data.size ())
1454- Data[Idx]-> printRight (OB );
1458+ OB. printRight (* Data[Idx]);
14551459 }
14561460};
14571461
@@ -1609,13 +1613,13 @@ struct ForwardTemplateReference : Node {
16091613 if (Printing)
16101614 return ;
16111615 ScopedOverride<bool > SavePrinting (Printing, true );
1612- Ref-> printLeft (OB );
1616+ OB. printLeft (*Ref );
16131617 }
16141618 void printRight (OutputBuffer &OB) const override {
16151619 if (Printing)
16161620 return ;
16171621 ScopedOverride<bool > SavePrinting (Printing, true );
1618- Ref-> printRight (OB );
1622+ OB. printRight (*Ref );
16191623 }
16201624};
16211625
@@ -1767,7 +1771,7 @@ class DtorName : public Node {
17671771
17681772 void printLeft (OutputBuffer &OB) const override {
17691773 OB += " ~" ;
1770- Base-> printLeft (OB );
1774+ OB. printLeft (*Base );
17711775 }
17721776};
17731777
@@ -2047,7 +2051,7 @@ class CastExpr : public Node {
20472051 {
20482052 ScopedOverride<unsigned > LT (OB.GtIsGt , 0 );
20492053 OB += " <" ;
2050- To-> printLeft (OB );
2054+ OB. printLeft (*To );
20512055 OB += " >" ;
20522056 }
20532057 OB.printOpen ();
@@ -6176,6 +6180,10 @@ struct ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {
61766180 Alloc>::AbstractManglingParser;
61776181};
61786182
6183+ inline void OutputBuffer::printLeft (const Node &N) { N.printLeft (*this ); }
6184+
6185+ inline void OutputBuffer::printRight (const Node &N) { N.printRight (*this ); }
6186+
61796187DEMANGLE_NAMESPACE_END
61806188
61816189#if defined(__clang__)
0 commit comments