summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_aggr.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/exp_aggr.adb')
-rw-r--r--gcc/ada/exp_aggr.adb32
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,