aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-10-28 09:27:18 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-11-26 03:39:57 -0500
commitaa83f3d0b7cf49ae10eed1fc4539ba1997035fef (patch)
tree878fce3ead6b5f31590fdad03f96d852aac57f15 /gcc
parentebf90d68e9472ad08e2840ecdbf0ad69fd339830 (diff)
downloadgcc-aa83f3d0b7cf49ae10eed1fc4539ba1997035fef.zip
gcc-aa83f3d0b7cf49ae10eed1fc4539ba1997035fef.tar.gz
gcc-aa83f3d0b7cf49ae10eed1fc4539ba1997035fef.tar.bz2
[Ada] Reuse Is_Generic_Subprogram where possible
gcc/ada/ * lib-writ.adb, sem_ch8.adb, sem_prag.adb: Use Is_Generic_Subprogram instead of low-level membership tests.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/lib-writ.adb4
-rw-r--r--gcc/ada/sem_ch8.adb5
-rw-r--r--gcc/ada/sem_prag.adb7
3 files changed, 5 insertions, 11 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index f17b46a..34a8d631 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -1125,9 +1125,7 @@ package body Lib.Writ is
if Nkind (U) = N_Subprogram_Body
and then Present (Corresponding_Spec (U))
- and then
- Ekind (Corresponding_Spec (U)) in E_Generic_Procedure
- | E_Generic_Function
+ and then Is_Generic_Subprogram (Corresponding_Spec (U))
then
null;
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 950d4a0..4c80e024 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -8750,9 +8750,8 @@ package body Sem_Ch8 is
-- Mark primitives
- elsif (Ekind (Id) in Overloadable_Kind
- or else Ekind (Id) in
- E_Generic_Function | E_Generic_Procedure)
+ elsif (Is_Overloadable (Id)
+ or else Is_Generic_Subprogram (Id))
and then (Is_Potentially_Use_Visible (Id)
or else Is_Intrinsic_Subprogram (Id)
or else (Ekind (Id) in E_Function | E_Procedure
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index d06e68c..05ff511 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -24781,18 +24781,15 @@ package body Sem_Prag is
-- body, not in the spec).
when Pragma_Unimplemented_Unit => Unimplemented_Unit : declare
- Cunitent : constant Entity_Id :=
+ Cunitent : constant Entity_Id :=
Cunit_Entity (Get_Source_Unit (Loc));
- Ent_Kind : constant Entity_Kind := Ekind (Cunitent);
begin
GNAT_Pragma;
Check_Arg_Count (0);
if Operating_Mode = Generate_Code
- or else Ent_Kind = E_Generic_Function
- or else Ent_Kind = E_Generic_Procedure
- or else Ent_Kind = E_Generic_Package
+ or else Is_Generic_Unit (Cunitent)
then
Get_Name_String (Chars (Cunitent));
Set_Casing (Mixed_Case);