@@ -1093,7 +1093,7 @@ NodePointer Demangler::demangleGenericSpecialization(Node::Kind SpecKind) {
10931093
10941094NodePointer Demangler::demangleFunctionSpecialization () {
10951095 NodePointer Spec = demangleSpecAttributes (
1096- Node::Kind::FunctionSignatureSpecialization);
1096+ Node::Kind::FunctionSignatureSpecialization, /* demangleUniqueID */ true );
10971097 unsigned ParamIdx = 0 ;
10981098 while (Spec && !nextIf (' _' )) {
10991099 Spec = addChild (Spec, demangleFuncSpecParam (ParamIdx));
@@ -1230,15 +1230,27 @@ NodePointer Demangler::addFuncSpecParamNumber(NodePointer Param,
12301230 Node::Kind::FunctionSignatureSpecializationParamPayload, Str));
12311231}
12321232
1233- NodePointer Demangler::demangleSpecAttributes (Node::Kind SpecKind) {
1234- NodePointer SpecNd = NodeFactory::create (SpecKind);
1235- if (nextIf (' q' ))
1236- SpecNd->addChild (NodeFactory::create (Node::Kind::SpecializationIsFragile));
1233+ NodePointer Demangler::demangleSpecAttributes (Node::Kind SpecKind,
1234+ bool demangleUniqueID) {
1235+ bool isFragile = nextIf (' q' );
12371236
12381237 int PassID = (int )nextChar () - ' 0' ;
12391238 if (PassID < 0 || PassID > 9 )
12401239 return nullptr ;
12411240
1241+ int Idx = -1 ;
1242+ if (demangleUniqueID)
1243+ Idx = demangleNatural ();
1244+
1245+ NodePointer SpecNd;
1246+ if (Idx >= 0 ) {
1247+ SpecNd = NodeFactory::create (SpecKind, Idx);
1248+ } else {
1249+ SpecNd = NodeFactory::create (SpecKind);
1250+ }
1251+ if (isFragile)
1252+ SpecNd->addChild (NodeFactory::create (Node::Kind::SpecializationIsFragile));
1253+
12421254 SpecNd->addChild (NodeFactory::create (Node::Kind::SpecializationPassID,
12431255 PassID));
12441256 return SpecNd;
0 commit comments