Fix missing back-annotation for derived types
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 25 May 2020 08:15:12 +0000 (10:15 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 25 May 2020 08:15:12 +0000 (10:15 +0200)
commit036c83b68e7a958b75d02f392d0cb60f8b6a4ba5
tree9eef30c422b0ab26840696223a1adc1197fd4204
parent15c55b96a721721e944f8617ae59bdcb273477e6
Fix missing back-annotation for derived types

Gigi fails to back-annotate the Present_Expr field of variants present
in a type derived from a discriminated untagged record type, which is
for example visible in the output -gnatRj.

gcc/ada/ChangeLog
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Tidy up.
(build_variant_list): Add GNAT_VARIANT_PART parameter and annotate
its variants if it is present.  Adjust the recursive call by passing
the variant subpart of variants, if any.
(copy_and_substitute_in_layout): Rename GNU_SUBST_LIST to SUBST_LIST
and adjust throughout.  For a type, pass the variant part in the
call to build_variant_list.
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c