* [PATCH 3/3] [D] libiberty: Prefix mangled D initializer symbols
@ 2017-05-26 16:17 Iain Buclaw
2017-05-26 18:41 ` Ian Lance Taylor via gcc-patches
0 siblings, 1 reply; 3+ messages in thread
From: Iain Buclaw @ 2017-05-26 16:17 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 310 bytes --]
This is instead of adding a `.init$' postfix, which gave it a
property-style name. My rationale being that "initializer for symbol"
is much more informative when inspecting D runtime type information in
gdb, which is the only place where you would encounter references to
this compiler-generated symbol.
---
[-- Attachment #2: 03-d-prefix-init.patch --]
[-- Type: text/x-patch, Size: 1377 bytes --]
commit a99454b6c27a2564fe1a40c46b1fb593c664ef20
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Fri May 26 16:44:35 2017 +0200
libiberty/ChangeLog:
2017-05-26 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_identifier): Prefix mangled init symbols
with `initializer for'.
* testsuite/demangle-expected: Update tests.
diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c
index 829050bc0b8..08690de9bd3 100644
--- a/libiberty/d-demangle.c
+++ b/libiberty/d-demangle.c
@@ -864,7 +864,8 @@ dlang_identifier (string *decl, const char *mangled,
else if (strncmp (mangled, "__initZ", len+1) == 0)
{
/* The static initialiser for a given symbol. */
- string_append (decl, "init$");
+ string_prepend (decl, "initializer for ");
+ string_setlength (decl, string_length (decl) - 1);
mangled += len;
return mangled;
}
diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected
index 7bf8b1725f9..547a2ddec39 100644
--- a/libiberty/testsuite/d-demangle-expected
+++ b/libiberty/testsuite/d-demangle-expected
@@ -587,7 +587,7 @@ demangle.test(scope char() scope function)
#
--format=dlang
_D8demangle4test6__initZ
-demangle.test.init$
+initializer for demangle.test
#
--format=dlang
_D8demangle4test6__vtblZ
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] [D] libiberty: Prefix mangled D initializer symbols
2017-05-26 16:17 [PATCH 3/3] [D] libiberty: Prefix mangled D initializer symbols Iain Buclaw
@ 2017-05-26 18:41 ` Ian Lance Taylor via gcc-patches
2017-05-28 12:31 ` Iain Buclaw
0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor via gcc-patches @ 2017-05-26 18:41 UTC (permalink / raw)
To: Iain Buclaw; +Cc: gcc-patches
On Fri, May 26, 2017 at 9:08 AM, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> This is instead of adding a `.init$' postfix, which gave it a
> property-style name. My rationale being that "initializer for symbol"
> is much more informative when inspecting D runtime type information in
> gdb, which is the only place where you would encounter references to
> this compiler-generated symbol.
This is OK.
Thanks.
Ian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] [D] libiberty: Prefix mangled D initializer symbols
2017-05-26 18:41 ` Ian Lance Taylor via gcc-patches
@ 2017-05-28 12:31 ` Iain Buclaw
0 siblings, 0 replies; 3+ messages in thread
From: Iain Buclaw @ 2017-05-28 12:31 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches
On 26 May 2017 at 20:20, Ian Lance Taylor <iant@google.com> wrote:
> On Fri, May 26, 2017 at 9:08 AM, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>> This is instead of adding a `.init$' postfix, which gave it a
>> property-style name. My rationale being that "initializer for symbol"
>> is much more informative when inspecting D runtime type information in
>> gdb, which is the only place where you would encounter references to
>> this compiler-generated symbol.
>
> This is OK.
>
> Thanks.
>
> Ian
Thanks, have committed this to trunk.
Regards
Iain
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-28 8:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 16:17 [PATCH 3/3] [D] libiberty: Prefix mangled D initializer symbols Iain Buclaw
2017-05-26 18:41 ` Ian Lance Taylor via gcc-patches
2017-05-28 12:31 ` Iain Buclaw
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).