[c-family] Fix -fdump-ada-spec ordering issue in C++

Eric Botcazou ebotcazou@adacore.com
Mon Nov 30 12:38:00 GMT 2015


This fixes an ordering issue in the Ada code generated by the -fdump-ada-spec 
option with the C++ compiler on structures/unions with nested anonymous arrays 
of structures/unions.

Given that this only affects the Ada code generated by -fdump-ada-spec and has 
no effect whatsoever on the C and C++ compilers, I have already installed it.

Tested on x86_64-suse-linux, applied on the mainline.

2015-11-30  Eric Botcazou  <ebotcazou@adacore.com>

c-family/
	* c-ada-spec.c (print_ada_macros): Remove redundant blank line.
	(decl_sloc_common): Delete and move bulk of processing to...
	(decl_sloc): ...here.
	(pp_ada_tree_identifier): Remove reference to QUAL_UNION_TYPE.
	(dump_ada_double_name): Remove S parameter and compute the suffix.
	(dump_ada_array_type): Add PARENT parameter.  Simplify computation of
	element type and deal with an anonymous one.
	(dump_ada_template): Use RECORD_OR_UNION_TYPE_P macro.
	(dump_generic_ada_node): Tweak.  Adjust call to dump_ada_array_type
	and remove reference to QUAL_UNION_TYPE.
	(dump_nested_types): Make 2 passes on the fields and move bulk to...
	(dump_nested_type): ...here.  New function extracted from above.
	Generate a full declaration for anonymous element type of arrays.
	(print_ada_declaration): Really skip anonymous declarations.  Remove
	references to QUAL_UNION_TYPE.  Adjust call to dump_ada_array_type.
	Clean up processing of declarations of array types and objects.
	(print_ada_struct_decl): Remove reference to QUAL_UNION_TYPE.
	Remove obsolete code and tidy up.


2015-11-30  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/dump-ada-spec-1.c: Move to...
	* c-c++-common/dump-ada-spec-1.c: ...here.
	* c-c++-common/dump-ada-spec-2.c: New test.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 22869 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151130/b2af3bbf/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dump-ada-spec-2.c
Type: text/x-csrc
Size: 496 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151130/b2af3bbf/attachment-0001.bin>


More information about the Gcc-patches mailing list