From b21732c521b5edd4919cf828a9716ce6f865b080 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Thu, 23 Jul 2020 23:26:20 +0200 Subject: [PATCH] [Ada] Replace low-level Ekind membership tests with high-level Is_Formal gcc/ada/ * einfo.adb, exp_attr.adb, sem_ch13.adb, sem_util.adb: Use Is_Formal where possible. --- gcc/ada/einfo.adb | 4 ++-- gcc/ada/exp_attr.adb | 2 +- gcc/ada/sem_ch13.adb | 2 +- gcc/ada/sem_util.adb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 9ea261683c4..63878e4e1ed 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -2864,7 +2864,7 @@ package body Einfo is function Minimum_Accessibility (Id : E) return E is begin - pragma Assert (Ekind (Id) in Formal_Kind); + pragma Assert (Is_Formal (Id)); return Node24 (Id); end Minimum_Accessibility; @@ -6130,7 +6130,7 @@ package body Einfo is procedure Set_Minimum_Accessibility (Id : E; V : E) is begin - pragma Assert (Ekind (Id) in Formal_Kind); + pragma Assert (Is_Formal (Id)); Set_Node24 (Id, V); end Set_Minimum_Accessibility; diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 0bc08aee035..c596659e356 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -2334,7 +2334,7 @@ package body Exp_Attr is and then Is_Entity_Name (Prefix (Enc_Object)) and then (Ekind (Btyp) = E_General_Access_Type or else Is_Local_Anonymous_Access (Btyp)) - and then Ekind (Entity (Prefix (Enc_Object))) in Formal_Kind + and then Is_Formal (Entity (Prefix (Enc_Object))) and then Ekind (Etype (Entity (Prefix (Enc_Object)))) = E_Anonymous_Access_Type and then Present (Extra_Accessibility diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 63ca3211f43..ab00b59c7d8 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -7205,7 +7205,7 @@ package body Sem_Ch13 is -- check (C) - if Present (Obj) and then Ekind (Obj) in Formal_Kind then + if Present (Obj) and then Is_Formal (Obj) then Error_Msg_N ("subpool cannot be part of a parameter", Ent); return; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 45a551f16d0..b8bdc7bfa17 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -9578,7 +9578,7 @@ package body Sem_Util is -- To avoid these situations where expansion may get complex we verify -- that the minimum accessibility object is within scope. - if Ekind (E) in Formal_Kind + if Is_Formal (E) and then Present (Minimum_Accessibility (E)) and then In_Open_Scopes (Scope (Minimum_Accessibility (E))) then -- 2.43.5