Commit 5686a6b7 by Nikhil Benesch Committed by Ian Lance Taylor

godump.c (go_output_typedef): When outputting a typedef...

gcc/:
        * godump.c (go_output_typedef): When outputting a typedef, refer
	to the underlying type by its name and not its structure.
gcc/testsuite:
        * gcc.misc-tests/godump-1.c: Add test case for typedef before
	struct.

From-SVN: r267958
parent 1abb44f8
2019-01-15 Nikhil Benesch <nikhil.benesch@gmail.com>
* godump.c (go_output_typedef): When outputting a typedef, refer
to the underlying type by its name and not its structure.
2019-01-15 David Malcolm <dmalcolm@redhat.com> 2019-01-15 David Malcolm <dmalcolm@redhat.com>
PR c++/88795 PR c++/88795
......
...@@ -1181,7 +1181,7 @@ go_output_typedef (struct godump_container *container, tree decl) ...@@ -1181,7 +1181,7 @@ go_output_typedef (struct godump_container *container, tree decl)
return; return;
*slot = CONST_CAST (void *, (const void *) type); *slot = CONST_CAST (void *, (const void *) type);
if (!go_format_type (container, TREE_TYPE (decl), false, false, NULL, if (!go_format_type (container, TREE_TYPE (decl), true, false, NULL,
false)) false))
{ {
fprintf (go_dump_file, "// "); fprintf (go_dump_file, "// ");
......
2019-01-15 Nikhil Benesch <nikhil.benesch@gmail.com>
* gcc.misc-tests/godump-1.c: Add test case for typedef before
struct.
2019-01-15 David Malcolm <dmalcolm@redhat.com> 2019-01-15 David Malcolm <dmalcolm@redhat.com>
PR c++/88795 PR c++/88795
......
...@@ -468,6 +468,11 @@ struct { double d; uint8_t : 0; } sd_not_equiv; ...@@ -468,6 +468,11 @@ struct { double d; uint8_t : 0; } sd_not_equiv;
typedef struct s_undef_t s_undef_t2; typedef struct s_undef_t s_undef_t2;
typedef struct s_fwd *s_fwd_p;
/* { dg-final { scan-file godump-1.out "(?n)^type _s_fwd_p \\*_s_fwd$" } } */
struct s_fwd { };
/* { dg-final { scan-file godump-1.out "(?n)^type _s_fwd struct \{ \}$" } } */
/*** nested structs ***/ /*** nested structs ***/
typedef struct { struct { uint8_t ca[3]; } s; uint32_t i; } tsn; typedef struct { struct { uint8_t ca[3]; } s; uint32_t i; } tsn;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment