aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2010-10-22 10:04:20 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-22 12:04:20 +0200
commit00c7151cdf1d73504a4154bf3e630008dd1bc7d3 (patch)
treeb6bc93213e84a172cc2f10ff4b4229bc8f9f3daa /gcc
parentc0f136cd17132ceeb25dadb4c97f474d37924cbd (diff)
downloadgcc-00c7151cdf1d73504a4154bf3e630008dd1bc7d3.zip
gcc-00c7151cdf1d73504a4154bf3e630008dd1bc7d3.tar.gz
gcc-00c7151cdf1d73504a4154bf3e630008dd1bc7d3.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/exp_ch5.adb37
-rw-r--r--gcc/ada/par-ch4.adb2
-rw-r--r--gcc/ada/par-ch5.adb3
-rw-r--r--gcc/ada/sem_ch5.adb17
-rw-r--r--gcc/ada/sinfo.ads10
6 files changed, 38 insertions, 36 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5e656f9..a640b46 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+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>
* a-locale.adb: Minor code clean up.
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index b0a4d49..5fe2c48 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -2760,13 +2760,12 @@ package body Exp_Ch5 is
Isc : constant Node_Id := Iteration_Scheme (N);
I_Spec : constant Node_Id := Iterator_Specification (Isc);
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;
- New_Loop : Node_Id;
- Stats : List_Id;
+ Cursor : Entity_Id;
+ New_Loop : Node_Id;
+ Stats : List_Id;
begin
if Is_Array_Type (Typ) then
@@ -2809,7 +2808,6 @@ package body Exp_Ch5 is
end;
else
-
-- for Index in Array loop ...
-- The cursor (index into the array) is the source Id
@@ -2832,31 +2830,29 @@ package body Exp_Ch5 is
End_Label => Empty);
end if;
+ -- Iterators over containers
+
else
+ -- In both cases these require a cursor of the proper type
- -- Iterators over containers. In both cases these require a cursor of
- -- the proper type.
+ -- Cursor : P.Cursor_Type := Container.First;
+ -- while Cursor /= P.No_Element loop
- -- Cursor : P.Cursor_Type := Container.First;
- -- while Cursor /= P.No_Element loop
+ -- Obj : P.Element_Type renames Element (Cursor);
+ -- -- For the "of" form, the element name renames the element
+ -- -- designated by the cursor.
- -- Obj : P.Element_Type renames Element (Cursor);
- -- -- For the "of" form, the element name renames the element
- -- -- designated by the cursor.
+ -- Statements;
+ -- P.Next (Cursor);
+ -- end loop;
- -- Statements;
- -- P.Next (Cursor);
- -- end loop;
- --
-- with the obvious replacements if "reverse" is specified.
declare
Element_Type : constant Entity_Id := Etype (Id);
Pack : constant Entity_Id := Scope (Etype (Container));
-
Name_Init : Name_Id;
Name_Step : Name_Id;
-
Cond : Node_Id;
Cursor_Decl : Node_Id;
Renaming_Decl : Node_Id;
@@ -2866,7 +2862,6 @@ package body Exp_Ch5 is
if Of_Present (I_Spec) then
Cursor := Make_Temporary (Loc, 'C');
-
else
Cursor := Id;
end if;
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 8ab04ef..5e26def 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -2536,7 +2536,7 @@ package body Ch4 is
raise Error_Resync;
end if;
- Scan;
+ Scan; -- past SOME
I_Spec := P_Loop_Parameter_Specification;
if Nkind (I_Spec) = N_Loop_Parameter_Specification then
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb
index de5883a..400b3e1 100644
--- a/gcc/ada/par-ch5.adb
+++ b/gcc/ada/par-ch5.adb
@@ -1570,6 +1570,7 @@ package body Ch5 is
Scan; -- past FOR
Iter_Scheme_Node := New_Node (N_Iteration_Scheme, Token_Ptr);
Spec := P_Loop_Parameter_Specification;
+
if Nkind (Spec) = N_Loop_Parameter_Specification then
Set_Loop_Parameter_Specification (Iter_Scheme_Node, Spec);
else
@@ -1750,6 +1751,7 @@ package body Ch5 is
function P_Iterator_Specification (Def_Id : Node_Id) return Node_Id is
Node1 : Node_Id;
+
begin
Node1 := New_Node (N_Iterator_Specification, Token_Ptr);
Set_Defining_Identifier (Node1, Def_Id);
@@ -1776,7 +1778,6 @@ package body Ch5 is
end if;
Set_Name (Node1, P_Name);
-
return Node1;
end P_Iterator_Specification;
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index a4963be..e79da0a 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -1734,6 +1734,8 @@ package body Sem_Ch5 is
-- Start of processing for Analyze_Iteration_Scheme
begin
+ -- Why is following check needed ???
+
if Analyzed (N) then
return;
end if;
@@ -1806,9 +1808,8 @@ package body Sem_Ch5 is
if Nkind (DS) = N_Function_Call
or else
(Is_Entity_Name (DS)
- and then not Is_Type (Entity (DS)))
+ and then not Is_Type (Entity (DS)))
then
-
-- This is an iterator specification. Rewrite as such
-- and analyze.
@@ -1823,7 +1824,6 @@ package body Sem_Ch5 is
Empty,
Reverse_Present =>
Reverse_Present (LP));
-
begin
Set_Iterator_Specification (N, I_Spec);
Set_Loop_Parameter_Specification (N, Empty);
@@ -1981,8 +1981,8 @@ package body Sem_Ch5 is
Subt : constant Node_Id := Subtype_Indication (N);
Container : constant Node_Id := Name (N);
- Ent : Entity_Id;
- Typ : Entity_Id;
+ Ent : Entity_Id;
+ Typ : Entity_Id;
begin
Enter_Name (Def_Id);
@@ -1998,15 +1998,15 @@ package body Sem_Ch5 is
if Is_Array_Type (Typ) then
if Of_Present (N) then
Set_Etype (Def_Id, Component_Type (Typ));
-
else
Set_Etype (Def_Id, Etype (First_Index (Typ)));
end if;
- else
- -- Iteration over a container
+ -- Iteration over a container
+ else
Set_Ekind (Def_Id, E_Loop_Parameter);
+
if Of_Present (N) then
-- Find the Element_Type in the package instance that defines the
@@ -2023,7 +2023,6 @@ package body Sem_Ch5 is
end loop;
else
-
-- Find the Cursor type in similar fashion
Ent := First_Entity (Scope (Typ));
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 3608ad8..186b789 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -1544,10 +1544,6 @@ package Sinfo is
-- is used for properly setting out of range values for use by pragmas
-- 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)
-- Present in identifiers. Used in references to discriminants that
-- appear in generic units. Because the names of the discriminants may be
@@ -4220,6 +4216,8 @@ package Sinfo is
-- Of_Present (Flag16)
-- Subtype_Indication (Node5)
+ -- Note: The Of_Present flag distinguishes the two forms
+
--------------------------
-- 5.6 Block Statement --
--------------------------
@@ -11758,6 +11756,7 @@ package Sinfo is
pragma Inline (Inherited_Discriminant);
pragma Inline (Instance_Spec);
pragma Inline (Intval);
+ pragma Inline (Iterator_Specification);
pragma Inline (Is_Accessibility_Actual);
pragma Inline (Is_Asynchronous_Call_Block);
pragma Inline (Is_Component_Left_Opnd);
@@ -11821,6 +11820,7 @@ package Sinfo is
pragma Inline (Null_Exclusion_In_Return_Present);
pragma Inline (Null_Record_Present);
pragma Inline (Object_Definition);
+ pragma Inline (Of_Present);
pragma Inline (Original_Discriminant);
pragma Inline (Original_Entity);
pragma Inline (Others_Discrete_Choices);
@@ -12072,6 +12072,7 @@ package Sinfo is
pragma Inline (Set_Inherited_Discriminant);
pragma Inline (Set_Instance_Spec);
pragma Inline (Set_Intval);
+ pragma Inline (Set_Iterator_Specification);
pragma Inline (Set_Is_Accessibility_Actual);
pragma Inline (Set_Is_Asynchronous_Call_Block);
pragma Inline (Set_Is_Component_Left_Opnd);
@@ -12136,6 +12137,7 @@ package Sinfo is
pragma Inline (Set_Null_Exclusion_In_Return_Present);
pragma Inline (Set_Null_Record_Present);
pragma Inline (Set_Object_Definition);
+ pragma Inline (Set_Of_Present);
pragma Inline (Set_Original_Discriminant);
pragma Inline (Set_Original_Entity);
pragma Inline (Set_Others_Discrete_Choices);