* [gcc patch 3/3] cp-demangle.c: Fix DMGL_RET_POSTFIX for inner func types
@ 2011-06-02 14:17 Jan Kratochvil
2011-06-13 18:23 ` Ian Lance Taylor
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2011-06-02 14:17 UTC (permalink / raw)
To: gcc-patches; +Cc: gdb-patches
Hi,
I do not need this patch in any way but I believe it should go in for the case
anyone would want to use DMGL_RET_POSTFIX with C/C++.
Without this fix the new testcase would:
FAIL at line 3979, options --format=gnu-v3 --ret-postfix:
in: _Z6outer2IsEPFilES1_
out: outer2<short>(int (*)(long))int (*(int (*)(long)))(long)
exp: outer2<short>(int (*)(long))int (*)(long)
Thanks,
Jan
libiberty/
2011-05-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* cp-demangle.c (d_print_comp) <DEMANGLE_COMPONENT_FUNCTION_TYPE>:
Suppress d_print_mod for DMGL_RET_POSTFIX.
* testsuite/demangle-expected: New testcases for --ret-postfix.
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3921,7 +3921,10 @@ d_print_comp (struct d_print_info *dpi, const struct demangle_component *dc,
options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP));
/* Print return type if present */
- if (d_left (dc) != NULL && (options & DMGL_RET_DROP) == 0)
+ if (d_left (dc) != NULL && (options & DMGL_RET_POSTFIX) != 0)
+ d_print_comp (dpi, d_left (dc),
+ options & ~(DMGL_RET_POSTFIX | DMGL_RET_DROP));
+ else if (d_left (dc) != NULL && (options & DMGL_RET_DROP) == 0)
{
struct d_print_mod dpm;
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3968,6 +3968,15 @@ outer(short (*)(int), long)
--format=gnu-v3
_Z6outer2IsEPFilES1_
int (*outer2<short>(int (*)(long)))(long)
+--format=gnu-v3 --ret-postfix
+_Z5outerIsEcPFilE
+outer<short>(int (*)(long))char
+--format=gnu-v3 --ret-postfix
+_Z5outerPFsiEl
+outer(short (*)(int), long)
+--format=gnu-v3 --ret-postfix
+_Z6outer2IsEPFilES1_
+outer2<short>(int (*)(long))int (*)(long)
--format=gnu-v3 --ret-drop
_Z5outerIsEcPFilE
outer<short>(int (*)(long))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gcc patch 3/3] cp-demangle.c: Fix DMGL_RET_POSTFIX for inner func types
2011-06-02 14:17 [gcc patch 3/3] cp-demangle.c: Fix DMGL_RET_POSTFIX for inner func types Jan Kratochvil
@ 2011-06-13 18:23 ` Ian Lance Taylor
2011-06-14 0:48 ` Jan Kratochvil
0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2011-06-13 18:23 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gcc-patches, gdb-patches
On Thu, Jun 2, 2011 at 7:17 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
>
> libiberty/
> 2011-05-24 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * cp-demangle.c (d_print_comp) <DEMANGLE_COMPONENT_FUNCTION_TYPE>:
> Suppress d_print_mod for DMGL_RET_POSTFIX.
> * testsuite/demangle-expected: New testcases for --ret-postfix.
This is OK.
Thanks.
Ian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gcc patch 3/3] cp-demangle.c: Fix DMGL_RET_POSTFIX for inner func types
2011-06-13 18:23 ` Ian Lance Taylor
@ 2011-06-14 0:48 ` Jan Kratochvil
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2011-06-14 0:48 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gdb-patches
On Mon, 13 Jun 2011 20:09:57 +0200, Ian Lance Taylor wrote:
> On Thu, Jun 2, 2011 at 7:17 AM, Jan Kratochvil
> <jan.kratochvil@redhat.com> wrote:
> >
> > libiberty/
> > 2011-05-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
> >
> > Â Â Â Â * cp-demangle.c (d_print_comp) <DEMANGLE_COMPONENT_FUNCTION_TYPE>:
> > Â Â Â Â Suppress d_print_mod for DMGL_RET_POSTFIX.
> > Â Â Â Â * testsuite/demangle-expected: New testcases for --ret-postfix.
>
> This is OK.
Checked in:
http://gcc.gnu.org/viewcvs?view=revision&revision=175001
Thanks,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-13 22:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-02 14:17 [gcc patch 3/3] cp-demangle.c: Fix DMGL_RET_POSTFIX for inner func types Jan Kratochvil
2011-06-13 18:23 ` Ian Lance Taylor
2011-06-14 0:48 ` Jan Kratochvil
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).