aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2022-05-26 10:27:42 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2022-07-04 07:45:57 +0000
commit4b766285b089ba1bce91a7644b9d97836e80cda3 (patch)
tree1d9f62e39d22a645449d7b48e490e3a2b6fbb8ef /gcc/ada/sem_res.adb
parent78f13b008ab58794057847a74903ee4569829d80 (diff)
downloadgcc-4b766285b089ba1bce91a7644b9d97836e80cda3.zip
gcc-4b766285b089ba1bce91a7644b9d97836e80cda3.tar.gz
gcc-4b766285b089ba1bce91a7644b9d97836e80cda3.tar.bz2
[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.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index fd1615d..650b7d5 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -144,7 +144,7 @@ package body Sem_Res is
-- returns true if the prefix denotes an atomic object that has an address
-- clause (the case in which we may want to issue a warning).
- function Is_Definite_Access_Type (E : Entity_Id) return Boolean;
+ function Is_Definite_Access_Type (E : N_Entity_Id) return Boolean;
-- Determine whether E is an access type declared by an access declaration,
-- and not an (anonymous) allocator type.
@@ -1510,7 +1510,7 @@ package body Sem_Res is
-- Is_Definite_Access_Type --
-----------------------------
- function Is_Definite_Access_Type (E : Entity_Id) return Boolean is
+ function Is_Definite_Access_Type (E : N_Entity_Id) return Boolean is
Btyp : constant Entity_Id := Base_Type (E);
begin
return Ekind (Btyp) = E_Access_Type
@@ -1561,7 +1561,7 @@ package body Sem_Res is
Orig_Type : Entity_Id := Empty;
Pack : Entity_Id;
- type Kind_Test is access function (E : Entity_Id) return Boolean;
+ type Kind_Test is access function (E : N_Entity_Id) return Boolean;
function Operand_Type_In_Scope (S : Entity_Id) return Boolean;
-- If the operand is not universal, and the operator is given by an