From 3a55774f0b67645efc54fa1ac8f0053053d566dd Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Fri, 15 May 2020 09:34:36 +0200 Subject: [PATCH] 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. --- libiberty/ChangeLog | 5 +++++ libiberty/d-demangle.c | 4 ++++ libiberty/testsuite/d-demangle-expected | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 74c515b4b90..45dcc6d614f 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2020-05-15 Iain Buclaw + + * d-demangle.c (dlang_attributes): Add @live attribute. + * testsuite/d-demangle-expected: Add new tests. + 2020-05-14 Rainer Schuetze Iain Buclaw diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index 5856bc2930f..f2d6946ecad 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -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; diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected index 47b24ea48ae..e3f32e31d7b 100644 --- a/libiberty/testsuite/d-demangle-expected +++ b/libiberty/testsuite/d-demangle-expected @@ -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) # -- 2.30.2