@@ -359,7 +359,7 @@ class Remangler : public RemanglerBase {
359359 }
360360
361361 ManglingError mangleGenericSpecializationNode (Node *node,
362- const char *operatorStr ,
362+ char specKind ,
363363 unsigned depth);
364364 ManglingError mangleAnyNominalType (Node *node, unsigned depth);
365365 ManglingError mangleAnyGenericType (Node *node, StringRef TypeOp,
@@ -1693,7 +1693,7 @@ Remangler::mangleGenericPartialSpecializationNotReAbstracted(Node *node,
16931693}
16941694
16951695ManglingError
1696- Remangler::mangleGenericSpecializationNode (Node *node, const char *operatorStr ,
1696+ Remangler::mangleGenericSpecializationNode (Node *node, char specKind ,
16971697 unsigned depth) {
16981698 bool FirstParam = true ;
16991699 for (NodePointer Child : *node) {
@@ -1705,42 +1705,52 @@ Remangler::mangleGenericSpecializationNode(Node *node, const char *operatorStr,
17051705 DEMANGLER_ASSERT (
17061706 !FirstParam && " generic specialization with no substitutions" , node);
17071707
1708- Buffer << operatorStr ;
1708+ Buffer << ' T ' ;
17091709
17101710 for (NodePointer Child : *node) {
1711- if (Child->getKind () != Node::Kind::GenericSpecializationParam )
1711+ if (Child->getKind () == Node::Kind::DroppedArgument )
17121712 RETURN_IF_ERROR (mangle (Child, depth + 1 ));
17131713 }
17141714
1715+
1716+ Buffer << specKind;
1717+
1718+ for (NodePointer Child : *node) {
1719+ if (Child->getKind () != Node::Kind::GenericSpecializationParam &&
1720+ Child->getKind () != Node::Kind::DroppedArgument) {
1721+ RETURN_IF_ERROR (mangle (Child, depth + 1 ));
1722+ }
1723+ }
1724+
17151725 return ManglingError::Success;
17161726}
17171727
17181728ManglingError Remangler::mangleGenericSpecialization (Node *node,
17191729 unsigned depth) {
1720- return mangleGenericSpecializationNode (node, " Tg " , depth + 1 );
1730+ return mangleGenericSpecializationNode (node, ' g ' , depth + 1 );
17211731}
17221732
17231733ManglingError
17241734Remangler::mangleGenericSpecializationPrespecialized (Node *node,
17251735 unsigned depth) {
1726- return mangleGenericSpecializationNode (node, " Ts " , depth + 1 );
1736+ return mangleGenericSpecializationNode (node, ' s ' , depth + 1 );
17271737}
17281738
17291739ManglingError
17301740Remangler::mangleGenericSpecializationNotReAbstracted (Node *node,
17311741 unsigned depth) {
1732- return mangleGenericSpecializationNode (node, " TG " , depth + 1 );
1742+ return mangleGenericSpecializationNode (node, ' G ' , depth + 1 );
17331743}
17341744
17351745ManglingError
17361746Remangler::mangleGenericSpecializationInResilienceDomain (Node *node,
17371747 unsigned depth) {
1738- return mangleGenericSpecializationNode (node, " TB " , depth + 1 );
1748+ return mangleGenericSpecializationNode (node, ' B ' , depth + 1 );
17391749}
17401750
17411751ManglingError Remangler::mangleInlinedGenericFunction (Node *node,
17421752 unsigned depth) {
1743- return mangleGenericSpecializationNode (node, " Ti " , depth + 1 );
1753+ return mangleGenericSpecializationNode (node, ' i ' , depth + 1 );
17441754}
17451755
17461756ManglingError Remangler::mangleGenericSpecializationParam (Node *node,
@@ -3067,8 +3077,11 @@ ManglingError Remangler::mangleAsyncRemoved(Node *node, unsigned depth) {
30673077 return ManglingError::Success;
30683078}
30693079
3070- ManglingError Remangler::mangleMetatypeParamsRemoved (Node *node, unsigned depth) {
3071- Buffer << ' m' ;
3080+ ManglingError Remangler::mangleDroppedArgument (Node *node, unsigned depth) {
3081+ Buffer << " t" ;
3082+ int n = node->getIndex ();
3083+ if (n > 0 )
3084+ Buffer << (n-1 );
30723085 return ManglingError::Success;
30733086}
30743087
0 commit comments