diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-17 10:07:53 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-17 10:07:53 +0000 |
commit | 46eb69332c219e14627045d980a4f477b8d99390 (patch) | |
tree | 78b8c08b9aee1c03704dc2114f549be155153994 /gcc/ada/exp_aggr.adb | |
parent | 67278d605ddd4afb9b6225ebfa8ddc51688e2f97 (diff) | |
download | gcc-46eb69332c219e14627045d980a4f477b8d99390.tar.gz |
2010-06-17 Robert Dewar <dewar@adacore.com>
* checks.adb, exp_aggr.adb, exp_atag.adb, exp_attr.adb, exp_ch11.adb,
exp_ch3.adb, exp_ch4.adb: Minor code reorganization.
Use Make_Temporary.
* tbuild.ads, tbuild.adb (Make_Temporary): Clean up, use Entity_Id
instead of Node_Id.
(Make_Temporary): Add more extensive documentation
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160893 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_aggr.adb')
-rw-r--r-- | gcc/ada/exp_aggr.adb | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index dc6c8bb90d0..a2c54911bb6 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -1347,7 +1347,7 @@ package body Exp_Aggr is -- Otherwise construct the loop, starting with the loop index L_J - L_J := Make_Defining_Identifier (Loc, New_Internal_Name ('J')); + L_J := Make_Temporary (Loc, 'J', L); -- Construct "L .. H" in Index_Base. We use a qualified expression -- for the bound to convert to the index base, but we don't need @@ -1455,7 +1455,7 @@ package body Exp_Aggr is -- Build the decl of W_J - W_J := Make_Defining_Identifier (Loc, New_Internal_Name ('J')); + W_J := Make_Temporary (Loc, 'J', L); W_Decl := Make_Object_Declaration (Loc, @@ -3008,9 +3008,7 @@ package body Exp_Aggr is -- the corresponding aggregate. declare - SubE : constant Entity_Id := - Make_Defining_Identifier (Loc, - Chars => New_Internal_Name ('T')); + SubE : constant Entity_Id := Make_Temporary (Loc, 'T'); SubD : constant Node_Id := Make_Subtype_Declaration (Loc, @@ -4139,7 +4137,7 @@ package body Exp_Aggr is procedure Build_Constrained_Type (Positional : Boolean) is Loc : constant Source_Ptr := Sloc (N); - Agg_Type : Entity_Id; + Agg_Type : constant Entity_Id := Make_Temporary (Loc, 'A'); Comp : Node_Id; Decl : Node_Id; Typ : constant Entity_Id := Etype (N); @@ -4148,10 +4146,6 @@ package body Exp_Aggr is Sub_Agg : Node_Id; begin - Agg_Type := - Make_Defining_Identifier ( - Loc, New_Internal_Name ('A')); - -- If the aggregate is purely positional, all its subaggregates -- have the same size. We collect the dimensions from the first -- subaggregate at each level. @@ -4169,19 +4163,16 @@ package body Exp_Aggr is Next (Comp); end loop; - Append ( + Append_To (Indices, Make_Range (Loc, - Low_Bound => Make_Integer_Literal (Loc, 1), - High_Bound => - Make_Integer_Literal (Loc, Num)), - Indices); + Low_Bound => Make_Integer_Literal (Loc, 1), + High_Bound => Make_Integer_Literal (Loc, Num))); end loop; else -- We know the aggregate type is unconstrained and the aggregate -- is not processable by the back end, therefore not necessarily -- positional. Retrieve each dimension bounds (computed earlier). - -- earlier. for D in 1 .. Number_Dimensions (Typ) loop Append ( @@ -5693,9 +5684,7 @@ package body Exp_Aggr is Decl := Make_Subtype_Declaration (Loc, - Defining_Identifier => - Make_Defining_Identifier (Loc, - New_Internal_Name ('T')), + Defining_Identifier => Make_Temporary (Loc, 'T'), Subtype_Indication => Make_Subtype_Indication (Loc, Subtype_Mark => @@ -6384,9 +6373,8 @@ package body Exp_Aggr is and then Nkind (First (Choices (First (Component_Associations (N))))) = N_Others_Choice then - Expr := - Expression (First (Component_Associations (N))); - L_J := Make_Defining_Identifier (Loc, New_Internal_Name ('J')); + Expr := Expression (First (Component_Associations (N))); + L_J := Make_Temporary (Loc, 'J'); L_Iter := Make_Iteration_Scheme (Loc, |