aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch7.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-06-13 11:33:04 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-27 04:05:18 -0400
commit4a08c95cf0604a96e6fc48102365ef0d498f11ae (patch)
tree4251c81960f577683ea9280d94b6d0ffb13948b4 /gcc/ada/sem_ch7.adb
parent26ac7446f607b1b031bbd38fab28265fd772f8a5 (diff)
downloadgcc-4a08c95cf0604a96e6fc48102365ef0d498f11ae.zip
gcc-4a08c95cf0604a96e6fc48102365ef0d498f11ae.tar.gz
gcc-4a08c95cf0604a96e6fc48102365ef0d498f11ae.tar.bz2
[Ada] Use membership tests in front-end
gcc/ada/ * aspects.adb, atree.adb, atree.ads, checks.adb, contracts.adb, einfo.adb, errout.adb, exp_aggr.adb, exp_attr.adb, exp_cg.adb, exp_ch11.adb, exp_ch2.adb, exp_ch3.adb, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_ch8.adb, exp_ch9.adb, exp_dbug.adb, exp_disp.adb, exp_intr.adb, exp_pakd.adb, exp_prag.adb, exp_put_image.adb, exp_smem.adb, exp_tss.adb, exp_unst.adb, exp_util.adb, freeze.adb, ghost.adb, gnat1drv.adb, inline.adb, lib-writ.adb, lib-xref-spark_specific.adb, lib-xref.adb, namet.adb, namet.ads, nlists.adb, par-ch10.adb, par-ch2.adb, par-ch3.adb, par-ch4.adb, par-ch5.adb, par-ch6.adb, par-prag.adb, par-util.adb, par_sco.adb, pprint.adb, repinfo.adb, restrict.adb, rtsfind.adb, scil_ll.adb, sem.adb, sem_aggr.adb, sem_attr.adb, sem_aux.adb, sem_cat.adb, sem_ch10.adb, sem_ch11.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_ch4.adb, sem_ch5.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_ch9.adb, sem_dim.adb, sem_disp.adb, sem_dist.adb, sem_elab.adb, sem_elim.adb, sem_eval.adb, sem_intr.adb, sem_mech.adb, sem_prag.adb, sem_res.adb, sem_scil.adb, sem_type.adb, sem_util.adb, sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb, styleg.adb, tbuild.adb, treepr.adb (Nkind_In, Nam_In, Ekind_In): Removed, replaced by membership tests.
Diffstat (limited to 'gcc/ada/sem_ch7.adb')
-rw-r--r--gcc/ada/sem_ch7.adb28
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index 51a245c..3ff2001 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -464,9 +464,9 @@ package body Sem_Ch7 is
-- if they are not followed by a construct which can reference
-- and export them.
- elsif Nkind_In (Decl, N_Exception_Declaration,
- N_Object_Declaration,
- N_Object_Renaming_Declaration)
+ elsif Nkind (Decl) in N_Exception_Declaration
+ | N_Object_Declaration
+ | N_Object_Renaming_Declaration
then
Decl_Id := Defining_Entity (Decl);
@@ -483,8 +483,8 @@ package body Sem_Ch7 is
-- for them to see whether they are referenced on an individual
-- basis by looking into the table of referenced subprograms.
- elsif Nkind_In (Decl, N_Subprogram_Declaration,
- N_Subprogram_Renaming_Declaration)
+ elsif Nkind (Decl) in N_Subprogram_Declaration
+ | N_Subprogram_Renaming_Declaration
then
Decl_Id := Defining_Entity (Decl);
@@ -1370,8 +1370,8 @@ package body Sem_Ch7 is
then
Generate_Reference (Id, Scope (Id), 'k', False);
- elsif not Nkind_In (Unit (Cunit (Main_Unit)), N_Subprogram_Body,
- N_Subunit)
+ elsif Nkind (Unit (Cunit (Main_Unit))) not in
+ N_Subprogram_Body | N_Subunit
then
-- If current unit is an ancestor of main unit, generate a
-- reference to its own parent.
@@ -1437,8 +1437,8 @@ package body Sem_Ch7 is
-- prevents cascaded errors when routines defined only for type
-- entities are called with non-type entities.
- if Nkind_In (Decl, N_Incomplete_Type_Declaration,
- N_Private_Type_Declaration)
+ if Nkind (Decl) in N_Incomplete_Type_Declaration
+ | N_Private_Type_Declaration
and then Is_Type (Defining_Identifier (Decl))
and then Has_Discriminants (Defining_Identifier (Decl))
and then Present (Full_View (Defining_Identifier (Decl)))
@@ -1472,8 +1472,8 @@ package body Sem_Ch7 is
while Present (Gen_Par) and then Is_Child_Unit (Gen_Par) loop
Inst_Node := Get_Unit_Instantiation_Node (Inst_Par);
- if Nkind_In (Inst_Node, N_Package_Instantiation,
- N_Formal_Package_Declaration)
+ if Nkind (Inst_Node) in
+ N_Package_Instantiation | N_Formal_Package_Declaration
and then Nkind (Name (Inst_Node)) = N_Expanded_Name
then
Inst_Par := Entity (Prefix (Name (Inst_Node)));
@@ -2640,7 +2640,7 @@ package body Sem_Ch7 is
-- implicit completion at some point.
elsif (Is_Overloadable (Id)
- and then not Ekind_In (Id, E_Enumeration_Literal, E_Operator)
+ and then Ekind (Id) not in E_Enumeration_Literal | E_Operator
and then not Is_Abstract_Subprogram (Id)
and then not Has_Completion (Id)
and then Comes_From_Source (Parent (Id)))
@@ -2657,7 +2657,7 @@ package body Sem_Ch7 is
and then not Is_Generic_Type (Id))
or else
- (Ekind_In (Id, E_Task_Type, E_Protected_Type)
+ (Ekind (Id) in E_Task_Type | E_Protected_Type
and then not Has_Completion (Id))
or else
@@ -2959,7 +2959,7 @@ package body Sem_Ch7 is
Check_Conventions (Id);
end if;
- if Ekind_In (Id, E_Private_Type, E_Limited_Private_Type)
+ if Ekind (Id) in E_Private_Type | E_Limited_Private_Type
and then No (Full_View (Id))
and then not Is_Generic_Type (Id)
and then not Is_Derived_Type (Id)