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