[multiple changes]

2014-01-27  Robert Dewar  <dewar@adacore.com>

	* exp_smem.adb: Minor reformatting.

2014-01-27  Thomas Quinot  <quinot@adacore.com>

	* a-calfor.ads: Fix incorrect reference to operator "-" in comment.

2014-01-27  Ed Schonberg  <schonberg@adacore.com>

	* sem_res.adb (Make_Call_Into_Operator): In ASIS mode, relocate
	nodes for operands to the original node for the call, to preserve
	Original_Node pointers within the resolved operands, given that
	they may have been rewritten as well. Previous approach copied
	the operands into a new tree and lost those pointers.

2014-01-27  Claire Dross  <dross@adacore.com>


	* a-cofove.adb, a-cofove.ads: Add Strict_Equal function to the API.

2014-01-27  Ed Schonberg  <schonberg@adacore.com>

	* sem_util.adb (Check_Internal_Protected_Use): A call through
	an anonymous access parameter of the current protected function
	is not a potential modification of the current object.

2014-01-27  Ed Schonberg  <schonberg@adacore.com>

	* a-cobove.adb (Reserve_Capacity): Procedure raises
	Capacity_Error, not Constraint_Error, when request cannot be
	satisfied.

2014-01-27  Vincent Celier  <celier@adacore.com>

	* a-coorma.adb, a-cohama.adb (Assign): Copy the Source to the Target,
	not the Target to itself.

2014-01-27  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch4.adb (Expand_Concatenate): If the target of the
	concatenation is a library-level entity, always use the off-line
	version of concatenation, regardless of optimization level. This
	is space-efficient, and prevents linking problems when some
	units are compiled with different optimization levels.

2014-01-27  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch5.adb: Code clean up.

2014-01-27  Ed Schonberg  <schonberg@adacore.com>

	* par-ch5.adb (P_Iterator_Specification): Improve error recovery
	when an array or container iterator includes a subtype indication,
	which is only legal in an element iterator.

From-SVN: r207141
This commit is contained in:
Arnaud Charlet 2014-01-27 17:43:29 +01:00
parent 8fdafe44be
commit 00ba7be813
13 changed files with 130 additions and 15 deletions

View File

@ -1,3 +1,59 @@
2014-01-27 Robert Dewar <dewar@adacore.com>
* exp_smem.adb: Minor reformatting.
2014-01-27 Thomas Quinot <quinot@adacore.com>
* a-calfor.ads: Fix incorrect reference to operator "-" in comment.
2014-01-27 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Make_Call_Into_Operator): In ASIS mode, relocate
nodes for operands to the original node for the call, to preserve
Original_Node pointers within the resolved operands, given that
they may have been rewritten as well. Previous approach copied
the operands into a new tree and lost those pointers.
2014-01-27 Claire Dross <dross@adacore.com>
* a-cofove.adb, a-cofove.ads: Add Strict_Equal function to the API.
2014-01-27 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Check_Internal_Protected_Use): A call through
an anonymous access parameter of the current protected function
is not a potential modification of the current object.
2014-01-27 Ed Schonberg <schonberg@adacore.com>
* a-cobove.adb (Reserve_Capacity): Procedure raises
Capacity_Error, not Constraint_Error, when request cannot be
satisfied.
2014-01-27 Vincent Celier <celier@adacore.com>
* a-coorma.adb, a-cohama.adb (Assign): Copy the Source to the Target,
not the Target to itself.
2014-01-27 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Expand_Concatenate): If the target of the
concatenation is a library-level entity, always use the off-line
version of concatenation, regardless of optimization level. This
is space-efficient, and prevents linking problems when some
units are compiled with different optimization levels.
2014-01-27 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb: Code clean up.
2014-01-27 Ed Schonberg <schonberg@adacore.com>
* par-ch5.adb (P_Iterator_Specification): Improve error recovery
when an array or container iterator includes a subtype indication,
which is only legal in an element iterator.
2014-01-27 Thomas Quinot <quinot@adacore.com>
* exp_ch7.adb: Minor reformatting.

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2005-2008, Free Software Foundation, Inc. --
-- Copyright (C) 2005-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
@ -70,7 +70,7 @@ package Ada.Calendar.Formatting is
Sub_Second : Second_Duration := 0.0) return Day_Duration;
-- Returns a Day_Duration value for the combination of the given Hour,
-- Minute, Second, and Sub_Second. This value can be used in Ada.Calendar.
-- Time_Of as well as the argument to Calendar."+" and Calendar."". If
-- Time_Of as well as the argument to Calendar."+" and Calendar."-". If
-- Seconds_Of is called with a Sub_Second value of 1.0, the value returned
-- is equal to the value of Seconds_Of for the next second with a Sub_
-- Second value of 0.0.

View File

@ -2390,7 +2390,7 @@ package body Ada.Containers.Bounded_Vectors is
is
begin
if Capacity > Container.Capacity then
raise Constraint_Error with "Capacity is out of range";
raise Capacity_Error with "Capacity is out of range";
end if;
end Reserve_Capacity;

View File

@ -1506,6 +1506,19 @@ package body Ada.Containers.Formal_Vectors is
end;
end Set_Length;
------------------
-- Strict_Equal --
------------------
function Strict_Equal (Left, Right : Vector) return Boolean is
begin
-- On bounded vectors, cursors are indexes. As a consequence, two
-- vectors always have the same cursor at the same position and
-- Strict_Equal is simply =
return Left = Right;
end Strict_Equal;
----------
-- Swap --
----------

View File

