]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Assertions in Einfo.Utils
authorBob Duff <duff@adacore.com>
Thu, 26 May 2022 14:27:42 +0000 (10:27 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 4 Jul 2022 07:45:57 +0000 (07:45 +0000)
commit4b766285b089ba1bce91a7644b9d97836e80cda3
tree1d9f62e39d22a645449d7b48e490e3a2b6fbb8ef
parent78f13b008ab58794057847a74903ee4569829d80
[Ada] Assertions in Einfo.Utils

Add predicates on subtypes E and N.

gcc/ada/

* einfo-utils.ads, einfo-utils.adb: Add predicates on subtypes E
and N.  Change some parameters to use the unpredicated subtypes,
because they sometimes return e.g. Empty.  Note that N_Entity_Id
has a predicate; Entity_Id does not.
* exp_tss.adb (Base_Init_Proc): Use Entity_Id instead of E,
because otherwise we fail the predicate. We shouldn't be
referring to single-letter names from far away anyway.
* sem_aux.adb (Is_Derived_Type): Likewise.
* sem_res.adb (Is_Definite_Access_Type): Use N_Entity_Id for
predicate.
* types.ads (Entity_Id): Add comment explaining the difference
between Entity_Id and N_Entity_Id.
gcc/ada/einfo-utils.adb
gcc/ada/einfo-utils.ads
gcc/ada/exp_tss.adb
gcc/ada/sem_aux.adb
gcc/ada/sem_res.adb
gcc/ada/types.ads