Commit f672a756 by Arnaud Charlet

[multiple changes]

2011-09-27  Pascal Obry  <obry@adacore.com>

	* s-taspri-posix-noaltstack.ads (RW_Lock): This type is now defined as
	OS_Interface.pthread_rwlock_t.

2011-09-27  Robert Dewar  <dewar@adacore.com>

	* exp_ch9.adb, a-cimutr.adb, a-cimutr.ads, gnat1drv.adb, a-comutr.adb,
	a-comutr.ads, exp_dist.adb, a-cbmutr.adb, a-cbmutr.ads,
	sem_ch5.adb, sem_util.adb: Minor reformatting.

From-SVN: r179252
parent 7a44cb69
2011-09-27 Pascal Obry <obry@adacore.com>
* s-taspri-posix-noaltstack.ads (RW_Lock): This type is now defined as
OS_Interface.pthread_rwlock_t.
2011-09-27 Robert Dewar <dewar@adacore.com>
* exp_ch9.adb, a-cimutr.adb, a-cimutr.ads, gnat1drv.adb, a-comutr.adb,
a-comutr.ads, exp_dist.adb, a-cbmutr.adb, a-cbmutr.ads,
sem_ch5.adb, sem_util.adb: Minor reformatting.
2011-09-27 Pascal Obry <obry@adacore.com>
* s-taprop.ads (Initialize_Lock)[RW_Lock]: New spec for r/w lock.
(Finalize_Lock)[RW_Lock]: Likewise.
(Write_Lock)[RW_Lock]: Likewise.
......
......@@ -1737,19 +1737,14 @@ package body Ada.Containers.Bounded_Multiway_Trees is
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
Root_Cursor : constant Cursor :=
(Container'Unrestricted_Access, Root_Node (Container));
(Container'Unrestricted_Access, Root_Node (Container));
begin
return
Iterator'(Container'Unrestricted_Access,
First_Child (Root_Cursor), From_Root => True);
First_Child (Root_Cursor),
From_Root => True);
end Iterate;
function Iterate_Subtree (Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class is
begin
return Iterator'(Position.Container, Position, From_Root => False);
end Iterate_Subtree;
----------------------
-- Iterate_Children --
----------------------
......@@ -1818,6 +1813,14 @@ package body Ada.Containers.Bounded_Multiway_Trees is
-- Iterate_Subtree --
---------------------
function Iterate_Subtree
(Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
begin
return Iterator'(Position.Container, Position, From_Root => False);
end Iterate_Subtree;
procedure Iterate_Subtree
(Position : Cursor;
Process : not null access procedure (Position : Cursor))
......@@ -1841,7 +1844,6 @@ package body Ada.Containers.Bounded_Multiway_Trees is
if Is_Root (Position) then
Iterate_Children (T, Position.Node, Process);
else
Iterate_Subtree (T, Position.Node, Process);
end if;
......@@ -1938,7 +1940,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
begin
if Is_Leaf (Position) then
-- If sibling is present, return it.
-- If sibling is present, return it
if N.Next /= 0 then
return (Object.Container, N.Next);
......@@ -1955,7 +1957,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
while Par.Next = 0 loop
Pos := Par.Parent;
-- If we are back at the root the iteration is complete.
-- If we are back at the root the iteration is complete
if Pos = No_Node then
return No_Element;
......@@ -1983,10 +1985,9 @@ package body Ada.Containers.Bounded_Multiway_Trees is
end;
end if;
else
-- If an internal node, return its first child.
-- If an internal node, return its first child
else
return (Object.Container, N.Children.First);
end if;
end Next;
......@@ -2351,24 +2352,22 @@ package body Ada.Containers.Bounded_Multiway_Trees is
(Container : aliased Tree;
Position : Cursor) return Constant_Reference_Type
is
begin
pragma Unreferenced (Container);
begin
return
(Element =>
Position.Container.Elements (Position.Node)'Unchecked_Access);
Position.Container.Elements (Position.Node)'Unchecked_Access);
end Constant_Reference;
function Reference
(Container : aliased Tree;
Position : Cursor) return Reference_Type
is
begin
pragma Unreferenced (Container);
begin
return
(Element =>
Position.Container.Elements (Position.Node)'Unchecked_Access);
Position.Container.Elements (Position.Node)'Unchecked_Access);
end Reference;
--------------------
......
......@@ -377,13 +377,11 @@ private
function Constant_Reference
(Container : aliased Tree;
Position : Cursor)
return Constant_Reference_Type;
Position : Cursor) return Constant_Reference_Type;
function Reference
(Container : aliased Tree;
Position : Cursor)
return Reference_Type;
Position : Cursor) return Reference_Type;
Empty_Tree : constant Tree := (Capacity => 0, others => <>);
......
......@@ -1305,19 +1305,14 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
Root_Cursor : constant Cursor :=
(Container'Unrestricted_Access, Root_Node (Container));
(Container'Unrestricted_Access, Root_Node (Container));
begin
return
Iterator'(Container'Unrestricted_Access,
First_Child (Root_Cursor), From_Root => True);
First_Child (Root_Cursor),
From_Root => True);
end Iterate;
function Iterate_Subtree (Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class is
begin
return Iterator'(Position.Container, Position, From_Root => False);
end Iterate_Subtree;
----------------------
-- Iterate_Children --
----------------------
......@@ -1378,6 +1373,14 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
-- Iterate_Subtree --
---------------------
function Iterate_Subtree
(Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
begin
return Iterator'(Position.Container, Position, From_Root => False);
end Iterate_Subtree;
procedure Iterate_Subtree
(Position : Cursor;
Process : not null access procedure (Position : Cursor))
......@@ -1498,7 +1501,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
begin
if Is_Leaf (Position) then
-- If sibling is present, return it.
-- If sibling is present, return it
if N.Next /= null then
return (Object.Container, N.Next);
......@@ -1513,7 +1516,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
begin
while Par.Next = null loop
-- If we are back at the root the iteration is complete.
-- If we are back at the root the iteration is complete
if Par = Root_Node (T) then
return No_Element;
......@@ -1541,10 +1544,9 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
end;
end if;
else
-- If an internal node, return its first child.
-- If an internal node, return its first child
else
return (Object.Container, N.Children.First);
end if;
end Next;
......
......@@ -397,13 +397,11 @@ private
function Constant_Reference
(Container : aliased Tree;
Position : Cursor)
return Constant_Reference_Type;
Position : Cursor) return Constant_Reference_Type;
function Reference
(Container : aliased Tree;
Position : Cursor)
return Reference_Type;
Position : Cursor) return Reference_Type;
Empty_Tree : constant Tree := (Controlled with others => <>);
......
......@@ -1348,19 +1348,14 @@ package body Ada.Containers.Multiway_Trees is
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
Root_Cursor : constant Cursor :=
(Container'Unrestricted_Access, Root_Node (Container));
(Container'Unrestricted_Access, Root_Node (Container));
begin
return
Iterator'(Container'Unrestricted_Access,
First_Child (Root_Cursor), From_Root => True);
First_Child (Root_Cursor),
From_Root => True);
end Iterate;
function Iterate_Subtree (Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class is
begin
return Iterator'(Position.Container, Position, From_Root => False);
end Iterate_Subtree;
----------------------
-- Iterate_Children --
----------------------
......@@ -1421,6 +1416,14 @@ package body Ada.Containers.Multiway_Trees is
-- Iterate_Subtree --
---------------------
function Iterate_Subtree
(Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
begin
return Iterator'(Position.Container, Position, From_Root => False);
end Iterate_Subtree;
procedure Iterate_Subtree
(Position : Cursor;
Process : not null access procedure (Position : Cursor))
......@@ -1438,7 +1441,6 @@ package body Ada.Containers.Multiway_Trees is
if Is_Root (Position) then
Iterate_Children (Position.Container, Position.Node, Process);
else
Iterate_Subtree (Position.Container, Position.Node, Process);
end if;
......
......@@ -442,13 +442,11 @@ private
function Constant_Reference
(Container : aliased Tree;
Position : Cursor)
return Constant_Reference_Type;
Position : Cursor) return Constant_Reference_Type;
function Reference
(Container : aliased Tree;
Position : Cursor)
return Reference_Type;
Position : Cursor) return Reference_Type;
Empty_Tree : constant Tree := (Controlled with others => <>);
......
......@@ -1690,7 +1690,7 @@ package body Exp_Ch9 is
-- The parameter that designates the synchronized object in the call
Actuals : constant List_Id := New_List;
-- the actuals in the entry call
-- The actuals in the entry call
Decls : constant List_Id := New_List;
......@@ -8337,7 +8337,7 @@ package body Exp_Ch9 is
Insert_After (Current_Node, Sub);
Analyze (Sub);
-- build wrapper procedure for pre/postconditions
-- Build wrapper procedure for pre/postconditions
Build_PPC_Wrapper (Comp_Id, N);
......@@ -10618,28 +10618,31 @@ package body Exp_Ch9 is
if Present (Taskdef)
and then Has_Storage_Size_Pragma (Taskdef)
and then
Is_Static_Expression (Expression (First (
Pragma_Argument_Associations (Find_Task_Or_Protected_Pragma (
Taskdef, Name_Storage_Size)))))
Is_Static_Expression
(Expression
(First (Pragma_Argument_Associations
(Find_Task_Or_Protected_Pragma
(Taskdef, Name_Storage_Size)))))
then
Size_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Storage_Size_Variable (Tasktyp),
Object_Definition => New_Reference_To (RTE (RE_Size_Type), Loc),
Expression =>
Object_Definition => New_Reference_To (RTE (RE_Size_Type), Loc),
Expression =>
Convert_To (RTE (RE_Size_Type),
Relocate_Node (
Expression (First (
Pragma_Argument_Associations (
Find_Task_Or_Protected_Pragma
(Taskdef, Name_Storage_Size)))))));
Relocate_Node
(Expression (First (Pragma_Argument_Associations
(Find_Task_Or_Protected_Pragma
(Taskdef, Name_Storage_Size)))))));
else
Size_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Storage_Size_Variable (Tasktyp),
Object_Definition => New_Reference_To (RTE (RE_Size_Type), Loc),
Expression => New_Reference_To (RTE (RE_Unspecified_Size), Loc));
Object_Definition =>
New_Reference_To (RTE (RE_Size_Type), Loc),
Expression =>
New_Reference_To (RTE (RE_Unspecified_Size), Loc));
end if;
Insert_After (Elab_Decl, Size_Decl);
......@@ -10652,7 +10655,7 @@ package body Exp_Ch9 is
Append_To (Cdecls,
Make_Component_Declaration (Loc,
Defining_Identifier =>
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uTask_Id),
Component_Definition =>
Make_Component_Definition (Loc,
......@@ -10673,8 +10676,8 @@ package body Exp_Ch9 is
Make_Component_Definition (Loc,
Aliased_Present => True,
Subtype_Indication => Make_Subtype_Indication (Loc,
Subtype_Mark => New_Occurrence_Of
(RTE (RE_Ada_Task_Control_Block), Loc),
Subtype_Mark =>
New_Occurrence_Of (RTE (RE_Ada_Task_Control_Block), Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
......
......@@ -11075,7 +11075,6 @@ package body Exp_Dist is
function RPC_Receiver_Decl (RACW_Type : Entity_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (RACW_Type);
begin
return
Make_Object_Declaration (Loc,
......
......@@ -474,10 +474,12 @@ procedure Gnat1drv is
Warning_Mode := Suppress;
-- Suppress the generation of name tables for enumerations
-- why???
Global_Discard_Names := True;
-- Suppress the expansion of tagged types and dispatching calls
-- why???
Tagged_Type_Expansion := False;
end if;
......
......@@ -80,7 +80,7 @@ package System.Task_Primitives is
private
type Lock is new System.OS_Interface.pthread_mutex_t;
type RW_Lock is new Lock;
type RW_Lock is new System.OS_Interface.pthread_rwlock_t;
type RTS_Lock is new System.OS_Interface.pthread_mutex_t;
type Suspension_Object is record
......
......@@ -2302,8 +2302,9 @@ package body Sem_Ch5 is
Typ : Entity_Id;
begin
-- In semantics and Alfa modes, introduce loop variable so that loop
-- body can be properly analyzed. Otherwise this is one after expansion.
-- In semantics/Alfa modes, we won't be further expanding the loop, so
-- introduce loop variable so that loop body can be properly analyzed.
-- Otherwise this happens after expansion.
if Operating_Mode = Check_Semantics
or else Alfa_Mode
......
......@@ -2274,9 +2274,9 @@ package body Sem_Util is
is
Comp : Node_Id;
Comps : constant List_Id := New_List;
begin
Comp := First_Component (Underlying_Type (R_Typ));
while Present (Comp) loop
if Comes_From_Source (Comp) then
declare
......@@ -2291,6 +2291,7 @@ package body Sem_Util is
(Component_Definition (Comp_Decl), New_Sloc => Loc)));
end;
end if;
Next_Component (Comp);
end loop;
......
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