@ -45,8 +45,9 @@
-- which is not possible if cursors encapsulate an access to the underlying
-- container.
-- There are two new functions:
-- There are three new functions:
-- function Strict_Equal (Left, Right : Vector) return Boolean;
-- function Left (Container : Vector; Position : Cursor) return Vector;
-- function Right (Container : Vector; Position : Cursor) return Vector;
@ -349,6 +350,11 @@ package Ada.Containers.Formal_Vectors is
end Generic_Sorting;
function Strict_Equal (Left, Right : Vector) return Boolean;
-- Strict_Equal returns True if the containers are physically equal, i.e.
-- they are structurally equal (function "=" returns True) and that they
-- have the same set of cursors.
function Left (Container : Vector; Position : Cursor) return Vector with
Pre => Has_Element (Container, Position) or else Position = No_Element;
function Right (Container : Vector; Position : Cursor) return Vector with

View File

@ -167,7 +167,7 @@ package body Ada.Containers.Hashed_Maps is
Target.Reserve_Capacity (Source.Length);
end if;
Insert_Items (Target.HT);
Insert_Items (Source.HT);
end Assign;
--------------

View File

@ -274,7 +274,7 @@ package body Ada.Containers.Ordered_Maps is
end if;
Target.Clear;
Insert_Items (Target.Tree);
Insert_Items (Source.Tree);
end Assign;
-------------

View File

@ -3043,6 +3043,16 @@ package body Exp_Ch4 is
-- Local Declarations
Lib_Level_Target : constant Boolean :=
Nkind (Parent (Cnode)) = N_Object_Declaration
and then
Is_Library_Level_Entity (Defining_Identifier (Parent (Cnode)));
-- If the concatenation declares a library level entity, we call the
-- built-in concatenation routines to prevent code bloat, regardless
-- of optimization level. This is space-efficient, and prevent linking
-- problems when units are compiled with different optimizations.
Opnd_Typ : Entity_Id;
Ent : Entity_Id;
Len : Uint;
@ -3571,8 +3581,10 @@ package body Exp_Ch4 is
if Atyp = Standard_String
and then NN in 2 .. 9
and then (Opt.Optimization_Level = 0 or else Debug_Flag_Dot_CC)
and then not Debug_Flag_Dot_C
and then (Lib_Level_Target
or else
((Opt.Optimization_Level = 0 or else Debug_Flag_Dot_CC)
and then not Debug_Flag_Dot_C))
then
declare
RR : constant array (Nat range 2 .. 9) of RE_Id :=

View File

@ -195,7 +195,7 @@ package body Exp_Smem is
procedure Add_Write_After (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Ent : constant Entity_Id := Entity (N);
Par : constant Node_Id := Insert_Node;
Par : constant Node_Id := Insert_Node;
begin
if Present (Shared_Var_Procs_Instance (Ent)) then
if Nkind (Insert_Node) = N_Function_Call then

View File

@ -1736,6 +1736,19 @@ package body Ch5 is
elsif Token = Tok_In then
Scan; -- past IN
elsif Prev_Token = Tok_In
and then Present (Subtype_Indication (Node1))
then
-- Simplest recovery is to transform it into an element iterator.
-- Error message on 'in" has already been emitted when parsing the
-- optional constraint.
Set_Of_Present (Node1);
Error_Msg_N
("subtype indication is only legal on on element iterator",
Subtype_Indication (Node1));
else
return Error;
end if;

View File

@ -1814,7 +1814,7 @@ package body Sem_Ch5 is
Set_Etype (Def_Id, Component_Type (Typ));
if Present (Subt)
and then Bas /= Base_Type (Component_Type (Typ))
and then Base_Type (Bas) /= Base_Type (Component_Type (Typ))
then
Error_Msg_N
("subtype indication does not match component type", Subt);

View File

@ -1585,17 +1585,20 @@ package body Sem_Res is
-- If in ASIS_Mode, propagate operand types to original actuals of
-- function call, which would otherwise not be fully resolved. If
-- the call has already been constant-folded, nothing to do.
-- the call has already been constant-folded, nothing to do. We
-- relocate the operand nodes rather than copy them, to preserve
-- original_node pointers, given that the operands themselves may
-- have been rewritten.
if ASIS_Mode and then Nkind (N) in N_Op then
if Is_Binary then
Rewrite (First (Parameter_Associations (Original_Node (N))),
New_Copy_Tree (Left_Opnd (N)));
Relocate_Node (Left_Opnd (N)));
Rewrite (Next (First (Parameter_Associations (Original_Node (N)))),
New_Copy_Tree (Right_Opnd (N)));
Relocate_Node (Right_Opnd (N)));
else
Rewrite (First (Parameter_Associations (Original_Node (N))),
New_Copy_Tree (Right_Opnd (N)));
Relocate_Node (Right_Opnd (N)));
end if;
Set_Parent (Original_Node (N), Parent (N));

View File

@ -2240,7 +2240,19 @@ package body Sem_Util is
end loop;
if Scope (Nam) = Prot and then Ekind (Nam) /= E_Function then
if Nkind (N) = N_Subprogram_Renaming_Declaration then
-- An indirect function call (e.g. a callback within a protected
-- function body) is not statically illegal. If the access type is
-- anonymous and is the type of an access parameter, the scope of Nam
-- will be the protected type, but it is not a protected operation.
if Ekind (Nam) = E_Subprogram_Type
and then
Nkind (Associated_Node_For_Itype (Nam)) = N_Function_Specification
then
null;
elsif Nkind (N) = N_Subprogram_Renaming_Declaration then
Error_Msg_N
("within protected function cannot use protected "
& "procedure in renaming or as generic actual", N);