aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2022-11-07 11:24:14 -0500
committerNathan Sidwell <nathan@acm.org>2022-11-15 13:34:56 -0500
commit46c3d9c8e8f6becdb73bac8bcc2f0ba12d6b1d9c (patch)
treece741eb8aeff36b6556e824b5752c5ce63e0f10f /gcc
parentee08aa9ab4100b8774d149bb235b00bddebd4b89 (diff)
downloadgcc-46c3d9c8e8f6becdb73bac8bcc2f0ba12d6b1d9c.zip
gcc-46c3d9c8e8f6becdb73bac8bcc2f0ba12d6b1d9c.tar.gz
gcc-46c3d9c8e8f6becdb73bac8bcc2f0ba12d6b1d9c.tar.bz2
demangler: Templated lambda demangling
Templated lambdas have a template-head, which is part of their signature. GCC ABI 18 mangles that into the lambda name. This adds support to the demangler. We have to introduce artificial template parameter names, as we need to refer to them from later components of the lambda signature. We use $T:n, $N:n and $TT:n for type, non-type and template parameters. Non-type parameter names are not shown in the strictly correct location -- for instance 'int (&NT) ()' would be shown as 'int (&) $N:n'. That's unfortunate, but an orthogonal issue. The 'is_lambda_arg' field is now repurposed as indicating the number of explicit template parameters (1-based). include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_TEMPLATE_HEAD, DEMANGLE_COMPONENT_TEMPLATE_TYPE_PARM, DEMANGLE_COMPONENT_TEMPLATE_NON_TYPE_PARM, DEMANGLE_COMPONENT_TEMPLATE_TEMPLATE_PARM, DEMANGLE_COMPONENT_TEMPLATE_PACK_PARM. libiberty/ * cp-demangle.c (struct d_print_info): Rename is_lambda_arg to lambda_tpl_parms. Augment semantics. (d_make_comp): Add checks for new components. (d_template_parm, d_template_head): New. (d_lambda): Add templated lambda support. (d_print_init): Adjust. (d_print_lambda_parm_name): New. (d_print_comp_inner): Support templated lambdas, * testsuite/demangle-expected: Add testcases.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions