aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-01-06 12:04:56 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-04 05:17:32 -0400
commit86a9605014f424c556032c2c1586cbfbc4b72131 (patch)
tree24632c344b8f3828ec2dfdc60b45ba5d5b8f7c5d
parent2d5e5d89add24b9f987646c83db4639c77132be2 (diff)
downloadgcc-86a9605014f424c556032c2c1586cbfbc4b72131.zip
gcc-86a9605014f424c556032c2c1586cbfbc4b72131.tar.gz
gcc-86a9605014f424c556032c2c1586cbfbc4b72131.tar.bz2
[Ada] Reuse Is_Formal_Object where convenient
gcc/ada/ * exp_prag.adb, sem_prag.adb: Replace low-level Ekind membership tests with a high-level call to Is_Formal_Object.
-rw-r--r--gcc/ada/exp_prag.adb3
-rw-r--r--gcc/ada/sem_prag.adb8
2 files changed, 3 insertions, 8 deletions
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb
index c559184..53c937d 100644
--- a/gcc/ada/exp_prag.adb
+++ b/gcc/ada/exp_prag.adb
@@ -2368,10 +2368,9 @@ package body Exp_Prag is
if Comes_From_Source (E)
and then Is_Object (E)
and then not Is_Entry_Formal (E)
+ and then not Is_Formal_Object (E)
and then Ekind (E) /= E_Component
and then Ekind (E) /= E_Discriminant
- and then Ekind (E) /= E_Generic_In_Parameter
- and then Ekind (E) /= E_Generic_In_Out_Parameter
then
Append_To (A,
Make_Pragma_Argument_Association (Loc,
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index e175206..b654495 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -718,9 +718,7 @@ package body Sem_Prag is
elsif Ekind (Item_Id) = E_Constant then
Add_Str_To_Name_Buffer ("constant");
- elsif Ekind (Item_Id) in
- E_Generic_In_Out_Parameter | E_Generic_In_Parameter
- then
+ elsif Is_Formal_Object (Item_Id) then
Add_Str_To_Name_Buffer ("generic parameter");
elsif Is_Formal (Item_Id) then
@@ -3098,9 +3096,7 @@ package body Sem_Prag is
-- it is allowed for an initialization item to depend
-- on an input item.
- if Ekind (Input_Id) in E_Generic_In_Out_Parameter
- | E_Generic_In_Parameter
- then
+ if Is_Formal_Object (Input_Id) then
null;
elsif Ekind (Input_Id) in E_Constant | E_Variable