summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch3.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-28 08:46:39 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-28 08:46:39 +0000
commitd215f619b3633b756b36e9f31b2f786844e08463 (patch)
treecd9ef3438c64c9d0d618df9a367d8d3ff506ca25 /gcc/ada/exp_ch3.adb
parentb2738a24942ace51f50c6f1257225c9845677906 (diff)
downloadgcc-d215f619b3633b756b36e9f31b2f786844e08463.tar.gz
2009-07-28 Javier Miranda <miranda@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable generation of SCIL nodes if we are not generating code. * frontend.adb (Check_SCIL_Node): New subprogram. Used to check attribute SCIL_Related_Node of SCIL dispatching nodes. (Check_SCIL_Nodes): New instantiation of Traverse_Proc. * sinfo.ads (Is_SCIL_Node,Set_Is_SCIL_Node): Removed (SCIL_Nkind,Set_SCIL_Nkind): Removed. (SCIL_Entity): Update documentation. (SCIL_Related_Node): Update documentation. (SCIL_Controlling_Tag): New attribute. (SCIL_Target_Prim): Update documentation. (N_Null_Statement): Remove attributes associated with SCIL nodes. (N_SCIL_Dispatch_Table_Object_Init): New node. (N_SCIL_Dispatch_Table_Tag_Init): New node. (N_SCIL_Dispatching_Call): New node. (N_SCIL_Tag_Init): New node. * sinfo.adb (Is_SCIL_Node,Set_Is_SCIL_Node): Removed (SCIL_Nkind,Set_SCIL_Nkind): Removed. (SCIL_Controlling_Tag/Set_SCIL_Controlling_Tag): New subprogram. (SCIL_Entity,Set_SCIL_Entity): Applicable only to SCIL nodes. (SCIL_Related_Node,Set_SCIL_Related_Node): Applicable only to SCIL nodes (SCIL_Target_Prim,Set_SCIL_Target_Prim): Applicable only to N_SCIL_Dispatching_Call nodes. * sem.adb (Analyze): No need to analyze SCIL nodes. * sem_aux.ads, sem_aux.adb (First_Non_SCIL_Node): New subprogram (Next_Non_SCIL_Node): New subprogram * sem_ch4.adb (Analyze_Type_Conversion): Adjust relocated SCIL dispatching nodes. * sem_ch5.adb (Analyze_Iteration_Scheme): Adjust relocated SCIL dispatching node. * sem_util.adb (Insert_Explicit_Dereference): Adjust relocated SCIL dispatching node. * exp_ch3.adb (Build_Array_Init_Proc): Skip SCIL nodes when processing null statement nodes. (Build_Init_Procedure): Generate new SCIL node. * exp_ch4.adb (Expand_N_And_Then): Adjust relocated SCIL dispatching node. * exp_ch6.adb (Is_Null_Procedure): Skip SCIL nodes. Required because they are currently implemented as special N_Null_Statement nodes. * exp_ch7.adb (Wrap_Transient_Statement): If the relocated node is a procedure call then check if some SCIL node references it and needs readjustment. * exp_disp.ads (SCIL_Node_Kind): Removed. (Adjust_SCIL_Node): New subprogram. (Find_SCIL_Node): New subprogram. (Get_SCIL_Node_Kind): Removed. (New_SCIL_Node): Removed. * exp_disp.adb (Adjust_SCIL_Node): New subprogram (Expand_Dispatching_Call): Generate new SCIL dispatching node including decoration of its new controlling_tag attribute. (Get_SCIL_Node_Kind): Removed. (Find_SCIL_Node): New subprogram. (Make_Secondary_DT): Generate new SCIL nodes. (Make_Tags): Generate new SCIL nodes. (New_SCIL_Node): Removed. * exp_util.adb (Insert_Actions): Handle SCIL nodes. (Remove_Side_Effects): Check if relocated nodes require readjustment of some SCIL dispatching node. * gcc-interface/trans.c (gnat_to_gnu): Do nothing with new SCIL nodes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150149 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch3.adb')
-rw-r--r--gcc/ada/exp_ch3.adb30
1 files changed, 22 insertions, 8 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index e8b46e55e60..4ff1f3e12da 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -752,7 +752,11 @@ package body Exp_Ch3 is
Set_Init_Proc (A_Type, Proc_Id);
if List_Length (Body_Stmts) = 1
- and then Nkind (First (Body_Stmts)) = N_Null_Statement
+
+ -- We must skip SCIL nodes because they may have been added to this
+ -- list by Insert_Actions.
+
+ and then Nkind (First_Non_SCIL_Node (Body_Stmts)) = N_Null_Statement
then
Set_Is_Null_Init_Proc (Proc_Id);
@@ -763,7 +767,7 @@ package body Exp_Ch3 is
Set_Static_Initialization
(Proc_Id,
- Build_Equivalent_Array_Aggregate (First_Subtype (A_Type)));
+ Build_Equivalent_Array_Aggregate (First_Subtype (A_Type)));
end if;
end if;
end Build_Array_Init_Proc;
@@ -1939,6 +1943,7 @@ package body Exp_Ch3 is
D := First_Discriminant (Rec_Type);
while Present (D) loop
+
-- Don't generate the assignment for discriminants in derived
-- tagged types if the discriminant is a renaming of some
-- ancestor discriminant. This initialization will be done
@@ -2330,11 +2335,16 @@ package body Exp_Ch3 is
-- the tag component.
if Generate_SCIL then
- Prepend_To (Init_Tags_List,
- New_SCIL_Node
- (SN_Kind => IP_Tag_Init,
- Related_Node => First (Init_Tags_List),
- Entity => Rec_Type));
+ declare
+ New_Node : Node_Id;
+
+ begin
+ New_Node :=
+ Make_SCIL_Tag_Init (Sloc (First (Init_Tags_List)));
+ Set_SCIL_Related_Node (New_Node, First (Init_Tags_List));
+ Set_SCIL_Entity (New_Node, Rec_Type);
+ Prepend_To (Init_Tags_List, New_Node);
+ end;
end if;
-- Ada 2005 (AI-251): Initialize the secondary tags components
@@ -2496,7 +2506,11 @@ package body Exp_Ch3 is
Set_Init_Proc (Rec_Type, Proc_Id);
if List_Length (Body_Stmts) = 1
- and then Nkind (First (Body_Stmts)) = N_Null_Statement
+
+ -- We must skip SCIL nodes because they are currently implemented
+ -- as special N_Null_Statement nodes.
+
+ and then Nkind (First_Non_SCIL_Node (Body_Stmts)) = N_Null_Statement
and then VM_Target = No_VM
then
-- Even though the init proc may be null at this time it might get