From 4a08c95cf0604a96e6fc48102365ef0d498f11ae Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Sat, 13 Jun 2020 11:33:04 -0400 Subject: [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. --- gcc/ada/sem_disp.adb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'gcc/ada/sem_disp.adb') diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index 6e74098..67a8cdf 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -293,7 +293,7 @@ package body Sem_Disp is Next_Formal (Formal); end loop; - if Ekind_In (Subp, E_Function, E_Generic_Function) then + if Ekind (Subp) in E_Function | E_Generic_Function then Ctrl_Type := Check_Controlling_Type (Etype (Subp), Subp); if Present (Ctrl_Type) then @@ -621,7 +621,7 @@ package body Sem_Disp is Par := Parent (Par); end if; - if Nkind_In (Par, N_Function_Call, N_Procedure_Call_Statement) + if Nkind (Par) in N_Function_Call | N_Procedure_Call_Statement and then Is_Entity_Name (Name (Par)) then declare @@ -684,7 +684,7 @@ package body Sem_Disp is -- For equality operators, one of the operands must be -- statically or dynamically tagged. - elsif Nkind_In (Par, N_Op_Eq, N_Op_Ne) then + elsif Nkind (Par) in N_Op_Eq | N_Op_Ne then if N = Right_Opnd (Par) and then Is_Tag_Indeterminate (Left_Opnd (Par)) then @@ -993,7 +993,7 @@ package body Sem_Disp is -- Start of processing for Check_Dispatching_Operation begin - if not Ekind_In (Subp, E_Function, E_Procedure) then + if Ekind (Subp) not in E_Function | E_Procedure then return; -- The Default_Initial_Condition procedure is not a primitive subprogram @@ -1409,7 +1409,7 @@ package body Sem_Disp is -- visible operation that may be declared in a partial view when -- the full view is controlled. - if Nam_In (Chars (Subp), Name_Initialize, Name_Adjust, Name_Finalize) + if Chars (Subp) in Name_Initialize | Name_Adjust | Name_Finalize and then Is_Controlled (Tagged_Type) and then not Is_Visibly_Controlled (Tagged_Type) and then not Is_Inherited_Public_Operation (Ovr_Subp) @@ -1569,10 +1569,10 @@ package body Sem_Disp is Set_DT_Position_Value (Subp, No_Uint); elsif Has_Controlled_Component (Tagged_Type) - and then Nam_In (Chars (Subp), Name_Initialize, - Name_Adjust, - Name_Finalize, - Name_Finalize_Address) + and then Chars (Subp) in Name_Initialize + | Name_Adjust + | Name_Finalize + | Name_Finalize_Address then declare F_Node : constant Node_Id := Freeze_Node (Tagged_Type); @@ -2010,7 +2010,7 @@ package body Sem_Disp is Ctrl_Type : Entity_Id; begin - if Ekind_In (Subp, E_Function, E_Procedure) + if Ekind (Subp) in E_Function | E_Procedure and then Present (DTC_Entity (Subp)) then return Scope (DTC_Entity (Subp)); -- cgit v1.1