diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-29 16:12:57 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-29 16:12:57 +0200 |
commit | 833eaa8a3dc786183340f972c6188cc188510d00 (patch) | |
tree | 50403ce926b555fa6853abac5dcba4c4fdd8c286 /gcc/ada/exp_ch5.adb | |
parent | 3a613a3621f796e5e8e21a6237caf60eaebcada0 (diff) | |
download | gcc-833eaa8a3dc786183340f972c6188cc188510d00.tar.gz |
[multiple changes]
2011-08-29 Robert Dewar <dewar@adacore.com>
* exp_ch5.adb, sem_ch3.adb, a-cihama.adb, a-cihama.ads, exp_ch7.adb,
sem_ch5.adb, a-ciorse.adb, a-ciorse.ads, sem_ch12.adb, a-cidlli.adb,
a-cidlli.ads, sem_util.adb, sem_res.adb, gnat1drv.adb, a-except.adb,
a-except.ads, a-except-2005.ads, sem_ch4.adb, exp_disp.adb,
exp_aggr.adb, sem_ch13.adb, par-ch3.adb: Minor reformatting.
2011-08-29 Tristan Gingold <gingold@adacore.com>
* s-auxdec-vms-alpha.adb: Add comments, remove some HT before labels.
2011-08-29 Vadim Godunko <godunko@adacore.com>
* s-parint.ads: Minor comment clarification.
2011-08-29 Vincent Celier <celier@adacore.com>
* prj.adb (Initialize): Make sure that new reserved words after Ada 95
may be used as identifiers.
2011-08-29 Ed Schonberg <schonberg@adacore.com>
* a-coinho.ads: Minor reformating.
From-SVN: r178239
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r-- | gcc/ada/exp_ch5.adb | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 4da232e5f9d..366140e9580 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -2858,7 +2858,7 @@ package body Exp_Ch5 is New_Reference_To (Iterator, Loc))))); -- for Index in Array loop - -- + -- This case utilizes the already given iterator name else @@ -2869,7 +2869,7 @@ package body Exp_Ch5 is -- for Iterator in [reverse] Container'Range loop -- Element : Component_Type renames Container (Iterator); -- -- for the "of" form - -- + -- <original loop statements> -- end loop; @@ -2952,10 +2952,12 @@ package body Exp_Ch5 is if Of_Present (I_Spec) then declare - Default_Iter : constant Entity_Id := - Entity ( - Find_Aspect - (Etype (Container), Aspect_Default_Iterator)); + Default_Iter : constant Entity_Id := + Entity + (Find_Aspect + (Etype (Container), + Aspect_Default_Iterator)); + Container_Arg : Node_Id; Ent : Entity_Id; @@ -2975,7 +2977,7 @@ package body Exp_Ch5 is -- inherited from the scope of the parent. if Base_Type (Etype (Container)) = - Base_Type (Etype (First_Formal (Default_Iter))) + Base_Type (Etype (First_Formal (Default_Iter))) then Container_Arg := New_Copy_Tree (Container); @@ -2985,8 +2987,8 @@ package body Exp_Ch5 is Container_Arg := Make_Type_Conversion (Loc, Subtype_Mark => - New_Occurrence_Of ( - Etype (First_Formal (Default_Iter)), Loc), + New_Occurrence_Of + (Etype (First_Formal (Default_Iter)), Loc), Expression => New_Copy_Tree (Container)); end if; @@ -3015,11 +3017,11 @@ package body Exp_Ch5 is Decl := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Id, - Subtype_Mark => + Subtype_Mark => New_Reference_To (Element_Type, Loc), - Name => + Name => Make_Indexed_Component (Loc, - Prefix => Make_Selected_Component (Loc, + Prefix => Make_Selected_Component (Loc, Prefix => New_Reference_To (Pack, Loc), Selector_Name => Make_Identifier (Loc, Chars => Name_Element)), @@ -3042,7 +3044,7 @@ package body Exp_Ch5 is Stats := New_List ( Make_Block_Statement (Loc, - Declarations => New_List (Decl), + Declarations => New_List (Decl), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => Stats))); @@ -3078,10 +3080,12 @@ package body Exp_Ch5 is -- For both iterator forms, add a call to the step operation to -- advance the cursor. Generate: - -- - -- Cursor := Iterator.Next (Cursor); + + -- Cursor := Iterator.Next (Cursor); + -- or else - -- Cursor := Next (Cursor); + + -- Cursor := Next (Cursor); declare Rhs : Node_Id; @@ -3089,9 +3093,9 @@ package body Exp_Ch5 is begin Rhs := Make_Function_Call (Loc, - Name => + Name => Make_Selected_Component (Loc, - Prefix => New_Reference_To (Iterator, Loc), + Prefix => New_Reference_To (Iterator, Loc), Selector_Name => Make_Identifier (Loc, Name_Step)), Parameter_Associations => New_List ( New_Reference_To (Cursor, Loc))); @@ -3113,7 +3117,7 @@ package body Exp_Ch5 is Make_Iteration_Scheme (Loc, Condition => Make_Function_Call (Loc, - Name => + Name => Make_Selected_Component (Loc, Prefix => New_Occurrence_Of (Pack, Loc), Selector_Name => @@ -3127,7 +3131,7 @@ package body Exp_Ch5 is -- Create the declarations for Iterator and cursor and insert then -- before the source loop. Generate: - -- + -- I : Iterator_Type := Iterate (Container); -- C : Pack.Cursor_Type := Container.[First | Last]; @@ -3146,12 +3150,11 @@ package body Exp_Ch5 is Decl2 := Make_Object_Declaration (Loc, Defining_Identifier => Cursor, - Object_Definition => + Object_Definition => New_Occurrence_Of (Etype (Cursor), Loc), - - Expression => + Expression => Make_Selected_Component (Loc, - Prefix => New_Reference_To (Iterator, Loc), + Prefix => New_Reference_To (Iterator, Loc), Selector_Name => Make_Identifier (Loc, Name_Init))); |