This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 8/7] [D] libiberty: Add support for specialized template parameters


One last thing that was added in the next D version's ABI (and I
subsequently missed).

This is a trivial patch to just ignore the new mangle symbol.

---
libiberty/ChangeLog:

2015-05-13 Iain Buclaw  <ibuclaw@gdcproject.org>

    * d-demangle.c (dlang_template_args): Skip over specialized template
    parameters in mangled symbol.
    * testsuite/d-demangle-expected: Add coverage and unittest for specialized
    template parameters.
---
 libiberty/d-demangle.c                  | 4 ++++
 libiberty/testsuite/d-demangle-expected | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c
index 5c0f356..833f87a 100644
--- a/libiberty/d-demangle.c
+++ b/libiberty/d-demangle.c
@@ -1486,6 +1486,10 @@ dlang_template_args (string *decl, const char *mangled)
       if (n++)
 	string_append (decl, ", ");
 
+      /* Skip over specialised template prefix.  */
+      if (*mangled == 'H')
+	mangled++;
+
       switch (*mangled)
 	{
 	case 'S': /* Symbol parameter.  */
diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected
index 47746da..992ea4a 100644
--- a/libiberty/testsuite/d-demangle-expected
+++ b/libiberty/testsuite/d-demangle-expected
@@ -630,6 +630,10 @@ _D8demangle19__T4testS6symbolTaZv
 demangle.test!(symbol, char)
 #
 --format=dlang
+_D8demangle12__T4testHTaZv
+demangle.test!(char)
+#
+--format=dlang
 _D8demangle13__T4testVPinZv
 demangle.test!(null)
 #
@@ -1074,3 +1078,7 @@ std.traits.fqnSym!(std).adjustIdent(immutable(char)[])
 --format=dlang
 _D2rt8lifetime36__T14_d_newarrayOpTS13_d_newarrayiTZ14_d_newarrayOpTFNaNbxC8TypeInfomPmZAv
 rt.lifetime._d_newarrayOpT!(_d_newarrayiT)._d_newarrayOpT(const(TypeInfo), ulong, ulong*)
+#
+--format=dlang
+_D2gc6config13__T5parseHTfZ5parseFNbNiAxaKAxaKfZb
+gc.config.parse!(float).parse(const(char)[], ref const(char)[], ref float)
-- 
2.1.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]