[c-family] Fix issue for nested record types with -fdump-ada-spec

Eric Botcazou botcazou@adacore.com
Thu Jun 3 15:56:25 GMT 2021


Ada does not support anonymous record declarations nested in other record 
declarations so -fdump-ada-spec needs to unnest them, and this contains a few 
fixes for this machinery.

Tested on x86-64/Linux, applied on the mainline.


2021-06-03  Eric Botcazou  <ebotcazou@adacore.com>

c-family/
	* c-ada-spec.c (dump_ada_macros): Minor tweaks.
	(dump_ada_decl_name): Likewise.
	(dump_anonymous_type_name): Remove parent parameter and adjust.
	(dump_sloc): Minor tweak.
	(dump_ada_array_type): Remove type parameter and adjust.
	(dump_ada_enum_type): Remove parent parameter and adjust.
	(dump_ada_node): Adjust calls to above functions.
	(dumped_anonymous_types): New global variable.
	(dump_nested_types_1): Rename into...
	(dump_nested_types): ...this.
	(dump_nested_type): Remove parent and dumped_types parameters.
	<ARRAY_TYPE>: Replace dumped_types with dumped_anonymous_types.
	Adjust calls to dump_anonymous_type_name and dump_ada_array_type.
	(dump_ada_specs): Initialize and free dumped_anonymous_types.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 12201 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210603/d424d253/attachment.bin>


More information about the Gcc-patches mailing list