aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_intr.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-04-12 15:41:03 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-04-12 15:41:03 +0200
commitb69cd36a46e574d92de18e1ede3d31e951ccf30e (patch)
tree983081c2f329d06316f9687cf9737e4c99522cc8 /gcc/ada/sem_intr.adb
parent7893514cf6a62a34a48f61ddd4b03bdd47b1b4be (diff)
downloadgcc-b69cd36a46e574d92de18e1ede3d31e951ccf30e.zip
gcc-b69cd36a46e574d92de18e1ede3d31e951ccf30e.tar.gz
gcc-b69cd36a46e574d92de18e1ede3d31e951ccf30e.tar.bz2
[multiple changes]
2013-04-12 Robert Dewar <dewar@adacore.com> * namet.adb, namet.ads: Minor addition (7 arg version of Nam_In). * exp_prag.adb, sem_ch3.adb, sem_intr.adb, sem_type.adb, exp_util.adb, sem_aux.adb, exp_ch9.adb, sem_ch7.adb, sem_ch10.adb, sem_prag.adb, par-ch2.adb, tbuild.adb, rtsfind.adb, freeze.adb, sem_util.adb, sem_res.adb, sem_attr.adb, exp_ch2.adb, prj-makr.adb, sem_elab.adb, exp_ch4.adb, sem_ch4.adb, sem_mech.adb, sem_ch6.adb, par-prag.adb, prj-nmsc.adb, exp_disp.adb, sem_ch8.adb, sem_warn.adb, par-util.adb, sem_eval.adb, exp_intr.adb, sem_ch13.adb, exp_cg.adb, lib-xref.adb, sem_disp.adb, exp_ch3.adb: Minor code reorganization (use Nam_In). 2013-04-12 Doug Rupp <rupp@adacore.com> * init.c: Don't clobber condition code on VMS. From-SVN: r197917
Diffstat (limited to 'gcc/ada/sem_intr.adb')
-rw-r--r--gcc/ada/sem_intr.adb73
1 files changed, 16 insertions, 57 deletions
diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb
index fe3855d..ed607ce 100644
--- a/gcc/ada/sem_intr.adb
+++ b/gcc/ada/sem_intr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -127,11 +127,9 @@ package body Sem_Intr is
-- literal is legal even in Ada 83 mode, where such literals are
-- not static.
- if Cnam = Name_Import_Address
- or else
- Cnam = Name_Import_Largest_Value
- or else
- Cnam = Name_Import_Value
+ if Nam_In (Cnam, Name_Import_Address,
+ Name_Import_Largest_Value,
+ Name_Import_Value)
then
if Etype (Arg1) = Any_Type
or else Raises_Constraint_Error (Arg1)
@@ -196,30 +194,13 @@ package body Sem_Intr is
begin
-- Arithmetic operators
- if Nam = Name_Op_Add
- or else
- Nam = Name_Op_Subtract
- or else
- Nam = Name_Op_Multiply
- or else
- Nam = Name_Op_Divide
- or else
- Nam = Name_Op_Rem
- or else
- Nam = Name_Op_Mod
- or else
- Nam = Name_Op_Abs
+ 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)
then
T1 := Etype (First_Formal (E));
if No (Next_Formal (First_Formal (E))) then
-
- if Nam = Name_Op_Add
- or else
- Nam = Name_Op_Subtract
- or else
- Nam = Name_Op_Abs
- then
+ if Nam_In (Nam, Name_Op_Add, Name_Op_Subtract, Name_Op_Abs) then
T2 := T1;
-- Previous error in declaration
@@ -254,17 +235,8 @@ package body Sem_Intr is
-- Comparison operators
- elsif Nam = Name_Op_Eq
- or else
- Nam = Name_Op_Ge
- or else
- Nam = Name_Op_Gt
- or else
- Nam = Name_Op_Le
- or else
- Nam = Name_Op_Lt
- or else
- Nam = Name_Op_Ne
+ elsif Nam_In (Nam, Name_Op_Eq, Name_Op_Ge, Name_Op_Gt, Name_Op_Le,
+ Name_Op_Lt, Name_Op_Ne)
then
T1 := Etype (First_Formal (E));
@@ -370,35 +342,22 @@ package body Sem_Intr is
-- Shift cases. We allow user specification of intrinsic shift
-- operators for any numeric types.
- elsif
- Nam = Name_Rotate_Left
- or else
- Nam = Name_Rotate_Right
- or else
- Nam = Name_Shift_Left
- or else
- Nam = Name_Shift_Right
- or else
- Nam = Name_Shift_Right_Arithmetic
+ elsif Nam_In (Nam, Name_Rotate_Left, Name_Rotate_Right, Name_Shift_Left,
+ Name_Shift_Right, Name_Shift_Right_Arithmetic)
then
Check_Shift (E, N);
- elsif
- Nam = Name_Exception_Information
- or else
- Nam = Name_Exception_Message
- or else
- Nam = Name_Exception_Name
+ elsif Nam_In (Nam, Name_Exception_Information,
+ Name_Exception_Message,
+ Name_Exception_Name)
then
Check_Exception_Function (E, N);
elsif Nkind (E) = N_Defining_Operator_Symbol then
Check_Intrinsic_Operator (E, N);
- elsif Nam = Name_File
- or else Nam = Name_Line
- or else Nam = Name_Source_Location
- or else Nam = Name_Enclosing_Entity
+ elsif Nam_In (Nam, Name_File, Name_Line, Name_Source_Location,
+ Name_Enclosing_Entity)
then
null;