]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Add Unique_Component_Name function for use by CCG.
authorSteve Baird <baird@adacore.com>
Fri, 27 Jun 2025 20:41:51 +0000 (13:41 -0700)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 22 Jul 2025 08:19:30 +0000 (10:19 +0200)
commit84468c33ffc2ce99678623693a98fcbdddf4ff47
treecef577b369a4b8b91fe73a3c2e2a1337696e70ba
parent3d1f1416180b586549d1a1427edfe1365e86a1a0
ada: Add Unique_Component_Name function for use by CCG.

Define a new function which, initially, is never called.
It is intended to be called from CCG. If an Ada tagged record type
has a component named Foo, then the generated corresponding C struct
might have a component with the same name. This approach almost works,
but breaks down in the (rare) case of an Ada record type where two or more
components have the same name (this is normally illegal, but is possible in
the case of an extension where some component of the parent type is not
visible at the point of the extension). This new function is intended for
use in coping with this case.

gcc/ada/ChangeLog:

* sem_aux.ads: Declare new function Unique_Component_Name.

* sem_aux.adb: Implement new function Unique_Component_Name.
gcc/ada/sem_aux.adb
gcc/ada/sem_aux.ads