HomePhabricator

Implement demangling support for C++20 lambda expression extensions.

Authored by Richard Smith <richard-llvm@metafoo.co.uk> on Sep 6 2019, 4:53 PM.

Description

Implement demangling support for C++20 lambda expression extensions.

This implements demangling support for the mangling extensions specified
in https://github.com/itanium-cxx-abi/cxx-abi/pull/85, much of which is
implemented in Clang r359967 and r371004.

Specifically, this provides demangling for:

  • <template-param-decl> in <lambda-sig>
  • <template-param> with non-zero level
  • lambda-expression literals (not emitted by Clang yet)
  • nullptr literals
  • string literals

(The final two seem unrelated, but handling them was necessary in order
to disambiguate between lambda expressions and the other forms of
literal for which we have a type but no value.)

When demangling a <lambda-sig>, we form template parameters with no
corresponding argument, so we cannot substitute in the argument in the
demangling. Instead we invent synthetic names for the template
parameters (eg, '[]<typename $T>($T *x)').

llvm-svn: 371273

Details

Event Timeline

Richard Smith <richard-llvm@metafoo.co.uk> committed rG4bbe85c5d4e7: Implement demangling support for C++20 lambda expression extensions. (authored by Richard Smith <richard-llvm@metafoo.co.uk>).Sep 6 2019, 4:53 PM