Commit 36a66365 by Arnaud Charlet

[multiple changes]

2014-07-29  Hristian Kirtchev  <kirtchev@adacore.com>

	* a-cbmutr.adb (Allocate_Node): Remove the two parameter version.
	(Insert_Child): Add local variable First. Capture the index of the
	first node being created to ensure correct cursor construction
	later on. Use the three parameter version of Allocate_Node
	when creating multiple children as this method allows aspect
	Default_Value to take effect (if applicable).

2014-07-29  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_aggr.adb (Safe_Slice_Assignment): Remove.
	(Expand_Array_Aggregate): For a safe slice assignment, just set
	the target and use the common code path.

From-SVN: r213216
parent e1ea35da
2014-07-29 Hristian Kirtchev <kirtchev@adacore.com>
* a-cbmutr.adb (Allocate_Node): Remove the two parameter version.
(Insert_Child): Add local variable First. Capture the index of the
first node being created to ensure correct cursor construction
later on. Use the three parameter version of Allocate_Node
when creating multiple children as this method allows aspect
Default_Value to take effect (if applicable).
2014-07-29 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Safe_Slice_Assignment): Remove.
(Expand_Array_Aggregate): For a safe slice assignment, just set
the target and use the common code path.
2014-07-29 Robert Dewar <dewar@adacore.com> 2014-07-29 Robert Dewar <dewar@adacore.com>
* sem_util.adb, sem_util.ads, sem_res.adb, exp_ch6.adb: Invert * sem_util.adb, sem_util.ads, sem_res.adb, exp_ch6.adb: Invert
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2011-2013, Free Software Foundation, Inc. -- -- Copyright (C) 2011-2014, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -96,10 +96,6 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -96,10 +96,6 @@ package body Ada.Containers.Bounded_Multiway_Trees is
procedure Allocate_Node procedure Allocate_Node
(Container : in out Tree; (Container : in out Tree;
New_Node : out Count_Type);
procedure Allocate_Node
(Container : in out Tree;
Stream : not null access Root_Stream_Type'Class; Stream : not null access Root_Stream_Type'Class;
New_Node : out Count_Type); New_Node : out Count_Type);
...@@ -318,15 +314,6 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -318,15 +314,6 @@ package body Ada.Containers.Bounded_Multiway_Trees is
Allocate_Node (Container, Initialize_Element'Access, New_Node); Allocate_Node (Container, Initialize_Element'Access, New_Node);
end Allocate_Node; end Allocate_Node;
procedure Allocate_Node
(Container : in out Tree;
New_Node : out Count_Type)
is
procedure Initialize_Element (Index : Count_Type) is null;
begin
Allocate_Node (Container, Initialize_Element'Access, New_Node);
end Allocate_Node;
------------------- -------------------
-- Ancestor_Find -- -- Ancestor_Find --
------------------- -------------------
...@@ -1583,6 +1570,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -1583,6 +1570,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
Count : Count_Type := 1) Count : Count_Type := 1)
is is
Nodes : Tree_Node_Array renames Container.Nodes; Nodes : Tree_Node_Array renames Container.Nodes;
First : Count_Type;
Last : Count_Type; Last : Count_Type;
New_Item : Element_Type; New_Item : Element_Type;
...@@ -1634,11 +1622,12 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -1634,11 +1622,12 @@ package body Ada.Containers.Bounded_Multiway_Trees is
-- initialized elements at the given position. -- initialized elements at the given position.
Allocate_Node (Container, New_Item, Position.Node); Allocate_Node (Container, New_Item, Position.Node);
First := Position.Node;
Nodes (Position.Node).Parent := Parent.Node; Nodes (Position.Node).Parent := Parent.Node;
Last := Position.Node; Last := Position.Node;
for J in Count_Type'(2) .. Count loop for J in Count_Type'(2) .. Count loop
Allocate_Node (Container, Nodes (Last).Next); Allocate_Node (Container, New_Item, Nodes (Last).Next);
Nodes (Nodes (Last).Next).Parent := Parent.Node; Nodes (Nodes (Last).Next).Parent := Parent.Node;
Nodes (Nodes (Last).Next).Prev := Last; Nodes (Nodes (Last).Next).Prev := Last;
...@@ -1654,7 +1643,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -1654,7 +1643,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
Container.Count := Container.Count + Count; Container.Count := Container.Count + Count;
Position.Container := Parent.Container; Position := Cursor'(Parent.Container, First);
end Insert_Child; end Insert_Child;
------------------------- -------------------------
......
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