* [PATCH 1/3] libiberty: Add support for D `typeof(*null)' types
@ 2021-08-29 18:46 Iain Buclaw
2021-08-29 20:55 ` Jeff Law
0 siblings, 1 reply; 3+ messages in thread
From: Iain Buclaw @ 2021-08-29 18:46 UTC (permalink / raw)
To: gcc-patches
Hi,
The D language has a new bottom type `typeof(*null)'. Null types were
also incorrectly being demangled as `none', this has been fixed to be
`typeof(null)'.
Bootstrapped and regression tested on x86_64-linux-gnu.
OK for mainline?
Regards,
Iain.
---
libiberty/ChangeLog:
* d-demangle.c (dlang_attributes): Handle typeof(*null).
(dlang_type): Likewise. Demangle 'n' as typeof(null).
* testsuite/d-demangle-expected: Update tests.
---
libiberty/d-demangle.c | 12 ++++++++++--
libiberty/testsuite/d-demangle-expected | 6 +++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c
index 822c7580782..c34f91843de 100644
--- a/libiberty/d-demangle.c
+++ b/libiberty/d-demangle.c
@@ -573,9 +573,11 @@ dlang_attributes (string *decl, const char *mangled)
case 'g':
case 'h':
case 'k':
+ case 'n':
/* inout parameter is represented as 'Ng'.
vector parameter is represented as 'Nh'.
- return paramenter is represented as 'Nk'.
+ return parameter is represented as 'Nk'.
+ typeof(*null) parameter is represented as 'Nn'.
If we see this, then we know we're really in the
parameter list. Rewind and break. */
mangled--;
@@ -787,6 +789,12 @@ dlang_type (string *decl, const char *mangled, struct dlang_info *info)
string_append (decl, ")");
return mangled;
}
+ else if (*mangled == 'n') /* typeof(*null) */
+ {
+ mangled++;
+ string_append (decl, "typeof(*null)");
+ return mangled;
+ }
else
return NULL;
case 'A': /* dynamic array (T[]) */
@@ -884,7 +892,7 @@ dlang_type (string *decl, const char *mangled, struct dlang_info *info)
/* Basic types */
case 'n':
mangled++;
- string_append (decl, "none");
+ string_append (decl, "typeof(null)");
return mangled;
case 'v':
mangled++;
diff --git a/libiberty/testsuite/d-demangle-expected b/libiberty/testsuite/d-demangle-expected
index ba0ffed5c8d..00036e7810a 100644
--- a/libiberty/testsuite/d-demangle-expected
+++ b/libiberty/testsuite/d-demangle-expected
@@ -83,7 +83,11 @@ demangle.test(ulong)
#
--format=dlang
_D8demangle4testFnZv
-demangle.test(none)
+demangle.test(typeof(null))
+#
+--format=dlang
+_D8demangle4testFNnZv
+demangle.test(typeof(*null))
#
--format=dlang
_D8demangle4testFoZv
--
2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/3] libiberty: Add support for D `typeof(*null)' types
2021-08-29 18:46 [PATCH 1/3] libiberty: Add support for D `typeof(*null)' types Iain Buclaw
@ 2021-08-29 20:55 ` Jeff Law
2021-08-29 22:52 ` Iain Buclaw
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2021-08-29 20:55 UTC (permalink / raw)
To: Iain Buclaw, gcc-patches
On 8/29/2021 12:46 PM, Iain Buclaw via Gcc-patches wrote:
> Hi,
>
> The D language has a new bottom type `typeof(*null)'. Null types were
> also incorrectly being demangled as `none', this has been fixed to be
> `typeof(null)'.
>
> Bootstrapped and regression tested on x86_64-linux-gnu.
>
> OK for mainline?
>
> Regards,
> Iain.
>
> ---
> libiberty/ChangeLog:
>
> * d-demangle.c (dlang_attributes): Handle typeof(*null).
> (dlang_type): Likewise. Demangle 'n' as typeof(null).
> * testsuite/d-demangle-expected: Update tests.
I'd argue anything in d-demangle would fall under your maintainership
for D. So, OK and similarly for the other two D demangling patches.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/3] libiberty: Add support for D `typeof(*null)' types
2021-08-29 20:55 ` Jeff Law
@ 2021-08-29 22:52 ` Iain Buclaw
0 siblings, 0 replies; 3+ messages in thread
From: Iain Buclaw @ 2021-08-29 22:52 UTC (permalink / raw)
To: gcc-patches, Jeff Law
Excerpts from Jeff Law's message of August 29, 2021 10:55 pm:
>
>
> On 8/29/2021 12:46 PM, Iain Buclaw via Gcc-patches wrote:
>> Hi,
>>
>> The D language has a new bottom type `typeof(*null)'. Null types were
>> also incorrectly being demangled as `none', this has been fixed to be
>> `typeof(null)'.
>>
>> Bootstrapped and regression tested on x86_64-linux-gnu.
>>
>> OK for mainline?
>>
>> Regards,
>> Iain.
>>
>> ---
>> libiberty/ChangeLog:
>>
>> * d-demangle.c (dlang_attributes): Handle typeof(*null).
>> (dlang_type): Likewise. Demangle 'n' as typeof(null).
>> * testsuite/d-demangle-expected: Update tests.
> I'd argue anything in d-demangle would fall under your maintainership
> for D. So, OK and similarly for the other two D demangling patches.
>
> jeff
>
OK, I'll keep that in mind for future ABI updates.
Thanks,
Iain.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-29 22:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-29 18:46 [PATCH 1/3] libiberty: Add support for D `typeof(*null)' types Iain Buclaw
2021-08-29 20:55 ` Jeff Law
2021-08-29 22:52 ` 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).