]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Switch from E_Void to Is_Not_Self_Hidden
authorBob Duff <duff@adacore.com>
Wed, 8 Mar 2023 17:15:13 +0000 (12:15 -0500)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:18 +0000 (09:44 +0200)
commit14bf9f7bb7fe6176532414093f9a5084bbd41428
treec88ab2fa628b09bcc7b498bf5a028fd2d92ac5ed
parent5b8bdb676dae45d51af82c7e56968d1e1af1a494
ada: Switch from E_Void to Is_Not_Self_Hidden

We had previously used Ekind = E_Void to indicate that a declaration is
self-hidden. We now use the Is_Not_Self_Hidden flag instead. This allows
us to avoid many "vanishing fields", which are (possibly-latent) bugs,
and we now enable the assertions in Atree that detect such bugs.

gcc/ada/

* atree.adb (Check_Vanishing_Fields): Fix bug in the "blah type
only" cases. Remove the special cases for E_Void. Misc cleanup.
(Mutate_Nkind): Disallow mutating to the same kind.
(Mutate_Ekind): Disallow mutating to E_Void.
(From E_Void is still OK -- entities start out as E_Void by
default.) Fix bug in statistics gathering -- was setting the wrong
count. Enable Check_Vanishing_Fields for entities.
* sem_ch8.adb (Is_Self_Hidden): New function.
(Find_Direct_Name): Call Is_Self_Hidden to use the new
Is_Not_Self_Hidden flag to determine whether a declaration is
hidden from all visibility by itself. This replaces the old method
of checking E_Void.
(Find_Expanded_Name): Likewise.
(Find_Selected_Component): Likewise.
* sem_util.adb (Enter_Name): Remove setting of Ekind to E_Void.
* sem_ch3.adb: Set the Is_Not_Self_Hidden flag in appropriate
places. Comment fixes.
(Inherit_Component): Remove setting of Ekind to E_Void.
* sem_ch9.adb
(Analyze_Protected_Type_Declaration): Update comment. Skip Itypes,
which should not be turned into components.
* atree.ads (Mutate_Nkind): Document error case.
(Mutate_Ekind): Remove comments apologizing for E_Void mutations.
Document error cases.
gcc/ada/atree.adb
gcc/ada/atree.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_ch9.adb
gcc/ada/sem_util.adb