diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-02-25 16:18:38 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-02-25 16:18:38 +0100 |
commit | 4c51ff88f2748e7f59d69d2b99c6749f4ec308c7 (patch) | |
tree | a81062ae0baf3aa2bb0c6da8826d7061c88ae465 /gcc/ada/sem_intr.adb | |
parent | 0355e3ebbe09450408118b4651a9545da577eeee (diff) | |
download | gcc-4c51ff88f2748e7f59d69d2b99c6749f4ec308c7.zip gcc-4c51ff88f2748e7f59d69d2b99c6749f4ec308c7.tar.gz gcc-4c51ff88f2748e7f59d69d2b99c6749f4ec308c7.tar.bz2 |
[multiple changes]
2014-02-25 Robert Dewar <dewar@adacore.com>
* einfo.ads, einfo.adb (Has_Shift_Operator): New flag.
* gnat_rm.texi: Document pragma Provide_Shift_Operators.
* interfac.ads: Minor code reorganization (add pragma
Compiler_Unit_Warning).
* par-prag.adb: Add dummy entry for Provide_Shift_Operators.
* sem_ch3.adb (Build_Derived_Numeric_Type): Copy
Has_Shift_Operator flag.
* sem_intr.adb (Check_Intrinsic_Subprogram): Make sure
Check_Shift is always called (Check_Shift): Set Has_Shift_Operator.
* sem_prag.adb: Implement pragma Provide_Shift_Operators.
* snames.ads-tmpl: Add entries for pragma Provide_Shift_Operators
Add entry for Name_Amount.
* checks.adb (Selected_Range_Checks): When checking for a null
range, make sure we use the base type, and not the subtype for
deciding a range is null.
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Check
for suspicious loop bound which is outside the range of the
loop subtype.
* gnat_ugn.texi: Add documentation section "Determining the
Chosen Elaboration Order"
* sem_ch13.adb (UC_Entry): Add field Act_Unit
(Validate_Unchecked_Conversion): Store Act_Unit
(Validate_Unchecked_Conversions): Test Warnings_Off in Act_Unit
* treepr.adb: Minor reformatting.
2014-02-25 Arnaud Charlet <charlet@adacore.com>
* usage.adb: Minor: fix typo.
From-SVN: r208138
Diffstat (limited to 'gcc/ada/sem_intr.adb')
-rw-r--r-- | gcc/ada/sem_intr.adb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb index 4682d25..5fb7442 100644 --- a/gcc/ada/sem_intr.adb +++ b/gcc/ada/sem_intr.adb @@ -328,6 +328,14 @@ package body Sem_Intr is then Errint ("unrecognized intrinsic subprogram", E, N); + -- 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) + then + Check_Shift (E, N); + -- We always allow intrinsic specifications in language defined units -- and in expanded code. We assume that the GNAT implementors know what -- they are doing, and do not write or generate junk use of intrinsic. @@ -339,13 +347,7 @@ package body Sem_Intr is then null; - -- 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) - then - Check_Shift (E, N); + -- Exception functions elsif Nam_In (Nam, Name_Exception_Information, Name_Exception_Message, @@ -353,9 +355,13 @@ package body Sem_Intr is then Check_Exception_Function (E, N); + -- Intrinsic operators + elsif Nkind (E) = N_Defining_Operator_Symbol then Check_Intrinsic_Operator (E, N); + -- Source_Location and navigation functions + elsif Nam_In (Nam, Name_File, Name_Line, Name_Source_Location, Name_Enclosing_Entity) then @@ -439,6 +445,8 @@ package body Sem_Intr is ("first argument of shift must match return type", Ptyp1, N); return; end if; + + Set_Has_Shift_Operator (Base_Type (Typ1)); end Check_Shift; ------------ |