diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-08-04 11:38:17 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-08-04 11:38:17 +0200 |
commit | d26d790dca2c2135161666dc955cc39befbaf587 (patch) | |
tree | f3d0f0f15149eab824acc982a9afeee6d907057d /gcc/ada/sem_ch13.adb | |
parent | d478ac59ee07d9d70a11083c662f78d5a48de5f9 (diff) | |
download | gcc-d26d790dca2c2135161666dc955cc39befbaf587.zip gcc-d26d790dca2c2135161666dc955cc39befbaf587.tar.gz gcc-d26d790dca2c2135161666dc955cc39befbaf587.tar.bz2 |
[multiple changes]
2014-08-04 Robert Dewar <dewar@adacore.com>
* checks.adb (Activate_Overflow_Check): Remove
Check_Float_Overflow processing.
(Apply_Scalar_Range_Check): Ditto.
(Generate_Range_Check): Ditto.
* exp_ch4.adb (Expand_N_Op_Add): Add call to
Check_Float_Op_Overflow.
(Expand_N_Op_Divide): ditto.
(Expand_N_Op_Multiply): ditto.
(Expand_N_Op_Subtract): ditto.
* exp_util.ads, exp_util.adb (Check_Float_Op_Overflow): New procedure.
* sem_attr.adb (Analyze_Attribute, case Pred): Make sure
Do_Range_Check is set for floating-point case in -gnatc or
GNATprove mode.
(Analyze_Attribute, case Succ): Make sure
Do_Range_Check is set for floating-point case in -gnatc or
GNATprove mode.
* sem_res.adb (Resolve_Type_Conversion): Make sure Do_Range_Check
flag is set for real to integer conversion in GNATprove or
-gnatc mode.
2014-08-04 Gary Dismukes <dismukes@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications): Resolve
the expression of an Import or Export aspect as type Boolean
and require it to be static. Add ??? comment. Also, set the
Is_Exported flag when appropriate.
From-SVN: r213545
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r-- | gcc/ada/sem_ch13.adb | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 15bb5b3..3ef5836 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -2949,18 +2949,34 @@ package body Sem_Ch13 is -- that verifed that there was a matching convention -- is now obsolete. - if A_Id = Aspect_Import then - Set_Is_Imported (E); + -- Resolve the expression of an Import or Export here, + -- and require it to be of type Boolean and static. This + -- is not quite right, because in general this should be + -- delayed, but that seems tricky for these, because + -- normally Boolean aspects are replaced with pragmas at + -- the freeze point (in Make_Pragma_From_Boolean_Aspect), + -- but in the case of these aspects we can't generate + -- a simple pragma with just the entity name. ??? + + if not Present (Expr) + or else Is_True (Static_Boolean (Expr)) + then + if A_Id = Aspect_Import then + Set_Is_Imported (E); - -- An imported entity cannot have an explicit - -- initialization. + -- An imported entity cannot have an explicit + -- initialization. - if Nkind (N) = N_Object_Declaration - and then Present (Expression (N)) - then - Error_Msg_N - ("imported entities cannot be initialized " - & "(RM B.1(24))", Expression (N)); + if Nkind (N) = N_Object_Declaration + and then Present (Expression (N)) + then + Error_Msg_N + ("imported entities cannot be initialized " + & "(RM B.1(24))", Expression (N)); + end if; + + elsif A_Id = Aspect_Export then + Set_Is_Exported (E); end if; end if; |