aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-05-14 21:56:29 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-07 05:26:59 -0400
commiteada42206385b31baa5bb62d78115b2ac2730e7b (patch)
tree9842b6b18c59baef180c844d0c10509624bd0ea3
parente082411903f528de5cc48ba206c5f5253861e65d (diff)
downloadgcc-eada42206385b31baa5bb62d78115b2ac2730e7b.zip
gcc-eada42206385b31baa5bb62d78115b2ac2730e7b.tar.gz
gcc-eada42206385b31baa5bb62d78115b2ac2730e7b.tar.bz2
[Ada] Use Is_Generic_Subprogram where possible
gcc/ada/ * einfo.adb, sem_ch10.adb, sem_ch12.adb, sem_ch8.adb: Use Is_Generic_Subprogram.
-rw-r--r--gcc/ada/einfo.adb8
-rw-r--r--gcc/ada/sem_ch10.adb2
-rw-r--r--gcc/ada/sem_ch12.adb3
-rw-r--r--gcc/ada/sem_ch8.adb2
4 files changed, 5 insertions, 10 deletions
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index b482709..c2a2e14d 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -2577,9 +2577,7 @@ package body Einfo is
function Is_Primitive (Id : E) return B is
begin
- pragma Assert
- (Is_Overloadable (Id)
- or else Ekind_In (Id, E_Generic_Function, E_Generic_Procedure));
+ pragma Assert (Is_Overloadable (Id) or else Is_Generic_Subprogram (Id));
return Flag218 (Id);
end Is_Primitive;
@@ -5822,9 +5820,7 @@ package body Einfo is
procedure Set_Is_Primitive (Id : E; V : B := True) is
begin
- pragma Assert
- (Is_Overloadable (Id)
- or else Ekind_In (Id, E_Generic_Function, E_Generic_Procedure));
+ pragma Assert (Is_Overloadable (Id) or else Is_Generic_Subprogram (Id));
Set_Flag218 (Id, V);
end Set_Is_Primitive;
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index f439382..c79bd58 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -6313,7 +6313,7 @@ package body Sem_Ch10 is
if Is_Subprogram (E) and then Has_Pragma_Inline (E) then
return True;
- elsif Ekind_In (E, E_Generic_Function, E_Generic_Procedure) then
+ elsif Is_Generic_Subprogram (E) then
-- A generic subprogram always requires the presence of its
-- body because an instantiation needs both templates. The only
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 97e9ab8..11b6ce2 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -5664,8 +5664,7 @@ package body Sem_Ch12 is
-- If renaming, get original unit
if Present (Renamed_Object (Gen_Unit))
- and then Ekind_In (Renamed_Object (Gen_Unit), E_Generic_Procedure,
- E_Generic_Function)
+ and then Is_Generic_Subprogram (Renamed_Object (Gen_Unit))
then
Gen_Unit := Renamed_Object (Gen_Unit);
Set_Is_Instantiated (Gen_Unit);
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index befd4a8..bc52eb0 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -729,7 +729,7 @@ package body Sem_Ch8 is
-- For subprograms, propagate the Intrinsic flag, to allow, e.g.
-- renamings and subsequent instantiations of Unchecked_Conversion.
- if Ekind_In (Old_P, E_Generic_Function, E_Generic_Procedure) then
+ if Is_Generic_Subprogram (Old_P) then
Set_Is_Intrinsic_Subprogram
(New_P, Is_Intrinsic_Subprogram (Old_P));
end if;