libiberty: Handle @live attribute in D demangler.

Adds support for demangling D functions annotated with the new
ownership/borrowing system attribute.

libiberty/ChangeLog:

	* d-demangle.c (dlang_attributes): Add @live attribute.
	* testsuite/d-demangle-expected: Add new tests.
This commit is contained in:
Iain Buclaw 2020-05-15 09:34:36 +02:00
parent f8b0665445
commit 3a55774f0b
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2020-05-15 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_attributes): Add @live attribute.
* testsuite/d-demangle-expected: Add new tests.
2020-05-14 Rainer Schuetze <r.sagitario@gmx.de>
Iain Buclaw <ibuclaw@gdcproject.org>

View File

@ -578,6 +578,10 @@ dlang_attributes (string *decl, const char *mangled)
mangled++;
string_append (decl, "scope ");
continue;
case 'm': /* @live */
mangled++;
string_append (decl, "@live ");
continue;
default: /* unknown attribute */
return NULL;

View File

@ -462,6 +462,10 @@ _D8demangle4testFDFNiZaZv
demangle.test(char() @nogc delegate)
#
--format=dlang
_D8demangle4testFDFNmZaZv
demangle.test(char() @live delegate)
#
--format=dlang
_D8demangle4testFDFNaNbZaZv
demangle.test(char() pure nothrow delegate)
#
@ -538,6 +542,10 @@ _D8demangle4testFPFNiZaZv
demangle.test(char() @nogc function)
#
--format=dlang
_D8demangle4testFPFNmZaZv
demangle.test(char() @live function)
#
--format=dlang
_D8demangle4testFPFNaNbZaZv
demangle.test(char() pure nothrow function)
#