diff mbox series

[committed] libiberty: Handle @live attribute in D demangler.

Message ID 20200515084755.10147-1-ibuclaw@gdcproject.org
State New
Headers show
Series [committed] libiberty: Handle @live attribute in D demangler. | expand

Commit Message

Iain Buclaw May 15, 2020, 8:47 a.m. UTC
Hi,

This patch adds support for demangling D functions annotated with the
new ownership/borrowing system attribute.

Following Jeff's advice from the last patch review, this has been
regression tested and committed to mainline.  Firstly, as it is assumed
this falls under my D front-end maintainer status, secondly, this change
is quite obvious, so there ought to be no objections to it.

Regards
Iain.

---
libiberty/ChangeLog:

	* d-demangle.c (dlang_attributes): Add @live attribute.
	* testsuite/d-demangle-expected: Add new tests.
---
 libiberty/d-demangle.c                  | 4 ++++
 libiberty/testsuite/d-demangle-expected | 8 ++++++++
 2 files changed, 12 insertions(+)
diff mbox series

Patch

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)
 #