diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-06 10:22:41 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-06 10:22:41 +0000 |
commit | 00c403eea3414bfb665362a9316fb70b211996ad (patch) | |
tree | 7bee10dc496684afc4a3a6997b07500098601600 /gcc/ada/checks.ads | |
parent | 44e1eb01ce81c67b701e2f14cd7b4ef9fe5b4e00 (diff) | |
download | gcc-00c403eea3414bfb665362a9316fb70b211996ad.tar.gz |
2007-04-20 Javier Miranda <miranda@adacore.com>
Robert Dewar <dewar@adacore.com>
Ed Schonberg <schonberg@adacore.com>
* checks.ads, checks.adb (Apply_Address_Clause_Check): Handle case in
which the address-clause is applied to in-mode actuals (allowed by
13.1(22)).
(Apply_Discriminant_Check): Do not generate a check if the type is
constrained by a current instance.
(Activate_Division_Check): New procedure
(Activate_Overflow_Check): New procedure
(Activate_Range_Check): New procedure
Call these new Activate procedures instead of setting flags directly
(Apply_Array_Size_Check): Removed, no longer needed.
Code clean up: remove obsolete code related to GCC 2.
(Get_E_Length): Protect against bomb in case scope is standard
(Selected_Range_Checks): If the node to be checked is a conversion to
an unconstrained array type, and the expression is a slice, use the
bounds of the slice to construct the required constraint checks.
Improve NOT NULL error messages
(Apply_Constraint_Check): If the context is a null-excluding access
type, diagnose properly the literal null.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125388 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/checks.ads')
-rw-r--r-- | gcc/ada/checks.ads | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/gcc/ada/checks.ads b/gcc/ada/checks.ads index 84012a16a60..d981c3b5e9c 100644 --- a/gcc/ada/checks.ads +++ b/gcc/ada/checks.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2007, 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- -- @@ -65,6 +65,32 @@ package Checks is -- reason we insist on specifying Empty is to force the caller to think -- about whether there is any relevant entity that should be checked. + ------------------------------------------- + -- Procedures to Activate Checking Flags -- + ------------------------------------------- + + procedure Activate_Division_Check (N : Node_Id); + pragma Inline (Activate_Division_Check); + -- Sets Do_Division_Check flag in node N, and handles possible local raise. + -- Always call this routine rather than calling Set_Do_Division_Check to + -- set an explicit value of True, to ensure handling the local raise case. + + procedure Activate_Overflow_Check (N : Node_Id); + pragma Inline (Activate_Overflow_Check); + -- Sets Do_Overflow_Check flag in node N, and handles possible local raise. + -- Always call this routine rather than calling Set_Do_Overflow_Check to + -- set an explicit value of True, to ensure handling the local raise case. + + procedure Activate_Range_Check (N : Node_Id); + pragma Inline (Activate_Range_Check); + -- Sets Do_Range_Check flag in node N, and handles possible local raise + -- Always call this routine rather than calling Set_Do_Range_Check to + -- set an explicit value of True, to ensure handling the local raise case. + + -------------------------------- + -- Procedures to Apply Checks -- + -------------------------------- + -- General note on following checks. These checks are always active if -- Expander_Active and not Inside_A_Generic. They are inactive and have -- no effect Inside_A_Generic. In the case where not Expander_Active @@ -90,11 +116,6 @@ package Checks is -- a clear overlay situation that the size of the overlaying object is not -- larger than the overlaid object. - procedure Apply_Array_Size_Check (N : Node_Id; Typ : Entity_Id); - -- N is the node for an object declaration that declares an object of - -- array type Typ. This routine generates, if necessary, a check that - -- the size of the array is not too large, raising Storage_Error if so. - procedure Apply_Arithmetic_Overflow_Check (N : Node_Id); -- Given a binary arithmetic operator (+ - *) expand a software integer -- overflow check using range checks on a larger checking type or a call |