Fix duplicate name issues in output of -fdump-ada-spec
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Jun 2021 15:46:15 +0000 (17:46 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Jun 2021 15:56:59 +0000 (17:56 +0200)
commit5f2ef25b08f782a9f72adb8e6389ce66d302594b
tree5605164a49cc71afcea0793ad09df720f1abff14
parent04affb328c6a7e29427287c5192da38864f0dbca
Fix duplicate name issues in output of -fdump-ada-spec

The namespace rules are different in the C family of languages and
in Ada, and a few adjustments are further needed in -fdump-ada-spec
because of them.

gcc/c-family/
* c-ada-spec.c (dump_ada_enum_type): Dump a prefix for constants.
(htable_t): New typedef.
(overloaded_names): Use it.
(add_name): New function.
(init_overloaded_names): Use add_name to populate the table and add
special cases for sigaction and stat.
(overloaded_name_p): Rename into...
(overloading_index): ...this.  Do not initialize overloaded_names table
here.  Return the index or zero.
(dump_ada_declaration): Minor tweaks.  Do not skip overloaded functions
but add an overloading suffix instead.
(dump_ada_specs): Initialize overloaded_names tables here.
gcc/c-family/c-ada-spec.c