summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 09:14:04 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 09:14:04 +0000
commit2b4d755574eabfd23a5bd5a49f2d78d157e4824c (patch)
tree74c14ff78cae4b78f867d2b3c54dd6dade631222 /gcc/ada/exp_ch4.adb
parent57995f4414e60fb8f29ff5f1ed50a9cfd7c08457 (diff)
downloadgcc-2b4d755574eabfd23a5bd5a49f2d78d157e4824c.tar.gz
2009-04-20 Robert Dewar <dewar@adacore.com>
* s-conca5.adb, s-conca5.ads, s-conca7.adb, s-conca7.ads, s-conca9.adb, s-conca9.ads, rtsfind.ads, s-conca2.adb, s-conca2.ads, s-conca4.adb, s-conca4.ads, s-conca6.adb, s-conca6.ads, s-conca8.adb, s-conca8.ads, s-conca3.adb, s-conca3.ads (Str_Concat_Bounds_x): New functions. * exp_ch4.adb (Expand_Concatenate): Minor code reorganization 2009-04-20 Pascal Obry <obry@adacore.com> * initialize.c (__gnat_initialize): Add braces to kill warning. * adaint.c: Minor reformatting, untabify, remove trailing spaces. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146379 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb33
1 files changed, 20 insertions, 13 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index ef4dbc51989..19dbf7aa77f 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -2239,6 +2239,14 @@ package body Exp_Ch4 is
Result : Node_Id;
-- Result of the concatenation (of type Ityp)
+ Actions : constant List_Id := New_List;
+ -- Collect actions to be inserted if Save_Space is False
+
+ Save_Space : Boolean;
+ pragma Warnings (Off, Save_Space);
+ -- Set to True if we are saving generated code space by calling routines
+ -- in packages System.Concat_n.
+
Known_Non_Null_Operand_Seen : Boolean;
-- Set True during generation of the assignements of operands into
-- result once an operand known to be non-null has been seen.
@@ -2552,7 +2560,7 @@ package body Exp_Ch4 is
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('L'));
- Insert_Action (Cnode,
+ Append_To (Actions,
Make_Object_Declaration (Loc,
Defining_Identifier => Var_Length (NN),
Constant_Present => True,
@@ -2564,9 +2572,7 @@ package body Exp_Ch4 is
Make_Attribute_Reference (Loc,
Prefix =>
Duplicate_Subexpr (Opnd, Name_Req => True),
- Attribute_Name => Name_Length)),
-
- Suppress => All_Checks);
+ Attribute_Name => Name_Length)));
end if;
end if;
@@ -2595,8 +2601,8 @@ package body Exp_Ch4 is
Make_Integer_Literal (Loc,
Intval => Fixed_Length (NN) + Intval (Aggr_Length (NN - 1)));
- -- All other cases, construct an addition node for the length and
- -- create an entity initialized to this length.
+ -- All other cases, construct an addition node for the length and
+ -- create an entity initialized to this length.
else
Ent :=
@@ -2609,7 +2615,7 @@ package body Exp_Ch4 is
Clen := New_Reference_To (Var_Length (NN), Loc);
end if;
- Insert_Action (Cnode,
+ Append_To (Actions,
Make_Object_Declaration (Loc,
Defining_Identifier => Ent,
Constant_Present => True,
@@ -2620,9 +2626,7 @@ package body Exp_Ch4 is
Expression =>
Make_Op_Add (Loc,
Left_Opnd => New_Copy (Aggr_Length (NN - 1)),
- Right_Opnd => Clen)),
-
- Suppress => All_Checks);
+ Right_Opnd => Clen)));
Aggr_Length (NN) := Make_Identifier (Loc, Chars => Chars (Ent));
end if;
@@ -2724,13 +2728,12 @@ package body Exp_Ch4 is
Ent :=
Make_Defining_Identifier (Loc, Chars => New_Internal_Name ('L'));
- Insert_Action (Cnode,
+ Append_To (Actions,
Make_Object_Declaration (Loc,
Defining_Identifier => Ent,
Constant_Present => True,
Object_Definition => New_Occurrence_Of (Ityp, Loc),
- Expression => Get_Known_Bound (1)),
- Suppress => All_Checks);
+ Expression => Get_Known_Bound (1)));
Low_Bound := New_Reference_To (Ent, Loc);
end;
@@ -2773,6 +2776,10 @@ package body Exp_Ch4 is
High_Bound));
end if;
+ -- Here is where we insert the saved up actions
+
+ Insert_Actions (Cnode, Actions, Suppress => All_Checks);
+
-- Now we construct an array object with appropriate bounds
Ent :=