Commit 11b4899f by Javier Miranda Committed by Arnaud Charlet

checks.ads, checks.adb (Apply_Address_Clause_Check): Handle case in which the…

checks.ads, checks.adb (Apply_Address_Clause_Check): Handle case in which the address-clause is applied to in-mode actuals (allowed...

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.

From-SVN: r125388
parent 47eb2d8d
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment