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> 2020-05-14 Rainer Schuetze <r.sagitario@gmx.de>
Iain Buclaw <ibuclaw@gdcproject.org> Iain Buclaw <ibuclaw@gdcproject.org>

View File

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

View File

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