* [PATCH 3/7] [D] libiberty: Include type modifiers in demangled function symbols
@ 2015-05-13 8:51 Iain Buclaw
2015-05-13 20:36 ` Iain Buclaw
2015-05-14 13:09 ` Jeff Law
0 siblings, 2 replies; 4+ messages in thread
From: Iain Buclaw @ 2015-05-13 8:51 UTC (permalink / raw)
To: gcc-patches, Ian Lance Taylor
[-- Attachment #1: Type: text/plain, Size: 782 bytes --]
Like C++ const and volatile, in D mangled symbols can exist modifiers
that represent the const, immutable, inout and shared-ness of the
'this' parameter.
This information should be written out in the demangled symbol to show
that each variant has a unique identity.
---
libiberty/ChangeLog:
2015-05-13 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_type_modifiers): New function.
(dlang_type_modifier_p): New function.
(dlang_call_convention_p): Ignore any kind of type modifier.
(dlang_type): Handle and emit the type modifier after delegate types.
(dlang_parse_symbol): Handle and emit the type modifier after the symbol.
* testsuite/d-demangle-expected: Add coverage tests for all valid
usages of function symbols with type modifiers.
[-- Attachment #2: 0003-D-demangle-Include-type-modifiers-in-demangled-funct.patch --]
[-- Type: text/x-diff, Size: 5842 bytes --]
From 6836ff778e26dd0312d4d33a0570d979ba59a4ca Mon Sep 17 00:00:00 2001
From: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon, 11 May 2015 09:20:55 +0200
Subject: [PATCH 3/7] D demangle: Include type modifiers in demangled function
symbols
---
libiberty/d-demangle.c | 111 ++++++++++++++++++++++++++++----
libiberty/testsuite/d-demangle-expected | 32 +++++++++
2 files changed, 130 insertions(+), 13 deletions(-)
diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c
index 91c6d55..bfad5bb 100644
--- a/libiberty/d-demangle.c
+++ b/libiberty/d-demangle.c
@@ -215,6 +215,44 @@ dlang_call_convention (string *decl, const char *mangled)
return mangled;
}
+/* Extract the type modifiers from MANGLED and append them to DECL.
+ Returns the remaining signature on success or NULL on failure. */
+static const char *
+dlang_type_modifiers (string *decl, const char *mangled)
+{
+ if (mangled == NULL || *mangled == '\0')
+ return NULL;
+
+ switch (*mangled)
+ {
+ case 'x': /* const */
+ mangled++;
+ string_append (decl, " const");
+ return mangled;
+ case 'y': /* immutable */
+ mangled++;
+ string_append (decl, " immutable");
+ return mangled;
+ case 'O': /* shared */
+ mangled++;
+ string_append (decl, " shared");
+ return dlang_type_modifiers (decl, mangled);
+ case 'N':
+ mangled++;
+ if (*mangled == 'g') /* wild */
+ {
+ mangled++;
+ string_append (decl, " inout");
+ return dlang_type_modifiers (decl, mangled);
+ }
+ else
+ return NULL;
+
+ default:
+ return mangled;
+ }
+}
+
/* Demangle the D function attributes from MANGLED and append it to DECL.
Return the remaining string on success or NULL on failure. */
static const char *
@@ -476,10 +514,22 @@ dlang_type (string *decl, const char *mangled)
mangled++;
return dlang_parse_symbol (decl, mangled);
case 'D': /* delegate T */
+ {
+ string mods;
+ size_t szmods;
mangled++;
+
+ string_init (&mods);
+ mangled = dlang_type_modifiers (&mods, mangled);
+ szmods = string_length (&mods);
+
mangled = dlang_function_type (decl, mangled);
string_append (decl, "delegate");
+ string_appendn (decl, mods.b, szmods);
+
+ string_delete (&mods);
return mangled;
+ }
case 'B': /* tuple T */
mangled++;
return dlang_parse_tuple (decl, mangled);
@@ -1135,28 +1185,54 @@ dlang_value (string *decl, const char *mangled, const char *name, char type)
return mangled;
}
+/* Extract the type modifiers from MANGLED and return the string
+ length that it consumes in MANGLED on success or 0 on failure. */
static int
-dlang_call_convention_p (const char *mangled)
+dlang_type_modifier_p (const char *mangled)
{
- size_t i;
+ int i;
switch (*mangled)
{
- case 'F': case 'U': case 'V':
- case 'W': case 'R':
+ case 'x': case 'y':
return 1;
- case 'M': /* Prefix for functions needing 'this' */
- i = 1;
- if (mangled[i] == 'x')
- i++;
+ case 'O':
+ mangled++;
+ i = dlang_type_modifier_p (mangled);
+ return i + 1;
- switch (mangled[i])
+ case 'N':
+ mangled++;
+ if (*mangled == 'g')
{
- case 'F': case 'U': case 'V':
- case 'W': case 'R':
- return 1;
+ mangled++;
+ i = dlang_type_modifier_p (mangled);
+ return i + 2;
}
+ }
+
+ return 0;
+}
+
+/* Extract the function calling convention from MANGLED and
+ return 1 on success or 0 on failure. */
+static int
+dlang_call_convention_p (const char *mangled)
+{
+ /* Prefix for functions needing 'this' */
+ if (*mangled == 'M')
+ {
+ mangled++;
+ /* Also skip over any type modifiers. */
+ mangled += dlang_type_modifier_p (mangled);
+ }
+
+ switch (*mangled)
+ {
+ case 'F': case 'U': case 'V':
+ case 'W': case 'R':
+ return 1;
default:
return 0;
@@ -1178,11 +1254,16 @@ dlang_parse_symbol (string *decl, const char *mangled)
if (mangled && dlang_call_convention_p (mangled))
{
+ string mods;
int saved;
/* Skip over 'this' parameter. */
if (*mangled == 'M')
- mangled += (mangled[1] == 'x') ? 2 : 1;
+ mangled++;
+
+ /* Save the type modifiers for appending at the end. */
+ string_init (&mods);
+ mangled = dlang_type_modifiers (&mods, mangled);
/* Skip over calling convention and attributes in qualified name. */
saved = string_length (decl);
@@ -1201,6 +1282,10 @@ dlang_parse_symbol (string *decl, const char *mangled)
mangled = dlang_type (decl, mangled);
string_setlength (decl, saved);
}
+
+ /* Add any const/immutable/shared modifier. */
+ string_appendn (decl, mods.b, string_length (&mods));
+ string_delete (&mods);
}
}
while (mangled && ISDIGIT (*mangled));
diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected
index b023f6d..e08c989 100644
--- a/libiberty/testsuite/d-demangle-expected
+++ b/libiberty/testsuite/d-demangle-expected
@@ -753,6 +753,38 @@ demangle.test!(demangle.S(1, 2))
_D8demangle35__T4testVS8demangle1SS2i1a3_616263Zv
demangle.test!(demangle.S(1, "abc"))
#
+--format=dlang
+_D8demangle4testMxFZv
+demangle.test() const
+#
+--format=dlang
+_D8demangle4testMyFZv
+demangle.test() immutable
+#
+--format=dlang
+_D8demangle4testMNgFZv
+demangle.test() inout
+#
+--format=dlang
+_D8demangle4testMNgxFZv
+demangle.test() inout const
+#
+--format=dlang
+_D8demangle4testMOFZv
+demangle.test() shared
+#
+--format=dlang
+_D8demangle4testMOxFZv
+demangle.test() shared const
+#
+--format=dlang
+_D8demangle4testMONgFZv
+demangle.test() shared inout
+#
+--format=dlang
+_D8demangle4testMONgxFZv
+demangle.test() shared inout const
+#
# Unittests
#
--format=dlang
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/7] [D] libiberty: Include type modifiers in demangled function symbols
2015-05-13 8:51 [PATCH 3/7] [D] libiberty: Include type modifiers in demangled function symbols Iain Buclaw
@ 2015-05-13 20:36 ` Iain Buclaw
2015-05-13 20:52 ` Iain Buclaw
2015-05-14 13:09 ` Jeff Law
1 sibling, 1 reply; 4+ messages in thread
From: Iain Buclaw @ 2015-05-13 20:36 UTC (permalink / raw)
To: gcc-patches, Ian Lance Taylor
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
On 13 May 2015 at 10:51, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> Like C++ const and volatile, in D mangled symbols can exist modifiers
> that represent the const, immutable, inout and shared-ness of the
> 'this' parameter.
>
> This information should be written out in the demangled symbol to show
> that each variant has a unique identity.
>
> ---
> libiberty/ChangeLog:
>
> 2015-05-13 Iain Buclaw <ibuclaw@gdcproject.org>
> * d-demangle.c (dlang_type_modifiers): New function.
> (dlang_type_modifier_p): New function.
> (dlang_call_convention_p): Ignore any kind of type modifier.
> (dlang_type): Handle and emit the type modifier after delegate types.
> (dlang_parse_symbol): Handle and emit the type modifier after the symbol.
> * testsuite/d-demangle-expected: Add coverage tests for all valid
> usages of function symbols with type modifiers.
Somehow in the small morning rush, I missed some extra coverage tests
in the patch, corrected in this new patch.
[-- Attachment #2: 0003-D-demangle-Include-type-modifiers-in-demangled-funct.patch --]
[-- Type: text/x-diff, Size: 5842 bytes --]
From 6836ff778e26dd0312d4d33a0570d979ba59a4ca Mon Sep 17 00:00:00 2001
From: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon, 11 May 2015 09:20:55 +0200
Subject: [PATCH 3/7] D demangle: Include type modifiers in demangled function
symbols
---
libiberty/d-demangle.c | 111 ++++++++++++++++++++++++++++----
libiberty/testsuite/d-demangle-expected | 32 +++++++++
2 files changed, 130 insertions(+), 13 deletions(-)
diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c
index 91c6d55..bfad5bb 100644
--- a/libiberty/d-demangle.c
+++ b/libiberty/d-demangle.c
@@ -215,6 +215,44 @@ dlang_call_convention (string *decl, const char *mangled)
return mangled;
}
+/* Extract the type modifiers from MANGLED and append them to DECL.
+ Returns the remaining signature on success or NULL on failure. */
+static const char *
+dlang_type_modifiers (string *decl, const char *mangled)
+{
+ if (mangled == NULL || *mangled == '\0')
+ return NULL;
+
+ switch (*mangled)
+ {
+ case 'x': /* const */
+ mangled++;
+ string_append (decl, " const");
+ return mangled;
+ case 'y': /* immutable */
+ mangled++;
+ string_append (decl, " immutable");
+ return mangled;
+ case 'O': /* shared */
+ mangled++;
+ string_append (decl, " shared");
+ return dlang_type_modifiers (decl, mangled);
+ case 'N':
+ mangled++;
+ if (*mangled == 'g') /* wild */
+ {
+ mangled++;
+ string_append (decl, " inout");
+ return dlang_type_modifiers (decl, mangled);
+ }
+ else
+ return NULL;
+
+ default:
+ return mangled;
+ }
+}
+
/* Demangle the D function attributes from MANGLED and append it to DECL.
Return the remaining string on success or NULL on failure. */
static const char *
@@ -476,10 +514,22 @@ dlang_type (string *decl, const char *mangled)
mangled++;
return dlang_parse_symbol (decl, mangled);
case 'D': /* delegate T */
+ {
+ string mods;
+ size_t szmods;
mangled++;
+
+ string_init (&mods);
+ mangled = dlang_type_modifiers (&mods, mangled);
+ szmods = string_length (&mods);
+
mangled = dlang_function_type (decl, mangled);
string_append (decl, "delegate");
+ string_appendn (decl, mods.b, szmods);
+
+ string_delete (&mods);
return mangled;
+ }
case 'B': /* tuple T */
mangled++;
return dlang_parse_tuple (decl, mangled);
@@ -1135,28 +1185,54 @@ dlang_value (string *decl, const char *mangled, const char *name, char type)
return mangled;
}
+/* Extract the type modifiers from MANGLED and return the string
+ length that it consumes in MANGLED on success or 0 on failure. */
static int
-dlang_call_convention_p (const char *mangled)
+dlang_type_modifier_p (const char *mangled)
{
- size_t i;
+ int i;
switch (*mangled)
{
- case 'F': case 'U': case 'V':
- case 'W': case 'R':
+ case 'x': case 'y':
return 1;
- case 'M': /* Prefix for functions needing 'this' */
- i = 1;
- if (mangled[i] == 'x')
- i++;
+ case 'O':
+ mangled++;
+ i = dlang_type_modifier_p (mangled);
+ return i + 1;
- switch (mangled[i])
+ case 'N':
+ mangled++;
+ if (*mangled == 'g')
{
- case 'F': case 'U': case 'V':
- case 'W': case 'R':
- return 1;
+ mangled++;
+ i = dlang_type_modifier_p (mangled);
+ return i + 2;
}
+ }
+
+ return 0;
+}
+
+/* Extract the function calling convention from MANGLED and
+ return 1 on success or 0 on failure. */
+static int
+dlang_call_convention_p (const char *mangled)
+{
+ /* Prefix for functions needing 'this' */
+ if (*mangled == 'M')
+ {
+ mangled++;
+ /* Also skip over any type modifiers. */
+ mangled += dlang_type_modifier_p (mangled);
+ }
+
+ switch (*mangled)
+ {
+ case 'F': case 'U': case 'V':
+ case 'W': case 'R':
+ return 1;
default:
return 0;
@@ -1178,11 +1254,16 @@ dlang_parse_symbol (string *decl, const char *mangled)
if (mangled && dlang_call_convention_p (mangled))
{
+ string mods;
int saved;
/* Skip over 'this' parameter. */
if (*mangled == 'M')
- mangled += (mangled[1] == 'x') ? 2 : 1;
+ mangled++;
+
+ /* Save the type modifiers for appending at the end. */
+ string_init (&mods);
+ mangled = dlang_type_modifiers (&mods, mangled);
/* Skip over calling convention and attributes in qualified name. */
saved = string_length (decl);
@@ -1201,6 +1282,10 @@ dlang_parse_symbol (string *decl, const char *mangled)
mangled = dlang_type (decl, mangled);
string_setlength (decl, saved);
}
+
+ /* Add any const/immutable/shared modifier. */
+ string_appendn (decl, mods.b, string_length (&mods));
+ string_delete (&mods);
}
}
while (mangled && ISDIGIT (*mangled));
diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected
index b023f6d..e08c989 100644
--- a/libiberty/testsuite/d-demangle-expected
+++ b/libiberty/testsuite/d-demangle-expected
@@ -753,6 +753,38 @@ demangle.test!(demangle.S(1, 2))
_D8demangle35__T4testVS8demangle1SS2i1a3_616263Zv
demangle.test!(demangle.S(1, "abc"))
#
+--format=dlang
+_D8demangle4testMxFZv
+demangle.test() const
+#
+--format=dlang
+_D8demangle4testMyFZv
+demangle.test() immutable
+#
+--format=dlang
+_D8demangle4testMNgFZv
+demangle.test() inout
+#
+--format=dlang
+_D8demangle4testMNgxFZv
+demangle.test() inout const
+#
+--format=dlang
+_D8demangle4testMOFZv
+demangle.test() shared
+#
+--format=dlang
+_D8demangle4testMOxFZv
+demangle.test() shared const
+#
+--format=dlang
+_D8demangle4testMONgFZv
+demangle.test() shared inout
+#
+--format=dlang
+_D8demangle4testMONgxFZv
+demangle.test() shared inout const
+#
# Unittests
#
--format=dlang
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/7] [D] libiberty: Include type modifiers in demangled function symbols
2015-05-13 20:36 ` Iain Buclaw
@ 2015-05-13 20:52 ` Iain Buclaw
0 siblings, 0 replies; 4+ messages in thread
From: Iain Buclaw @ 2015-05-13 20:52 UTC (permalink / raw)
To: gcc-patches, Ian Lance Taylor
[-- Attachment #1: Type: text/plain, Size: 1171 bytes --]
On 13 May 2015 at 22:34, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> On 13 May 2015 at 10:51, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>> Like C++ const and volatile, in D mangled symbols can exist modifiers
>> that represent the const, immutable, inout and shared-ness of the
>> 'this' parameter.
>>
>> This information should be written out in the demangled symbol to show
>> that each variant has a unique identity.
>>
>> ---
>> libiberty/ChangeLog:
>>
>> 2015-05-13 Iain Buclaw <ibuclaw@gdcproject.org>
>> * d-demangle.c (dlang_type_modifiers): New function.
>> (dlang_type_modifier_p): New function.
>> (dlang_call_convention_p): Ignore any kind of type modifier.
>> (dlang_type): Handle and emit the type modifier after delegate types.
>> (dlang_parse_symbol): Handle and emit the type modifier after the symbol.
>> * testsuite/d-demangle-expected: Add coverage tests for all valid
>> usages of function symbols with type modifiers.
>
> Somehow in the small morning rush, I missed some extra coverage tests
> in the patch, corrected in this new patch.
Ah, wrong file. This explains everything (sorry for the added noise :)
Iain
[-- Attachment #2: 0003-D-demangle-Include-type-modifiers-in-demangled-funct.patch --]
[-- Type: text/x-diff, Size: 6562 bytes --]
From 47c8e0f723f35e89c90c3d9d88feae9fdd395279 Mon Sep 17 00:00:00 2001
From: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon, 11 May 2015 09:20:55 +0200
Subject: [PATCH 3/7] D demangle: Include type modifiers in demangled function
symbols
---
libiberty/d-demangle.c | 111 ++++++++++++++++++++++++++++----
libiberty/testsuite/d-demangle-expected | 64 ++++++++++++++++++
2 files changed, 162 insertions(+), 13 deletions(-)
diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c
index 91c6d55..bfad5bb 100644
--- a/libiberty/d-demangle.c
+++ b/libiberty/d-demangle.c
@@ -215,6 +215,44 @@ dlang_call_convention (string *decl, const char *mangled)
return mangled;
}
+/* Extract the type modifiers from MANGLED and append them to DECL.
+ Returns the remaining signature on success or NULL on failure. */
+static const char *
+dlang_type_modifiers (string *decl, const char *mangled)
+{
+ if (mangled == NULL || *mangled == '\0')
+ return NULL;
+
+ switch (*mangled)
+ {
+ case 'x': /* const */
+ mangled++;
+ string_append (decl, " const");
+ return mangled;
+ case 'y': /* immutable */
+ mangled++;
+ string_append (decl, " immutable");
+ return mangled;
+ case 'O': /* shared */
+ mangled++;
+ string_append (decl, " shared");
+ return dlang_type_modifiers (decl, mangled);
+ case 'N':
+ mangled++;
+ if (*mangled == 'g') /* wild */
+ {
+ mangled++;
+ string_append (decl, " inout");
+ return dlang_type_modifiers (decl, mangled);
+ }
+ else
+ return NULL;
+
+ default:
+ return mangled;
+ }
+}
+
/* Demangle the D function attributes from MANGLED and append it to DECL.
Return the remaining string on success or NULL on failure. */
static const char *
@@ -476,10 +514,22 @@ dlang_type (string *decl, const char *mangled)
mangled++;
return dlang_parse_symbol (decl, mangled);
case 'D': /* delegate T */
+ {
+ string mods;
+ size_t szmods;
mangled++;
+
+ string_init (&mods);
+ mangled = dlang_type_modifiers (&mods, mangled);
+ szmods = string_length (&mods);
+
mangled = dlang_function_type (decl, mangled);
string_append (decl, "delegate");
+ string_appendn (decl, mods.b, szmods);
+
+ string_delete (&mods);
return mangled;
+ }
case 'B': /* tuple T */
mangled++;
return dlang_parse_tuple (decl, mangled);
@@ -1135,28 +1185,54 @@ dlang_value (string *decl, const char *mangled, const char *name, char type)
return mangled;
}
+/* Extract the type modifiers from MANGLED and return the string
+ length that it consumes in MANGLED on success or 0 on failure. */
static int
-dlang_call_convention_p (const char *mangled)
+dlang_type_modifier_p (const char *mangled)
{
- size_t i;
+ int i;
switch (*mangled)
{
- case 'F': case 'U': case 'V':
- case 'W': case 'R':
+ case 'x': case 'y':
return 1;
- case 'M': /* Prefix for functions needing 'this' */
- i = 1;
- if (mangled[i] == 'x')
- i++;
+ case 'O':
+ mangled++;
+ i = dlang_type_modifier_p (mangled);
+ return i + 1;
- switch (mangled[i])
+ case 'N':
+ mangled++;
+ if (*mangled == 'g')
{
- case 'F': case 'U': case 'V':
- case 'W': case 'R':
- return 1;
+ mangled++;
+ i = dlang_type_modifier_p (mangled);
+ return i + 2;
}
+ }
+
+ return 0;
+}
+
+/* Extract the function calling convention from MANGLED and
+ return 1 on success or 0 on failure. */
+static int
+dlang_call_convention_p (const char *mangled)
+{
+ /* Prefix for functions needing 'this' */
+ if (*mangled == 'M')
+ {
+ mangled++;
+ /* Also skip over any type modifiers. */
+ mangled += dlang_type_modifier_p (mangled);
+ }
+
+ switch (*mangled)
+ {
+ case 'F': case 'U': case 'V':
+ case 'W': case 'R':
+ return 1;
default:
return 0;
@@ -1178,11 +1254,16 @@ dlang_parse_symbol (string *decl, const char *mangled)
if (mangled && dlang_call_convention_p (mangled))
{
+ string mods;
int saved;
/* Skip over 'this' parameter. */
if (*mangled == 'M')
- mangled += (mangled[1] == 'x') ? 2 : 1;
+ mangled++;
+
+ /* Save the type modifiers for appending at the end. */
+ string_init (&mods);
+ mangled = dlang_type_modifiers (&mods, mangled);
/* Skip over calling convention and attributes in qualified name. */
saved = string_length (decl);
@@ -1201,6 +1282,10 @@ dlang_parse_symbol (string *decl, const char *mangled)
mangled = dlang_type (decl, mangled);
string_setlength (decl, saved);
}
+
+ /* Add any const/immutable/shared modifier. */
+ string_appendn (decl, mods.b, string_length (&mods));
+ string_delete (&mods);
}
}
while (mangled && ISDIGIT (*mangled));
diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected
index b023f6d..8044506 100644
--- a/libiberty/testsuite/d-demangle-expected
+++ b/libiberty/testsuite/d-demangle-expected
@@ -753,6 +753,70 @@ demangle.test!(demangle.S(1, 2))
_D8demangle35__T4testVS8demangle1SS2i1a3_616263Zv
demangle.test!(demangle.S(1, "abc"))
#
+--format=dlang
+_D8demangle4testMxFZv
+demangle.test() const
+#
+--format=dlang
+_D8demangle4testMyFZv
+demangle.test() immutable
+#
+--format=dlang
+_D8demangle4testMNgFZv
+demangle.test() inout
+#
+--format=dlang
+_D8demangle4testMNgxFZv
+demangle.test() inout const
+#
+--format=dlang
+_D8demangle4testMOFZv
+demangle.test() shared
+#
+--format=dlang
+_D8demangle4testMOxFZv
+demangle.test() shared const
+#
+--format=dlang
+_D8demangle4testMONgFZv
+demangle.test() shared inout
+#
+--format=dlang
+_D8demangle4testMONgxFZv
+demangle.test() shared inout const
+#
+--format=dlang
+_D8demangle4testFDxFZaZv
+demangle.test(char() delegate const)
+#
+--format=dlang
+_D8demangle4testFDyFZaZv
+demangle.test(char() delegate immutable)
+#
+--format=dlang
+_D8demangle4testFDNgFZaZv
+demangle.test(char() delegate inout)
+#
+--format=dlang
+_D8demangle4testFDNgxFZaZv
+demangle.test(char() delegate inout const)
+#
+--format=dlang
+_D8demangle4testFDOFZaZv
+demangle.test(char() delegate shared)
+#
+--format=dlang
+_D8demangle4testFDOxFZaZv
+demangle.test(char() delegate shared const)
+#
+--format=dlang
+_D8demangle4testFDONgFZaZv
+demangle.test(char() delegate shared inout)
+#
+--format=dlang
+_D8demangle4testFDONgxFZaZv
+demangle.test(char() delegate shared inout const)
+#
# Unittests
#
--format=dlang
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/7] [D] libiberty: Include type modifiers in demangled function symbols
2015-05-13 8:51 [PATCH 3/7] [D] libiberty: Include type modifiers in demangled function symbols Iain Buclaw
2015-05-13 20:36 ` Iain Buclaw
@ 2015-05-14 13:09 ` Jeff Law
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Law @ 2015-05-14 13:09 UTC (permalink / raw)
To: Iain Buclaw, gcc-patches, Ian Lance Taylor
On 05/13/2015 02:51 AM, Iain Buclaw wrote:
> Like C++ const and volatile, in D mangled symbols can exist modifiers
> that represent the const, immutable, inout and shared-ness of the
> 'this' parameter.
>
> This information should be written out in the demangled symbol to show
> that each variant has a unique identity.
>
> ---
> libiberty/ChangeLog:
>
> 2015-05-13 Iain Buclaw <ibuclaw@gdcproject.org>
> * d-demangle.c (dlang_type_modifiers): New function.
> (dlang_type_modifier_p): New function.
> (dlang_call_convention_p): Ignore any kind of type modifier.
> (dlang_type): Handle and emit the type modifier after delegate types.
> (dlang_parse_symbol): Handle and emit the type modifier after the symbol.
> * testsuite/d-demangle-expected: Add coverage tests for all valid
> usages of function symbols with type modifiers.
OK.
jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-14 13:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 8:51 [PATCH 3/7] [D] libiberty: Include type modifiers in demangled function symbols Iain Buclaw
2015-05-13 20:36 ` Iain Buclaw
2015-05-13 20:52 ` Iain Buclaw
2015-05-14 13:09 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).