diff options
author | Javier Miranda <miranda@adacore.com> | 2009-07-28 08:46:39 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-07-28 10:46:39 +0200 |
commit | 327503f14780f4c9e8ee3ea4675abd0935761c79 (patch) | |
tree | cd9ef3438c64c9d0d618df9a367d8d3ff506ca25 /gcc/ada/frontend.adb | |
parent | b125fe15d745572a8fbcde73996bf82037130253 (diff) | |
download | gcc-327503f14780f4c9e8ee3ea4675abd0935761c79.zip gcc-327503f14780f4c9e8ee3ea4675abd0935761c79.tar.gz gcc-327503f14780f4c9e8ee3ea4675abd0935761c79.tar.bz2 |
gnat1drv.adb (Adjust_Global_Switches): Disable generation of SCIL nodes if we are not generating code.
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.
From-SVN: r150149
Diffstat (limited to 'gcc/ada/frontend.adb')
-rw-r--r-- | gcc/ada/frontend.adb | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb index 7109383..00eb5ca 100644 --- a/gcc/ada/frontend.adb +++ b/gcc/ada/frontend.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -63,6 +63,40 @@ with Tbuild; use Tbuild; with Types; use Types; procedure Frontend is + + -- Comment: I think SCIL processing is gettings scattered too much, this + -- is a good case, why should the top level frontend driver be doing stuff + -- at this level, seems wrong to me. I think we should introduce a new + -- unit Sem_SCIL, and move a lot of this SCIL stuff there. ??? + + function Check_SCIL_Node (N : Node_Id) return Traverse_Result; + -- Process a single node during the tree traversal, verifying that field + -- SCIL_Related_Node of SCIL dispatching call nodes reference subprogram + -- calls. + + procedure Check_SCIL_Nodes is new Traverse_Proc (Check_SCIL_Node); + -- The traversal procedure itself + + --------------------- + -- Check_SCIL_Node -- + --------------------- + + function Check_SCIL_Node (N : Node_Id) return Traverse_Result is + begin + if Nkind (N) = N_SCIL_Dispatching_Call then + if not Nkind_In (SCIL_Related_Node (N), N_Function_Call, + N_Procedure_Call_Statement) + then + pragma Assert (False); + raise Program_Error; + end if; + + return Skip; + else + return OK; + end if; + end Check_SCIL_Node; + Config_Pragmas : List_Id; -- Gather configuration pragmas @@ -366,6 +400,13 @@ begin Exp_Dbug.Qualify_All_Entity_Names; end if; + -- SCIL backend requirement. Check that SCIL nodes associated with + -- dispatching calls reference subprogram calls. + + if Generate_SCIL then + Check_SCIL_Nodes (Cunit (Main_Unit)); + end if; + -- Dump the source now. Note that we do this as soon as the analysis -- of the tree is complete, because it is not just a dump in the case -- of -gnatD, where it rewrites all source locations in the tree. |