Commit 00c7151c by Robert Dewar Committed by Arnaud Charlet

exp_ch5.adb, [...]: Minor reformatting.

2010-10-22  Robert Dewar  <dewar@adacore.com>

	* exp_ch5.adb, par-ch4.adb, par-ch5.adb, sem_ch5.adb, sinfo.ads: Minor
	reformatting.

From-SVN: r165814
parent c0f136cd
2010-10-22 Robert Dewar <dewar@adacore.com>
* exp_ch5.adb, par-ch4.adb, par-ch5.adb, sem_ch5.adb, sinfo.ads: Minor
reformatting.
2010-10-22 Arnaud Charlet <charlet@adacore.com> 2010-10-22 Arnaud Charlet <charlet@adacore.com>
* a-locale.adb: Minor code clean up. * a-locale.adb: Minor code clean up.
......
...@@ -2761,7 +2761,6 @@ package body Exp_Ch5 is ...@@ -2761,7 +2761,6 @@ package body Exp_Ch5 is
I_Spec : constant Node_Id := Iterator_Specification (Isc); I_Spec : constant Node_Id := Iterator_Specification (Isc);
Id : constant Entity_Id := Defining_Identifier (I_Spec); Id : constant Entity_Id := Defining_Identifier (I_Spec);
Container : constant Entity_Id := Entity (Name (I_Spec)); Container : constant Entity_Id := Entity (Name (I_Spec));
Typ : constant Entity_Id := Etype (Container); Typ : constant Entity_Id := Etype (Container);
Cursor : Entity_Id; Cursor : Entity_Id;
...@@ -2809,7 +2808,6 @@ package body Exp_Ch5 is ...@@ -2809,7 +2808,6 @@ package body Exp_Ch5 is
end; end;
else else
-- for Index in Array loop ... -- for Index in Array loop ...
-- The cursor (index into the array) is the source Id -- The cursor (index into the array) is the source Id
...@@ -2832,10 +2830,10 @@ package body Exp_Ch5 is ...@@ -2832,10 +2830,10 @@ package body Exp_Ch5 is
End_Label => Empty); End_Label => Empty);
end if; end if;
else -- Iterators over containers
-- Iterators over containers. In both cases these require a cursor of else
-- the proper type. -- In both cases these require a cursor of the proper type
-- Cursor : P.Cursor_Type := Container.First; -- Cursor : P.Cursor_Type := Container.First;
-- while Cursor /= P.No_Element loop -- while Cursor /= P.No_Element loop
...@@ -2847,16 +2845,14 @@ package body Exp_Ch5 is ...@@ -2847,16 +2845,14 @@ package body Exp_Ch5 is
-- Statements; -- Statements;
-- P.Next (Cursor); -- P.Next (Cursor);
-- end loop; -- end loop;
--
-- with the obvious replacements if "reverse" is specified. -- with the obvious replacements if "reverse" is specified.
declare declare
Element_Type : constant Entity_Id := Etype (Id); Element_Type : constant Entity_Id := Etype (Id);
Pack : constant Entity_Id := Scope (Etype (Container)); Pack : constant Entity_Id := Scope (Etype (Container));
Name_Init : Name_Id; Name_Init : Name_Id;
Name_Step : Name_Id; Name_Step : Name_Id;
Cond : Node_Id; Cond : Node_Id;
Cursor_Decl : Node_Id; Cursor_Decl : Node_Id;
Renaming_Decl : Node_Id; Renaming_Decl : Node_Id;
...@@ -2866,7 +2862,6 @@ package body Exp_Ch5 is ...@@ -2866,7 +2862,6 @@ package body Exp_Ch5 is
if Of_Present (I_Spec) then if Of_Present (I_Spec) then
Cursor := Make_Temporary (Loc, 'C'); Cursor := Make_Temporary (Loc, 'C');
else else
Cursor := Id; Cursor := Id;
end if; end if;
......
...@@ -2536,7 +2536,7 @@ package body Ch4 is ...@@ -2536,7 +2536,7 @@ package body Ch4 is
raise Error_Resync; raise Error_Resync;
end if; end if;
Scan; Scan; -- past SOME
I_Spec := P_Loop_Parameter_Specification; I_Spec := P_Loop_Parameter_Specification;
if Nkind (I_Spec) = N_Loop_Parameter_Specification then if Nkind (I_Spec) = N_Loop_Parameter_Specification then
......
...@@ -1570,6 +1570,7 @@ package body Ch5 is ...@@ -1570,6 +1570,7 @@ package body Ch5 is
Scan; -- past FOR Scan; -- past FOR
Iter_Scheme_Node := New_Node (N_Iteration_Scheme, Token_Ptr); Iter_Scheme_Node := New_Node (N_Iteration_Scheme, Token_Ptr);
Spec := P_Loop_Parameter_Specification; Spec := P_Loop_Parameter_Specification;
if Nkind (Spec) = N_Loop_Parameter_Specification then if Nkind (Spec) = N_Loop_Parameter_Specification then
Set_Loop_Parameter_Specification (Iter_Scheme_Node, Spec); Set_Loop_Parameter_Specification (Iter_Scheme_Node, Spec);
else else
...@@ -1750,6 +1751,7 @@ package body Ch5 is ...@@ -1750,6 +1751,7 @@ package body Ch5 is
function P_Iterator_Specification (Def_Id : Node_Id) return Node_Id is function P_Iterator_Specification (Def_Id : Node_Id) return Node_Id is
Node1 : Node_Id; Node1 : Node_Id;
begin begin
Node1 := New_Node (N_Iterator_Specification, Token_Ptr); Node1 := New_Node (N_Iterator_Specification, Token_Ptr);
Set_Defining_Identifier (Node1, Def_Id); Set_Defining_Identifier (Node1, Def_Id);
...@@ -1776,7 +1778,6 @@ package body Ch5 is ...@@ -1776,7 +1778,6 @@ package body Ch5 is
end if; end if;
Set_Name (Node1, P_Name); Set_Name (Node1, P_Name);
return Node1; return Node1;
end P_Iterator_Specification; end P_Iterator_Specification;
......
...@@ -1734,6 +1734,8 @@ package body Sem_Ch5 is ...@@ -1734,6 +1734,8 @@ package body Sem_Ch5 is
-- Start of processing for Analyze_Iteration_Scheme -- Start of processing for Analyze_Iteration_Scheme
begin begin
-- Why is following check needed ???
if Analyzed (N) then if Analyzed (N) then
return; return;
end if; end if;
...@@ -1808,7 +1810,6 @@ package body Sem_Ch5 is ...@@ -1808,7 +1810,6 @@ package body Sem_Ch5 is
(Is_Entity_Name (DS) (Is_Entity_Name (DS)
and then not Is_Type (Entity (DS))) and then not Is_Type (Entity (DS)))
then then
-- This is an iterator specification. Rewrite as such -- This is an iterator specification. Rewrite as such
-- and analyze. -- and analyze.
...@@ -1823,7 +1824,6 @@ package body Sem_Ch5 is ...@@ -1823,7 +1824,6 @@ package body Sem_Ch5 is
Empty, Empty,
Reverse_Present => Reverse_Present =>
Reverse_Present (LP)); Reverse_Present (LP));
begin begin
Set_Iterator_Specification (N, I_Spec); Set_Iterator_Specification (N, I_Spec);
Set_Loop_Parameter_Specification (N, Empty); Set_Loop_Parameter_Specification (N, Empty);
...@@ -1998,15 +1998,15 @@ package body Sem_Ch5 is ...@@ -1998,15 +1998,15 @@ package body Sem_Ch5 is
if Is_Array_Type (Typ) then if Is_Array_Type (Typ) then
if Of_Present (N) then if Of_Present (N) then
Set_Etype (Def_Id, Component_Type (Typ)); Set_Etype (Def_Id, Component_Type (Typ));
else else
Set_Etype (Def_Id, Etype (First_Index (Typ))); Set_Etype (Def_Id, Etype (First_Index (Typ)));
end if; end if;
else
-- Iteration over a container -- Iteration over a container
else
Set_Ekind (Def_Id, E_Loop_Parameter); Set_Ekind (Def_Id, E_Loop_Parameter);
if Of_Present (N) then if Of_Present (N) then
-- Find the Element_Type in the package instance that defines the -- Find the Element_Type in the package instance that defines the
...@@ -2023,7 +2023,6 @@ package body Sem_Ch5 is ...@@ -2023,7 +2023,6 @@ package body Sem_Ch5 is
end loop; end loop;
else else
-- Find the Cursor type in similar fashion -- Find the Cursor type in similar fashion
Ent := First_Entity (Scope (Typ)); Ent := First_Entity (Scope (Typ));
......
...@@ -1544,10 +1544,6 @@ package Sinfo is ...@@ -1544,10 +1544,6 @@ package Sinfo is
-- is used for properly setting out of range values for use by pragmas -- is used for properly setting out of range values for use by pragmas
-- Initialize_Scalars and Normalize_Scalars. -- Initialize_Scalars and Normalize_Scalars.
-- Of_Present (Flag16)
-- Present in N_Iterator_Specification nodes, to mark the Ada 2012 iterator
-- form over arrays and containers.
-- Original_Discriminant (Node2-Sem) -- Original_Discriminant (Node2-Sem)
-- Present in identifiers. Used in references to discriminants that -- Present in identifiers. Used in references to discriminants that
-- appear in generic units. Because the names of the discriminants may be -- appear in generic units. Because the names of the discriminants may be
...@@ -4220,6 +4216,8 @@ package Sinfo is ...@@ -4220,6 +4216,8 @@ package Sinfo is
-- Of_Present (Flag16) -- Of_Present (Flag16)
-- Subtype_Indication (Node5) -- Subtype_Indication (Node5)
-- Note: The Of_Present flag distinguishes the two forms
-------------------------- --------------------------
-- 5.6 Block Statement -- -- 5.6 Block Statement --
-------------------------- --------------------------
...@@ -11758,6 +11756,7 @@ package Sinfo is ...@@ -11758,6 +11756,7 @@ package Sinfo is
pragma Inline (Inherited_Discriminant); pragma Inline (Inherited_Discriminant);
pragma Inline (Instance_Spec); pragma Inline (Instance_Spec);
pragma Inline (Intval); pragma Inline (Intval);
pragma Inline (Iterator_Specification);
pragma Inline (Is_Accessibility_Actual); pragma Inline (Is_Accessibility_Actual);
pragma Inline (Is_Asynchronous_Call_Block); pragma Inline (Is_Asynchronous_Call_Block);
pragma Inline (Is_Component_Left_Opnd); pragma Inline (Is_Component_Left_Opnd);
...@@ -11821,6 +11820,7 @@ package Sinfo is ...@@ -11821,6 +11820,7 @@ package Sinfo is
pragma Inline (Null_Exclusion_In_Return_Present); pragma Inline (Null_Exclusion_In_Return_Present);
pragma Inline (Null_Record_Present); pragma Inline (Null_Record_Present);
pragma Inline (Object_Definition); pragma Inline (Object_Definition);
pragma Inline (Of_Present);
pragma Inline (Original_Discriminant); pragma Inline (Original_Discriminant);
pragma Inline (Original_Entity); pragma Inline (Original_Entity);
pragma Inline (Others_Discrete_Choices); pragma Inline (Others_Discrete_Choices);
...@@ -12072,6 +12072,7 @@ package Sinfo is ...@@ -12072,6 +12072,7 @@ package Sinfo is
pragma Inline (Set_Inherited_Discriminant); pragma Inline (Set_Inherited_Discriminant);
pragma Inline (Set_Instance_Spec); pragma Inline (Set_Instance_Spec);
pragma Inline (Set_Intval); pragma Inline (Set_Intval);
pragma Inline (Set_Iterator_Specification);
pragma Inline (Set_Is_Accessibility_Actual); pragma Inline (Set_Is_Accessibility_Actual);
pragma Inline (Set_Is_Asynchronous_Call_Block); pragma Inline (Set_Is_Asynchronous_Call_Block);
pragma Inline (Set_Is_Component_Left_Opnd); pragma Inline (Set_Is_Component_Left_Opnd);
...@@ -12136,6 +12137,7 @@ package Sinfo is ...@@ -12136,6 +12137,7 @@ package Sinfo is
pragma Inline (Set_Null_Exclusion_In_Return_Present); pragma Inline (Set_Null_Exclusion_In_Return_Present);
pragma Inline (Set_Null_Record_Present); pragma Inline (Set_Null_Record_Present);
pragma Inline (Set_Object_Definition); pragma Inline (Set_Object_Definition);
pragma Inline (Set_Of_Present);
pragma Inline (Set_Original_Discriminant); pragma Inline (Set_Original_Discriminant);
pragma Inline (Set_Original_Entity); pragma Inline (Set_Original_Entity);
pragma Inline (Set_Others_Discrete_Choices); pragma Inline (Set_Others_Discrete_Choices);
......
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