@@ -3617,6 +3617,17 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
3617
3617
return argumentTypeNames[i];
3618
3618
return std::string (" <unknown>" );
3619
3619
};
3620
+ auto getArgumentNodeName = [](NodePointer node) {
3621
+ if (node->getKind () == Node::Kind::Identifier) {
3622
+ return std::string (node->getText ());
3623
+ }
3624
+ if (node->getKind () == Node::Kind::LocalDeclName) {
3625
+ auto text = node->getChild (1 )->getText ();
3626
+ auto index = node->getChild (0 )->getIndex () + 1 ;
3627
+ return std::string (text) + " #" + std::to_string (index);
3628
+ }
3629
+ return std::string (" <unknown>" );
3630
+ };
3620
3631
// Multiple arguments case
3621
3632
NodePointer argList = matchSequenceOfKinds (
3622
3633
child, {
@@ -3635,11 +3646,8 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
3635
3646
if (argumentType->getKind () == Node::Kind::TupleElement) {
3636
3647
argumentType =
3637
3648
argumentType->getChild (0 )->getChild (0 )->getChild (1 );
3638
- if (argumentType->getKind () == Node::Kind::Identifier) {
3639
- argumentTypeNames.push_back (
3640
- std::string (argumentType->getText ()));
3641
- continue ;
3642
- }
3649
+ argumentTypeNames.push_back (getArgumentNodeName (argumentType));
3650
+ continue ;
3643
3651
}
3644
3652
argumentTypeNames.push_back (" <Unknown>" );
3645
3653
}
@@ -3654,7 +3662,7 @@ std::string Demangle::keyPathSourceString(const char *MangledName,
3654
3662
});
3655
3663
if (argList != nullptr ) {
3656
3664
argumentTypeNames.push_back (
3657
- std::string (argList->getChild (0 )->getChild (1 )-> getText ( )));
3665
+ getArgumentNodeName (argList->getChild (0 )->getChild (1 )));
3658
3666
}
3659
3667
}
3660
3668
child = child->getChild (1 );
0 commit comments