sem_aggr.adb, [...]: Minor reformatting & code reorganization.
2014-08-01 Robert Dewar <dewar@adacore.com> * sem_aggr.adb, exp_atag.adb, layout.adb, nlists.adb, nlists.ads, exp_attr.adb, exp_ch9.adb, par-ch12.adb, exp_aggr.adb, exp_ch3.adb: Minor reformatting & code reorganization. From-SVN: r213439
This commit is contained in:
parent
e08add8ea9
commit
37368818b9
@ -1,3 +1,9 @@
|
||||
2014-08-01 Robert Dewar <dewar@adacore.com>
|
||||
|
||||
* sem_aggr.adb, exp_atag.adb, layout.adb, nlists.adb, nlists.ads,
|
||||
exp_attr.adb, exp_ch9.adb, par-ch12.adb, exp_aggr.adb,
|
||||
exp_ch3.adb: Minor reformatting & code reorganization.
|
||||
|
||||
2014-08-01 Robert Dewar <dewar@adacore.com>
|
||||
|
||||
* gnat_rm.texi: Remove VMS specific rules for pragma Ident.
|
||||
|
@ -1163,8 +1163,8 @@ package body Exp_Aggr is
|
||||
|
||||
if Needs_Finalization (Ctype) then
|
||||
Append_To (L,
|
||||
Make_Init_Call (
|
||||
Obj_Ref => New_Copy_Tree (Indexed_Comp),
|
||||
Make_Init_Call
|
||||
(Obj_Ref => New_Copy_Tree (Indexed_Comp),
|
||||
Typ => Ctype));
|
||||
end if;
|
||||
|
||||
@ -1262,8 +1262,8 @@ package body Exp_Aggr is
|
||||
and then Nkind (Expr) = N_Aggregate)
|
||||
then
|
||||
Append_To (L,
|
||||
Make_Adjust_Call (
|
||||
Obj_Ref => New_Copy_Tree (Indexed_Comp),
|
||||
Make_Adjust_Call
|
||||
(Obj_Ref => New_Copy_Tree (Indexed_Comp),
|
||||
Typ => Comp_Type));
|
||||
end if;
|
||||
end if;
|
||||
@ -1406,7 +1406,8 @@ package body Exp_Aggr is
|
||||
|
||||
-- Construct the final loop
|
||||
|
||||
Append_To (S, Make_Implicit_Loop_Statement
|
||||
Append_To (S,
|
||||
Make_Implicit_Loop_Statement
|
||||
(Node => N,
|
||||
Identifier => Empty,
|
||||
Iteration_Scheme => L_Iteration_Scheme,
|
||||
@ -1513,7 +1514,8 @@ package body Exp_Aggr is
|
||||
|
||||
-- Construct the final loop
|
||||
|
||||
Append_To (S, Make_Implicit_Loop_Statement
|
||||
Append_To (S,
|
||||
Make_Implicit_Loop_Statement
|
||||
(Node => N,
|
||||
Identifier => Empty,
|
||||
Iteration_Scheme => W_Iteration_Scheme,
|
||||
@ -2510,8 +2512,8 @@ package body Exp_Aggr is
|
||||
and then not Is_Limited_Type (Etype (Ancestor))
|
||||
then
|
||||
Append_To (Assign,
|
||||
Make_Adjust_Call (
|
||||
Obj_Ref => New_Copy_Tree (Ref),
|
||||
Make_Adjust_Call
|
||||
(Obj_Ref => New_Copy_Tree (Ref),
|
||||
Typ => Etype (Ancestor)));
|
||||
end if;
|
||||
|
||||
@ -2629,8 +2631,7 @@ package body Exp_Aggr is
|
||||
Append_To (L,
|
||||
Make_Procedure_Call_Statement (Loc,
|
||||
Name =>
|
||||
New_Occurrence_Of
|
||||
(Base_Init_Proc (CPP_Parent), Loc),
|
||||
New_Occurrence_Of (Base_Init_Proc (CPP_Parent), Loc),
|
||||
Parameter_Associations => New_List (
|
||||
Unchecked_Convert_To (CPP_Parent,
|
||||
New_Copy_Tree (Lhs)))));
|
||||
@ -2655,10 +2656,10 @@ package body Exp_Aggr is
|
||||
if Is_CPP_Constructor_Call (Expression (Comp)) then
|
||||
Append_List_To (L,
|
||||
Build_Initialization_Call (Loc,
|
||||
Id_Ref => Make_Selected_Component (Loc,
|
||||
Id_Ref =>
|
||||
Make_Selected_Component (Loc,
|
||||
Prefix => New_Copy_Tree (Target),
|
||||
Selector_Name =>
|
||||
New_Occurrence_Of (Selector, Loc)),
|
||||
Selector_Name => New_Occurrence_Of (Selector, Loc)),
|
||||
Typ => Etype (Selector),
|
||||
Enclos_Type => Typ,
|
||||
With_Default_Init => True,
|
||||
@ -2911,13 +2912,13 @@ package body Exp_Aggr is
|
||||
and then not Is_Limited_Type (Comp_Type)
|
||||
then
|
||||
Append_To (L,
|
||||
Make_Adjust_Call (
|
||||
Obj_Ref => New_Copy_Tree (Comp_Expr),
|
||||
Make_Adjust_Call
|
||||
(Obj_Ref => New_Copy_Tree (Comp_Expr),
|
||||
Typ => Comp_Type));
|
||||
end if;
|
||||
end if;
|
||||
|
||||
-- ???
|
||||
-- comment would be good here ???
|
||||
|
||||
elsif Ekind (Selector) = E_Discriminant
|
||||
and then Nkind (N) /= N_Extension_Aggregate
|
||||
@ -4209,11 +4210,10 @@ package body Exp_Aggr is
|
||||
-- positional. Retrieve each dimension bounds (computed earlier).
|
||||
|
||||
for D in 1 .. Number_Dimensions (Typ) loop
|
||||
Append (
|
||||
Append_To (Indexes,
|
||||
Make_Range (Loc,
|
||||
Low_Bound => Aggr_Low (D),
|
||||
High_Bound => Aggr_High (D)),
|
||||
Indexes);
|
||||
High_Bound => Aggr_High (D)));
|
||||
end loop;
|
||||
end if;
|
||||
|
||||
@ -6097,9 +6097,9 @@ package body Exp_Aggr is
|
||||
Discriminant := First_Stored_Discriminant (Base_Type (Typ));
|
||||
while Present (Discriminant) loop
|
||||
New_Comp :=
|
||||
New_Copy_Tree (
|
||||
Get_Discriminant_Value (
|
||||
Discriminant,
|
||||
New_Copy_Tree
|
||||
(Get_Discriminant_Value
|
||||
(Discriminant,
|
||||
Typ,
|
||||
Discriminant_Constraint (Typ)));
|
||||
Append (New_Comp, Constraints);
|
||||
@ -6173,8 +6173,7 @@ package body Exp_Aggr is
|
||||
Make_Component_Association (Loc,
|
||||
Choices =>
|
||||
New_List (New_Occurrence_Of (Comp, Loc)),
|
||||
Expression =>
|
||||
New_Comp));
|
||||
Expression => New_Comp));
|
||||
|
||||
Analyze_And_Resolve (New_Comp, Etype (Comp));
|
||||
end if;
|
||||
@ -7135,8 +7134,7 @@ package body Exp_Aggr is
|
||||
|
||||
for I in UI_To_Int (Intval (Lo)) .. UI_To_Int (Intval (Hi))
|
||||
loop
|
||||
Append_To
|
||||
(Expressions (Agg), New_Copy (Expression (Expr)));
|
||||
Append_To (Expressions (Agg), New_Copy (Expression (Expr)));
|
||||
|
||||
-- The copied expression must be analyzed and resolved.
|
||||
-- Besides setting the type, this ensures that static
|
||||
|
@ -6,7 +6,7 @@
|
||||
-- --
|
||||
-- S p e c --
|
||||
-- --
|
||||
-- Copyright (C) 2006-2013, Free Software Foundation, Inc. --
|
||||
-- Copyright (C) 2006-2014, 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- --
|
||||
@ -102,7 +102,8 @@ package body Exp_Atag is
|
||||
Name => Make_Identifier (Loc, Name_uC),
|
||||
Expression =>
|
||||
Make_Function_Call (Loc,
|
||||
Name => New_Occurrence_Of (RTE (RE_Get_Prim_Op_Kind), Loc),
|
||||
Name =>
|
||||
New_Occurrence_Of (RTE (RE_Get_Prim_Op_Kind), Loc),
|
||||
Parameter_Associations => New_List (
|
||||
Tag_Node,
|
||||
Make_Identifier (Loc, Name_uS)))));
|
||||
|
@ -2350,8 +2350,7 @@ package body Exp_Ch3 is
|
||||
|
||||
if not Null_Present (Type_Definition (N)) then
|
||||
Append_List_To (Body_Stmts,
|
||||
Build_Init_Statements (
|
||||
Component_List (Type_Definition (N))));
|
||||
Build_Init_Statements (Component_List (Type_Definition (N))));
|
||||
end if;
|
||||
|
||||
-- N is a Derived_Type_Definition with a possible non-empty
|
||||
@ -4459,8 +4458,7 @@ package body Exp_Ch3 is
|
||||
-- the case statement switch. Their value is added when an
|
||||
-- equality call on unchecked unions is expanded.
|
||||
|
||||
Append_List_To (Stmts,
|
||||
Make_Eq_Case (Typ, Comps, New_Discrs));
|
||||
Append_List_To (Stmts, Make_Eq_Case (Typ, Comps, New_Discrs));
|
||||
end;
|
||||
|
||||
-- Normal case (not unchecked union)
|
||||
|
@ -10624,14 +10624,13 @@ package body Exp_Ch9 is
|
||||
Params : constant List_Id := New_List;
|
||||
|
||||
begin
|
||||
Append (
|
||||
Append_To (Params,
|
||||
Make_Attribute_Reference (Loc,
|
||||
Prefix => New_Occurrence_Of (Qnam, Loc),
|
||||
Attribute_Name => Name_Unchecked_Access),
|
||||
Params);
|
||||
Append (Select_Mode, Params);
|
||||
Append (New_Occurrence_Of (Ann, Loc), Params);
|
||||
Append (New_Occurrence_Of (Xnam, Loc), Params);
|
||||
Attribute_Name => Name_Unchecked_Access));
|
||||
Append_To (Params, Select_Mode);
|
||||
Append_To (Params, New_Occurrence_Of (Ann, Loc));
|
||||
Append_To (Params, New_Occurrence_Of (Xnam, Loc));
|
||||
|
||||
return
|
||||
Make_Procedure_Call_Statement (Loc,
|
||||
@ -11351,6 +11350,7 @@ package body Exp_Ch9 is
|
||||
Append (Cases, Stats);
|
||||
end;
|
||||
end if;
|
||||
|
||||
Append (End_Lab, Stats);
|
||||
|
||||
-- Replace accept statement with appropriate block
|
||||
|
@ -2195,13 +2195,12 @@ package body Layout is
|
||||
D_List := New_List;
|
||||
D_Entity := First_Discriminant (E);
|
||||
while Present (D_Entity) loop
|
||||
Append (
|
||||
Append_To (D_List,
|
||||
Make_Selected_Component (Loc,
|
||||
Prefix =>
|
||||
Make_Identifier (Loc, Vname),
|
||||
Selector_Name =>
|
||||
New_Occurrence_Of (D_Entity, Loc)),
|
||||
D_List);
|
||||
New_Occurrence_Of (D_Entity, Loc)));
|
||||
|
||||
D_Entity := Next_Discriminant (D_Entity);
|
||||
end loop;
|
||||
|
@ -6,7 +6,7 @@
|
||||
-- --
|
||||
-- B o d y --
|
||||
-- --
|
||||
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
|
||||
-- Copyright (C) 1992-2014, 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- --
|
||||
@ -744,8 +744,8 @@ package body Nlists is
|
||||
|
||||
else
|
||||
NL := New_List;
|
||||
E := First (List);
|
||||
|
||||
E := First (List);
|
||||
while Present (E) loop
|
||||
if Comes_From_Source (E) then
|
||||
Append (New_Copy (E), NL);
|
||||
|
@ -225,9 +225,9 @@ package Nlists is
|
||||
|
||||
procedure Append (Node : Node_Or_Entity_Id; To : List_Id);
|
||||
-- Appends Node at the end of node list To. Node must be a non-empty node
|
||||
-- that is not already a member of a node list, and To must be a
|
||||
-- node list. An attempt to append an error node is ignored without
|
||||
-- complaint and the list is unchanged.
|
||||
-- that is not already a member of a node list, and To must be a node list.
|
||||
-- An attempt to append an error node is ignored without complaint and the
|
||||
-- list is unchanged.
|
||||
|
||||
procedure Append_To (To : List_Id; Node : Node_Or_Entity_Id);
|
||||
pragma Inline (Append_To);
|
||||
|
@ -6,7 +6,7 @@
|
||||
-- --
|
||||
-- B o d y --
|
||||
-- --
|
||||
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
|
||||
-- Copyright (C) 1992-2014, 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- --
|
||||
@ -168,6 +168,7 @@ package body Ch12 is
|
||||
|
||||
if Token = Tok_Use then
|
||||
Append (P_Use_Clause, Decls);
|
||||
|
||||
else
|
||||
-- Parse a generic parameter declaration
|
||||
|
||||
|
@ -4355,13 +4355,12 @@ package body Sem_Aggr is
|
||||
end if;
|
||||
|
||||
if Needs_Box then
|
||||
Append
|
||||
(Make_Component_Association (Loc,
|
||||
Append_To (Component_Associations (Aggr),
|
||||
Make_Component_Association (Loc,
|
||||
Choices =>
|
||||
New_List (Make_Others_Choice (Loc)),
|
||||
Expression => Empty,
|
||||
Box_Present => True),
|
||||
Component_Associations (Aggr));
|
||||
Box_Present => True));
|
||||
end if;
|
||||
end Propagate_Discriminants;
|
||||
|
||||
@ -4400,14 +4399,14 @@ package body Sem_Aggr is
|
||||
while Present (Comp) loop
|
||||
if Ekind (Comp) = E_Component then
|
||||
if not Is_Record_Type (Etype (Comp)) then
|
||||
Append
|
||||
(Make_Component_Association (Loc,
|
||||
Append_To
|
||||
(Component_Associations (Expr),
|
||||
Make_Component_Association (Loc,
|
||||
Choices =>
|
||||
New_List
|
||||
(Make_Others_Choice (Loc)),
|
||||
Expression => Empty,
|
||||
Box_Present => True),
|
||||
Component_Associations (Expr));
|
||||
Box_Present => True));
|
||||
end if;
|
||||
exit;
|
||||
end if;
|
||||
|
Loading…
x
Reference in New Issue
Block a user