]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix small regression with -fdump-ada-spec
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 5 Apr 2021 17:49:56 +0000 (19:49 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 5 Apr 2021 17:52:29 +0000 (19:52 +0200)
commit7ebdef2076fda56cb4cffb941f6c2576f980f3b3
tree7363fd884d965637daf1edafd9fe8bf92f4f8441
parentf1d012911bd103e9701ed378f32928a3cbcf028a
Fix small regression with -fdump-ada-spec

When the enumeration constants of an enumeration type are defined by
explicit values, the binding generated by -fdump-ada-spec does not use
an enumeration type on the Ada side, because the set of allowed values
in C/C++ is larger than the set of allowed values in Ada, but instead
use an integer subtype and defines a set of explicit constants, which
used to be of this subtype but were changed to the base type at some
point.  This reinstates the subtype for them.

gcc/c-family/
* c-ada-spec.c (is_simple_enum): Minor tweaks.
(dump_ada_enum_type): Add TYPE and PARENT parameters.  For non-simple
enumeral types use again the type name for the enumeration constants.
(dump_ada_node): Adjust call to dump_ada_enum_type.
(dump_nested_type): Likewise.
gcc/c-family/c-ada-spec.c