aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_intr.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_intr.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_intr.adb')
-rw-r--r--gcc/ada/sem_intr.adb45
1 files changed, 23 insertions, 22 deletions
diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb
index fcb9ce3..15bb146 100644
--- a/gcc/ada/sem_intr.adb
+++ b/gcc/ada/sem_intr.adb
@@ -76,7 +76,7 @@ package body Sem_Intr is
procedure Check_Exception_Function (E : Entity_Id; N : Node_Id) is
begin
- if not Ekind_In (E, E_Function, E_Generic_Function) then
+ if Ekind (E) not in E_Function | E_Generic_Function then
Errint
("intrinsic exception subprogram must be a function", E, N);
@@ -129,9 +129,9 @@ package body Sem_Intr is
-- literal is legal even in Ada 83 mode, where such literals are
-- not static.
- if Nam_In (Cnam, Name_Import_Address,
- Name_Import_Largest_Value,
- Name_Import_Value)
+ if Cnam in Name_Import_Address
+ | Name_Import_Largest_Value
+ | Name_Import_Value
then
if Etype (Arg1) = Any_Type
or else Raises_Constraint_Error (Arg1)
@@ -190,13 +190,14 @@ package body Sem_Intr is
begin
-- Arithmetic operators
- if Nam_In (Nam, Name_Op_Add, Name_Op_Subtract, Name_Op_Multiply,
- Name_Op_Divide, Name_Op_Rem, Name_Op_Mod, Name_Op_Abs)
+ if Nam in Name_Op_Add | Name_Op_Subtract | Name_Op_Multiply |
+ Name_Op_Divide | Name_Op_Rem | Name_Op_Mod |
+ Name_Op_Abs
then
T1 := Etype (First_Formal (E));
if No (Next_Formal (First_Formal (E))) then
- if Nam_In (Nam, Name_Op_Add, Name_Op_Subtract, Name_Op_Abs) then
+ if Nam in Name_Op_Add | Name_Op_Subtract | Name_Op_Abs then
T2 := T1;
-- Previous error in declaration
@@ -231,8 +232,8 @@ package body Sem_Intr is
-- Comparison operators
- elsif Nam_In (Nam, Name_Op_Eq, Name_Op_Ge, Name_Op_Gt, Name_Op_Le,
- Name_Op_Lt, Name_Op_Ne)
+ elsif Nam in Name_Op_Eq | Name_Op_Ge | Name_Op_Gt | Name_Op_Le |
+ Name_Op_Lt | Name_Op_Ne
then
T1 := Etype (First_Formal (E));
@@ -327,8 +328,8 @@ package body Sem_Intr is
-- Shift cases. We allow user specification of intrinsic shift operators
-- for any numeric types.
- elsif Nam_In (Nam, Name_Rotate_Left, Name_Rotate_Right, Name_Shift_Left,
- Name_Shift_Right, Name_Shift_Right_Arithmetic)
+ elsif Nam in Name_Rotate_Left | Name_Rotate_Right | Name_Shift_Left |
+ Name_Shift_Right | Name_Shift_Right_Arithmetic
then
Check_Shift (E, N);
@@ -344,9 +345,9 @@ package body Sem_Intr is
-- Exception functions
- elsif Nam_In (Nam, Name_Exception_Information,
- Name_Exception_Message,
- Name_Exception_Name)
+ elsif Nam in Name_Exception_Information
+ | Name_Exception_Message
+ | Name_Exception_Name
then
Check_Exception_Function (E, N);
@@ -357,13 +358,13 @@ package body Sem_Intr is
-- Source_Location and navigation functions
- elsif Nam_In (Nam, Name_File,
- Name_Line,
- Name_Source_Location,
- Name_Enclosing_Entity,
- Name_Compilation_ISO_Date,
- Name_Compilation_Date,
- Name_Compilation_Time)
+ elsif Nam in Name_File
+ | Name_Line
+ | Name_Source_Location
+ | Name_Enclosing_Entity
+ | Name_Compilation_ISO_Date
+ | Name_Compilation_Date
+ | Name_Compilation_Time
then
null;
@@ -388,7 +389,7 @@ package body Sem_Intr is
Ptyp2 : Node_Id;
begin
- if not Ekind_In (E, E_Function, E_Generic_Function) then
+ if Ekind (E) not in E_Function | E_Generic_Function then
Errint ("intrinsic shift subprogram must be a function", E, N);
return;
end if;