gcc/gcc/ada/exp_sel.ads

124 lines
4.8 KiB
Ada
Raw Normal View History

a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates... 2005-12-05 Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates code that uses this subprogram. (Set_Interface_Table): Add missing assertion. Update documentation describing the run-time structure. (Displace): New subprogram that displaces the pointer to the object to reference one of its secondary dispatch tables. (IW_Membership): Modified to use the new table of interfaces. (Inherit_TSD): Modified to use the new table of interfaces. (Register_Interface_Tag): Use the additional formal to fill the contents of the new table of interfaces. (Set_Interface_Table): New subprogram that stores in the TSD the pointer to the table of interfaces. (Set_Offset_To_Top): Use the additional formal to save copy of the offset value in the table of interfaces. Update structure of GNAT Primary and Secondary dispatch table diagram. Add comment section on GNAT dispatch table prologue. (Offset_To_Signature): Update the constant value of the Signature field. (Dispatch_Table): Update comment on hidden fields in the prologue. (Get_Entry_Index, Get_Prim_Op_Kind, Get_Offset_Index, OSD, Set_Entry_Index, Set_Offset_Index, Set_Prim_Op_Kind, SSD, TSD): Change the type of formal parameter T to Tag, introduce additional assertions. (Get_Num_Prim_Ops, Set_Num_Prim_Ops): Remove an unnecessary type conversion. (Get_Tagged_Kind, Set_Tagged_Kind): New bodies. * exp_ch6.adb (Register_Interface_DT_Entry): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. Instead of referencing the record component containing the tag of the secondary dispatch table we have to use the Offset_To_Top run-time function to get this information; otherwise if the pointer to the base of the object has been displace we get a wrong value if we use the 'position attribute. * exp_disp.adb (Expand_Interface_Thunk): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. (Make_Secondary_DT): Secondary dispatch tables do not have a table of interfaces; hence the call to Set_Interface_Table was clearly wrong. (Collect_All_Interfaces): Modify the internal subprogram Collect to ensure that the interfaces implemented by the ancestors are placed at the header of the generated list. (Expand_Interface_Conversion): Handle the case in which the displacement associated with the interface conversion is not statically known. In this case we generate a call to the new run-time subprogram Displace. (Make_DT): Generate and fill the new table of interfaces. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Add entries for Get_Tagged_Kind and Set_Tagged_Kind. (Tagged_Kind): New function that determines the tagged kind of a type with respect to limitedness and concurrency and returns a reference to RE_Tagged_Kind. (Make_Disp_Asynchronous_Select_Body, Make_Disp_Conditional_Select_Body, Make_Disp_Timed_Select_Body): Correctly retrieve the pointer to the primary dispatch table for a type. (Make_DT, Make_Secondary_DT): Set the tagged kind in the primary and secondary dispatch table respectively of a tagged type. * exp_disp.ads (Expand_Interface_Thunk): Remove Thunk_Id formal. (Expand_Interface_Conversion): New subprogram to indicate if the displacement of the type conversion is statically known. (DT_Access_Action): Add values Get_Tagged_Kind and Set_Tagged_Kind. * rtsfind.ads (RE_Offset_To_Top): New entity (RTU_Id): Add Ada_Task_Termination to the list so that it is made accessible to users. (Re_Displace): New entity (RE_Interface_Data): New entity (RE_Set_Interface_Data): New_Entity (RE_Id, RE_Unit_Table): Add entry for RE_Get_Tagged_Kind, Set_Tagged_Kind, RE_Tagged_Kind, RE_TK_Abstract_Limited_Tagged, RE_TK_Abstract_Tagged, RE_TK_Limited_Tagged, RE_TK_Protected, RE_TK_Tagged, RE_TK_Task. * exp_ch3.adb (Init_Secondary_Tags): Modify the subprogram Init_Secondary_Tags_Internal to allow its use with interface types and also to generate the code for the new additional actual required by Set_Offset_To_Top. (Build_Init_Statements): In case of components associated with abstract interface types there is no need to generate a call to its IP. (Freeze_Record_Type): Generate Select Specific Data tables only for concurrent types. (Make_Predefined_Primitive_Specs, Predefined_Primitive_Bodies): Generate the bodies and specifications of the predefined primitive operations dealing with dispatching selects and abort, 'Callable, 'Terminated only for concurrent types. * exp_sel.ads, exp_sel.adb: New files. * exp_ch9.adb (Build_Protected_Entry, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Make_Initialize_Protection): Handle properly protected objects and attach handler in the case of the restricted profile. Move embeded package Select_Expansion_Utilities into a separate external package. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Select, Expand_N_Timed_Entry_Call): Correct calls external package Exp_Sel. (Build_K, Build_S_Assignment): New subprograms, part of the select expansion utilities. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Entry_Call, Expand_N_Timed_Entry_Call): Optimize expansion of select statements where the trigger is a dispatching procedure of a limited tagged type. From-SVN: r108284
2005-12-09 18:13:28 +01:00
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ S E L --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates... 2005-12-05 Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates code that uses this subprogram. (Set_Interface_Table): Add missing assertion. Update documentation describing the run-time structure. (Displace): New subprogram that displaces the pointer to the object to reference one of its secondary dispatch tables. (IW_Membership): Modified to use the new table of interfaces. (Inherit_TSD): Modified to use the new table of interfaces. (Register_Interface_Tag): Use the additional formal to fill the contents of the new table of interfaces. (Set_Interface_Table): New subprogram that stores in the TSD the pointer to the table of interfaces. (Set_Offset_To_Top): Use the additional formal to save copy of the offset value in the table of interfaces. Update structure of GNAT Primary and Secondary dispatch table diagram. Add comment section on GNAT dispatch table prologue. (Offset_To_Signature): Update the constant value of the Signature field. (Dispatch_Table): Update comment on hidden fields in the prologue. (Get_Entry_Index, Get_Prim_Op_Kind, Get_Offset_Index, OSD, Set_Entry_Index, Set_Offset_Index, Set_Prim_Op_Kind, SSD, TSD): Change the type of formal parameter T to Tag, introduce additional assertions. (Get_Num_Prim_Ops, Set_Num_Prim_Ops): Remove an unnecessary type conversion. (Get_Tagged_Kind, Set_Tagged_Kind): New bodies. * exp_ch6.adb (Register_Interface_DT_Entry): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. Instead of referencing the record component containing the tag of the secondary dispatch table we have to use the Offset_To_Top run-time function to get this information; otherwise if the pointer to the base of the object has been displace we get a wrong value if we use the 'position attribute. * exp_disp.adb (Expand_Interface_Thunk): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. (Make_Secondary_DT): Secondary dispatch tables do not have a table of interfaces; hence the call to Set_Interface_Table was clearly wrong. (Collect_All_Interfaces): Modify the internal subprogram Collect to ensure that the interfaces implemented by the ancestors are placed at the header of the generated list. (Expand_Interface_Conversion): Handle the case in which the displacement associated with the interface conversion is not statically known. In this case we generate a call to the new run-time subprogram Displace. (Make_DT): Generate and fill the new table of interfaces. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Add entries for Get_Tagged_Kind and Set_Tagged_Kind. (Tagged_Kind): New function that determines the tagged kind of a type with respect to limitedness and concurrency and returns a reference to RE_Tagged_Kind. (Make_Disp_Asynchronous_Select_Body, Make_Disp_Conditional_Select_Body, Make_Disp_Timed_Select_Body): Correctly retrieve the pointer to the primary dispatch table for a type. (Make_DT, Make_Secondary_DT): Set the tagged kind in the primary and secondary dispatch table respectively of a tagged type. * exp_disp.ads (Expand_Interface_Thunk): Remove Thunk_Id formal. (Expand_Interface_Conversion): New subprogram to indicate if the displacement of the type conversion is statically known. (DT_Access_Action): Add values Get_Tagged_Kind and Set_Tagged_Kind. * rtsfind.ads (RE_Offset_To_Top): New entity (RTU_Id): Add Ada_Task_Termination to the list so that it is made accessible to users. (Re_Displace): New entity (RE_Interface_Data): New entity (RE_Set_Interface_Data): New_Entity (RE_Id, RE_Unit_Table): Add entry for RE_Get_Tagged_Kind, Set_Tagged_Kind, RE_Tagged_Kind, RE_TK_Abstract_Limited_Tagged, RE_TK_Abstract_Tagged, RE_TK_Limited_Tagged, RE_TK_Protected, RE_TK_Tagged, RE_TK_Task. * exp_ch3.adb (Init_Secondary_Tags): Modify the subprogram Init_Secondary_Tags_Internal to allow its use with interface types and also to generate the code for the new additional actual required by Set_Offset_To_Top. (Build_Init_Statements): In case of components associated with abstract interface types there is no need to generate a call to its IP. (Freeze_Record_Type): Generate Select Specific Data tables only for concurrent types. (Make_Predefined_Primitive_Specs, Predefined_Primitive_Bodies): Generate the bodies and specifications of the predefined primitive operations dealing with dispatching selects and abort, 'Callable, 'Terminated only for concurrent types. * exp_sel.ads, exp_sel.adb: New files. * exp_ch9.adb (Build_Protected_Entry, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Make_Initialize_Protection): Handle properly protected objects and attach handler in the case of the restricted profile. Move embeded package Select_Expansion_Utilities into a separate external package. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Select, Expand_N_Timed_Entry_Call): Correct calls external package Exp_Sel. (Build_K, Build_S_Assignment): New subprograms, part of the select expansion utilities. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Entry_Call, Expand_N_Timed_Entry_Call): Optimize expansion of select statements where the trigger is a dispatching procedure of a limited tagged type. From-SVN: r108284
2005-12-09 18:13:28 +01:00
-- --
-- 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- --
exp_atag.ads, [...]: Replace headers with GPL v3 headers. 2007-09-10 Robert Dewar <dewar@adacore.com> * exp_atag.ads, exp_atag.adb, mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb, mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-solaris.adb, mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb, mlib-tgt-mingw.adb, mlib-tgt-vxworks.adb, ali.adb, ali.ads, ali-util.adb, ali-util.ads, atree.h, back_end.adb, back_end.ads, bcheck.adb, bcheck.ads, binde.adb, binde.ads, binderr.adb, binderr.ads, bindgen.adb, bindgen.ads, bindusg.adb, bindusg.ads, butil.adb, butil.ads, checks.adb, checks.ads, clean.adb, clean.ads, comperr.adb, comperr.ads, cstand.adb, cstand.ads, debug_a.adb, debug_a.ads, elists.h, errout.adb, erroutc.ads, errutil.adb, errutil.ads, err_vars.ads, eval_fat.adb, eval_fat.ads, exp_sel.ads, exp_sel.adb, exp_aggr.adb, exp_aggr.ads, expander.adb, expander.ads, exp_attr.ads, exp_ch10.ads, exp_ch11.adb, exp_ch12.adb, exp_ch12.ads, exp_ch13.adb, exp_ch13.ads, exp_ch2.adb, exp_ch2.ads, exp_ch3.ads, exp_ch4.adb, exp_ch4.ads, exp_ch5.adb, exp_ch5.ads, exp_ch6.adb, exp_ch6.ads, exp_ch7.adb, exp_ch7.ads, exp_ch8.adb, exp_ch8.ads, exp_ch9.adb, exp_ch9.ads, exp_code.adb, exp_code.ads, exp_dbug.adb, exp_dbug.ads, exp_disp.ads, exp_dist.adb, exp_dist.ads, exp_fixd.adb, exp_fixd.ads, exp_imgv.adb, exp_imgv.ads, exp_intr.adb, exp_intr.ads, exp_pakd.adb, exp_pakd.ads, exp_prag.adb, exp_prag.ads, exp_smem.adb, exp_strm.adb, exp_strm.ads, exp_tss.adb, exp_tss.ads, exp_util.adb, exp_util.ads, exp_vfpt.adb, exp_vfpt.ads, fmap.adb, fmap.ads, fname-sf.adb, fname-sf.ads, fname-uf.adb, fname-uf.ads, frontend.adb, frontend.ads, get_targ.adb, get_targ.ads, gnat1drv.adb, gnat1drv.ads, gnatbind.adb, gnatbind.ads, gnatbl.c, gnatchop.adb, gnatclean.adb, gnatcmd.adb, gnatcmd.ads, gnatdll.adb, gnatfind.adb, gnatkr.adb, gnatkr.ads, gnatlbr.adb, gnatlink.adb, gnatlink.ads, gnatls.adb, gnatls.ads, gnatmake.adb, gnatmake.ads, gnatmem.adb, gnatname.adb, gnatname.ads, gnatprep.adb, gnatprep.ads, gnatsym.adb, gnatxref.adb, gprep.adb, gprep.ads, hlo.adb, hlo.ads, impunit.adb, impunit.ads, inline.adb, inline.ads, itypes.adb, itypes.ads, layout.adb, layout.ads, lib-load.adb, lib-load.ads, lib-util.adb, lib-util.ads, lib-writ.adb, lib-writ.ads, lib-xref.adb, lib-xref.ads, live.adb, live.ads, make.adb, make.ads, makeutl.ads, makeutl.adb, makeusg.adb, makeusg.ads, mdll.adb, mdll.ads, mdll-fil.adb, mdll-fil.ads, mdll-utl.adb, mdll-utl.ads, memroot.adb, memroot.ads, mlib.adb, mlib.ads, mlib-fil.adb, mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads, mlib-utl.adb, mlib-utl.ads, namet.h, nmake.adt, osint.adb, osint.ads, osint-b.adb, osint-b.ads, osint-c.adb, osint-c.ads, osint-l.adb, osint-l.ads, osint-m.adb, osint-m.ads, par.adb, par.ads, par-ch10.adb, par-ch11.adb, par-ch12.adb, par-ch13.adb, par-ch2.adb, par-ch3.adb, par-ch4.adb, par-ch5.adb, par-ch6.adb, par-ch7.adb, par-ch8.adb, par-ch9.adb, par-endh.adb, par-labl.adb, par-load.adb, par-prag.adb, par-sync.adb, par-tchk.adb, par-util.adb, prep.adb, prep.ads, prepcomp.adb, prepcomp.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads, prj-com.ads, prj-dect.adb, prj-dect.ads, prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb, prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads, prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb, prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads, prj-util.adb, prj-util.ads, restrict.adb, restrict.ads, rtsfind.adb, rtsfind.ads, scn.adb, scn.ads, scng.adb, scng.ads, sdefault.ads, sem.ads, sem_aggr.ads, sem_attr.adb, sem_case.adb, sem_case.ads, sem_cat.adb, sem_cat.ads, sem_ch10.adb, sem_ch10.ads, sem_ch11.adb, sem_ch11.ads, sem_ch12.ads, sem_ch13.adb, sem_ch13.ads, sem_ch2.adb, sem_ch2.ads, sem_ch3.adb, sem_ch3.ads, sem_ch4.ads, sem_ch5.adb, sem_ch5.ads, sem_ch6.adb, sem_ch6.ads, sem_ch7.adb, sem_ch7.ads, sem_ch8.adb, sem_ch8.ads, sem_ch9.adb, sem_ch9.ads, sem_disp.adb, sem_disp.ads, sem_dist.adb, sem_dist.ads, sem_elab.adb, sem_elab.ads, sem_elim.adb, sem_elim.ads, sem_eval.adb, sem_eval.ads, sem_intr.adb, sem_intr.ads, sem_maps.adb, sem_maps.ads, sem_mech.adb, sem_mech.ads, sem_prag.adb, sem_prag.ads, sem_res.adb, sem_res.ads, sem_smem.adb, sem_smem.ads, sem_type.adb, sem_type.ads, sem_util.adb, sem_util.ads, sem_vfpt.adb, sem_vfpt.ads, sem_warn.adb, sem_warn.ads, sfn_scan.ads, sinfo-cn.adb, sinfo-cn.ads, sinput-c.adb, sinput-c.ads, sinput-d.adb, sinput-d.ads, sinput-l.adb, sinput-l.ads, sinput-p.adb, sinput-p.ads, snames.h, sprint.adb, sprint.ads, stringt.h, style.ads, styleg.adb, styleg.ads, styleg-c.adb, styleg-c.ads, stylesw.adb, stylesw.ads, switch.adb, switch.ads, switch-b.adb, switch-b.ads, switch-c.adb, switch-c.ads, switch-m.adb, switch-m.ads, symbols.adb, symbols.ads, targparm.adb, tbuild.adb, tbuild.ads, tempdir.adb, tempdir.ads, tree_gen.adb, tree_gen.ads, treepr.adb, treepr.ads, treeprs.adt, ttypef.ads, ttypes.ads, types.h, uintp.h, urealp.h, usage.adb, usage.ads, validsw.adb, validsw.ads, vxaddr2line.adb, xeinfo.adb, xnmake.adb, xref_lib.adb, xref_lib.ads, xr_tabls.adb, xr_tabls.ads, xsinfo.adb, xtreeprs.adb, xsnames.adb, vms_conv.ads, vms_conv.adb, xgnatugn.adb, gprmake.adb, makegpr.ads, makegpr.adb, prj-attr-pm.ads, prj-attr-pm.adb, mlib-tgt-lynxos.adb, mlib-tgt-darwin.adb, symbols-vms.adb, symbols-processing-vms-alpha.adb, symbols-processing-vms-ia64.adb, mlib-tgt-specific.adb, mlib-tgt-specific.ads, mlib-tgt-vms.adb, mlib-tgt-vms.ads: Replace headers with GPL v3 headers. From-SVN: r128332
2007-09-10 14:47:10 +02:00
-- ware Foundation; either version 3, or (at your option) any later ver- --
a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates... 2005-12-05 Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates code that uses this subprogram. (Set_Interface_Table): Add missing assertion. Update documentation describing the run-time structure. (Displace): New subprogram that displaces the pointer to the object to reference one of its secondary dispatch tables. (IW_Membership): Modified to use the new table of interfaces. (Inherit_TSD): Modified to use the new table of interfaces. (Register_Interface_Tag): Use the additional formal to fill the contents of the new table of interfaces. (Set_Interface_Table): New subprogram that stores in the TSD the pointer to the table of interfaces. (Set_Offset_To_Top): Use the additional formal to save copy of the offset value in the table of interfaces. Update structure of GNAT Primary and Secondary dispatch table diagram. Add comment section on GNAT dispatch table prologue. (Offset_To_Signature): Update the constant value of the Signature field. (Dispatch_Table): Update comment on hidden fields in the prologue. (Get_Entry_Index, Get_Prim_Op_Kind, Get_Offset_Index, OSD, Set_Entry_Index, Set_Offset_Index, Set_Prim_Op_Kind, SSD, TSD): Change the type of formal parameter T to Tag, introduce additional assertions. (Get_Num_Prim_Ops, Set_Num_Prim_Ops): Remove an unnecessary type conversion. (Get_Tagged_Kind, Set_Tagged_Kind): New bodies. * exp_ch6.adb (Register_Interface_DT_Entry): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. Instead of referencing the record component containing the tag of the secondary dispatch table we have to use the Offset_To_Top run-time function to get this information; otherwise if the pointer to the base of the object has been displace we get a wrong value if we use the 'position attribute. * exp_disp.adb (Expand_Interface_Thunk): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. (Make_Secondary_DT): Secondary dispatch tables do not have a table of interfaces; hence the call to Set_Interface_Table was clearly wrong. (Collect_All_Interfaces): Modify the internal subprogram Collect to ensure that the interfaces implemented by the ancestors are placed at the header of the generated list. (Expand_Interface_Conversion): Handle the case in which the displacement associated with the interface conversion is not statically known. In this case we generate a call to the new run-time subprogram Displace. (Make_DT): Generate and fill the new table of interfaces. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Add entries for Get_Tagged_Kind and Set_Tagged_Kind. (Tagged_Kind): New function that determines the tagged kind of a type with respect to limitedness and concurrency and returns a reference to RE_Tagged_Kind. (Make_Disp_Asynchronous_Select_Body, Make_Disp_Conditional_Select_Body, Make_Disp_Timed_Select_Body): Correctly retrieve the pointer to the primary dispatch table for a type. (Make_DT, Make_Secondary_DT): Set the tagged kind in the primary and secondary dispatch table respectively of a tagged type. * exp_disp.ads (Expand_Interface_Thunk): Remove Thunk_Id formal. (Expand_Interface_Conversion): New subprogram to indicate if the displacement of the type conversion is statically known. (DT_Access_Action): Add values Get_Tagged_Kind and Set_Tagged_Kind. * rtsfind.ads (RE_Offset_To_Top): New entity (RTU_Id): Add Ada_Task_Termination to the list so that it is made accessible to users. (Re_Displace): New entity (RE_Interface_Data): New entity (RE_Set_Interface_Data): New_Entity (RE_Id, RE_Unit_Table): Add entry for RE_Get_Tagged_Kind, Set_Tagged_Kind, RE_Tagged_Kind, RE_TK_Abstract_Limited_Tagged, RE_TK_Abstract_Tagged, RE_TK_Limited_Tagged, RE_TK_Protected, RE_TK_Tagged, RE_TK_Task. * exp_ch3.adb (Init_Secondary_Tags): Modify the subprogram Init_Secondary_Tags_Internal to allow its use with interface types and also to generate the code for the new additional actual required by Set_Offset_To_Top. (Build_Init_Statements): In case of components associated with abstract interface types there is no need to generate a call to its IP. (Freeze_Record_Type): Generate Select Specific Data tables only for concurrent types. (Make_Predefined_Primitive_Specs, Predefined_Primitive_Bodies): Generate the bodies and specifications of the predefined primitive operations dealing with dispatching selects and abort, 'Callable, 'Terminated only for concurrent types. * exp_sel.ads, exp_sel.adb: New files. * exp_ch9.adb (Build_Protected_Entry, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Make_Initialize_Protection): Handle properly protected objects and attach handler in the case of the restricted profile. Move embeded package Select_Expansion_Utilities into a separate external package. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Select, Expand_N_Timed_Entry_Call): Correct calls external package Exp_Sel. (Build_K, Build_S_Assignment): New subprograms, part of the select expansion utilities. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Entry_Call, Expand_N_Timed_Entry_Call): Optimize expansion of select statements where the trigger is a dispatching procedure of a limited tagged type. From-SVN: r108284
2005-12-09 18:13:28 +01:00
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
exp_atag.ads, [...]: Replace headers with GPL v3 headers. 2007-09-10 Robert Dewar <dewar@adacore.com> * exp_atag.ads, exp_atag.adb, mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb, mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-solaris.adb, mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb, mlib-tgt-mingw.adb, mlib-tgt-vxworks.adb, ali.adb, ali.ads, ali-util.adb, ali-util.ads, atree.h, back_end.adb, back_end.ads, bcheck.adb, bcheck.ads, binde.adb, binde.ads, binderr.adb, binderr.ads, bindgen.adb, bindgen.ads, bindusg.adb, bindusg.ads, butil.adb, butil.ads, checks.adb, checks.ads, clean.adb, clean.ads, comperr.adb, comperr.ads, cstand.adb, cstand.ads, debug_a.adb, debug_a.ads, elists.h, errout.adb, erroutc.ads, errutil.adb, errutil.ads, err_vars.ads, eval_fat.adb, eval_fat.ads, exp_sel.ads, exp_sel.adb, exp_aggr.adb, exp_aggr.ads, expander.adb, expander.ads, exp_attr.ads, exp_ch10.ads, exp_ch11.adb, exp_ch12.adb, exp_ch12.ads, exp_ch13.adb, exp_ch13.ads, exp_ch2.adb, exp_ch2.ads, exp_ch3.ads, exp_ch4.adb, exp_ch4.ads, exp_ch5.adb, exp_ch5.ads, exp_ch6.adb, exp_ch6.ads, exp_ch7.adb, exp_ch7.ads, exp_ch8.adb, exp_ch8.ads, exp_ch9.adb, exp_ch9.ads, exp_code.adb, exp_code.ads, exp_dbug.adb, exp_dbug.ads, exp_disp.ads, exp_dist.adb, exp_dist.ads, exp_fixd.adb, exp_fixd.ads, exp_imgv.adb, exp_imgv.ads, exp_intr.adb, exp_intr.ads, exp_pakd.adb, exp_pakd.ads, exp_prag.adb, exp_prag.ads, exp_smem.adb, exp_strm.adb, exp_strm.ads, exp_tss.adb, exp_tss.ads, exp_util.adb, exp_util.ads, exp_vfpt.adb, exp_vfpt.ads, fmap.adb, fmap.ads, fname-sf.adb, fname-sf.ads, fname-uf.adb, fname-uf.ads, frontend.adb, frontend.ads, get_targ.adb, get_targ.ads, gnat1drv.adb, gnat1drv.ads, gnatbind.adb, gnatbind.ads, gnatbl.c, gnatchop.adb, gnatclean.adb, gnatcmd.adb, gnatcmd.ads, gnatdll.adb, gnatfind.adb, gnatkr.adb, gnatkr.ads, gnatlbr.adb, gnatlink.adb, gnatlink.ads, gnatls.adb, gnatls.ads, gnatmake.adb, gnatmake.ads, gnatmem.adb, gnatname.adb, gnatname.ads, gnatprep.adb, gnatprep.ads, gnatsym.adb, gnatxref.adb, gprep.adb, gprep.ads, hlo.adb, hlo.ads, impunit.adb, impunit.ads, inline.adb, inline.ads, itypes.adb, itypes.ads, layout.adb, layout.ads, lib-load.adb, lib-load.ads, lib-util.adb, lib-util.ads, lib-writ.adb, lib-writ.ads, lib-xref.adb, lib-xref.ads, live.adb, live.ads, make.adb, make.ads, makeutl.ads, makeutl.adb, makeusg.adb, makeusg.ads, mdll.adb, mdll.ads, mdll-fil.adb, mdll-fil.ads, mdll-utl.adb, mdll-utl.ads, memroot.adb, memroot.ads, mlib.adb, mlib.ads, mlib-fil.adb, mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads, mlib-utl.adb, mlib-utl.ads, namet.h, nmake.adt, osint.adb, osint.ads, osint-b.adb, osint-b.ads, osint-c.adb, osint-c.ads, osint-l.adb, osint-l.ads, osint-m.adb, osint-m.ads, par.adb, par.ads, par-ch10.adb, par-ch11.adb, par-ch12.adb, par-ch13.adb, par-ch2.adb, par-ch3.adb, par-ch4.adb, par-ch5.adb, par-ch6.adb, par-ch7.adb, par-ch8.adb, par-ch9.adb, par-endh.adb, par-labl.adb, par-load.adb, par-prag.adb, par-sync.adb, par-tchk.adb, par-util.adb, prep.adb, prep.ads, prepcomp.adb, prepcomp.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads, prj-com.ads, prj-dect.adb, prj-dect.ads, prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb, prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads, prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb, prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads, prj-util.adb, prj-util.ads, restrict.adb, restrict.ads, rtsfind.adb, rtsfind.ads, scn.adb, scn.ads, scng.adb, scng.ads, sdefault.ads, sem.ads, sem_aggr.ads, sem_attr.adb, sem_case.adb, sem_case.ads, sem_cat.adb, sem_cat.ads, sem_ch10.adb, sem_ch10.ads, sem_ch11.adb, sem_ch11.ads, sem_ch12.ads, sem_ch13.adb, sem_ch13.ads, sem_ch2.adb, sem_ch2.ads, sem_ch3.adb, sem_ch3.ads, sem_ch4.ads, sem_ch5.adb, sem_ch5.ads, sem_ch6.adb, sem_ch6.ads, sem_ch7.adb, sem_ch7.ads, sem_ch8.adb, sem_ch8.ads, sem_ch9.adb, sem_ch9.ads, sem_disp.adb, sem_disp.ads, sem_dist.adb, sem_dist.ads, sem_elab.adb, sem_elab.ads, sem_elim.adb, sem_elim.ads, sem_eval.adb, sem_eval.ads, sem_intr.adb, sem_intr.ads, sem_maps.adb, sem_maps.ads, sem_mech.adb, sem_mech.ads, sem_prag.adb, sem_prag.ads, sem_res.adb, sem_res.ads, sem_smem.adb, sem_smem.ads, sem_type.adb, sem_type.ads, sem_util.adb, sem_util.ads, sem_vfpt.adb, sem_vfpt.ads, sem_warn.adb, sem_warn.ads, sfn_scan.ads, sinfo-cn.adb, sinfo-cn.ads, sinput-c.adb, sinput-c.ads, sinput-d.adb, sinput-d.ads, sinput-l.adb, sinput-l.ads, sinput-p.adb, sinput-p.ads, snames.h, sprint.adb, sprint.ads, stringt.h, style.ads, styleg.adb, styleg.ads, styleg-c.adb, styleg-c.ads, stylesw.adb, stylesw.ads, switch.adb, switch.ads, switch-b.adb, switch-b.ads, switch-c.adb, switch-c.ads, switch-m.adb, switch-m.ads, symbols.adb, symbols.ads, targparm.adb, tbuild.adb, tbuild.ads, tempdir.adb, tempdir.ads, tree_gen.adb, tree_gen.ads, treepr.adb, treepr.ads, treeprs.adt, ttypef.ads, ttypes.ads, types.h, uintp.h, urealp.h, usage.adb, usage.ads, validsw.adb, validsw.ads, vxaddr2line.adb, xeinfo.adb, xnmake.adb, xref_lib.adb, xref_lib.ads, xr_tabls.adb, xr_tabls.ads, xsinfo.adb, xtreeprs.adb, xsnames.adb, vms_conv.ads, vms_conv.adb, xgnatugn.adb, gprmake.adb, makegpr.ads, makegpr.adb, prj-attr-pm.ads, prj-attr-pm.adb, mlib-tgt-lynxos.adb, mlib-tgt-darwin.adb, symbols-vms.adb, symbols-processing-vms-alpha.adb, symbols-processing-vms-ia64.adb, mlib-tgt-specific.adb, mlib-tgt-specific.ads, mlib-tgt-vms.adb, mlib-tgt-vms.ads: Replace headers with GPL v3 headers. From-SVN: r128332
2007-09-10 14:47:10 +02:00
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates... 2005-12-05 Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates code that uses this subprogram. (Set_Interface_Table): Add missing assertion. Update documentation describing the run-time structure. (Displace): New subprogram that displaces the pointer to the object to reference one of its secondary dispatch tables. (IW_Membership): Modified to use the new table of interfaces. (Inherit_TSD): Modified to use the new table of interfaces. (Register_Interface_Tag): Use the additional formal to fill the contents of the new table of interfaces. (Set_Interface_Table): New subprogram that stores in the TSD the pointer to the table of interfaces. (Set_Offset_To_Top): Use the additional formal to save copy of the offset value in the table of interfaces. Update structure of GNAT Primary and Secondary dispatch table diagram. Add comment section on GNAT dispatch table prologue. (Offset_To_Signature): Update the constant value of the Signature field. (Dispatch_Table): Update comment on hidden fields in the prologue. (Get_Entry_Index, Get_Prim_Op_Kind, Get_Offset_Index, OSD, Set_Entry_Index, Set_Offset_Index, Set_Prim_Op_Kind, SSD, TSD): Change the type of formal parameter T to Tag, introduce additional assertions. (Get_Num_Prim_Ops, Set_Num_Prim_Ops): Remove an unnecessary type conversion. (Get_Tagged_Kind, Set_Tagged_Kind): New bodies. * exp_ch6.adb (Register_Interface_DT_Entry): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. Instead of referencing the record component containing the tag of the secondary dispatch table we have to use the Offset_To_Top run-time function to get this information; otherwise if the pointer to the base of the object has been displace we get a wrong value if we use the 'position attribute. * exp_disp.adb (Expand_Interface_Thunk): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. (Make_Secondary_DT): Secondary dispatch tables do not have a table of interfaces; hence the call to Set_Interface_Table was clearly wrong. (Collect_All_Interfaces): Modify the internal subprogram Collect to ensure that the interfaces implemented by the ancestors are placed at the header of the generated list. (Expand_Interface_Conversion): Handle the case in which the displacement associated with the interface conversion is not statically known. In this case we generate a call to the new run-time subprogram Displace. (Make_DT): Generate and fill the new table of interfaces. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Add entries for Get_Tagged_Kind and Set_Tagged_Kind. (Tagged_Kind): New function that determines the tagged kind of a type with respect to limitedness and concurrency and returns a reference to RE_Tagged_Kind. (Make_Disp_Asynchronous_Select_Body, Make_Disp_Conditional_Select_Body, Make_Disp_Timed_Select_Body): Correctly retrieve the pointer to the primary dispatch table for a type. (Make_DT, Make_Secondary_DT): Set the tagged kind in the primary and secondary dispatch table respectively of a tagged type. * exp_disp.ads (Expand_Interface_Thunk): Remove Thunk_Id formal. (Expand_Interface_Conversion): New subprogram to indicate if the displacement of the type conversion is statically known. (DT_Access_Action): Add values Get_Tagged_Kind and Set_Tagged_Kind. * rtsfind.ads (RE_Offset_To_Top): New entity (RTU_Id): Add Ada_Task_Termination to the list so that it is made accessible to users. (Re_Displace): New entity (RE_Interface_Data): New entity (RE_Set_Interface_Data): New_Entity (RE_Id, RE_Unit_Table): Add entry for RE_Get_Tagged_Kind, Set_Tagged_Kind, RE_Tagged_Kind, RE_TK_Abstract_Limited_Tagged, RE_TK_Abstract_Tagged, RE_TK_Limited_Tagged, RE_TK_Protected, RE_TK_Tagged, RE_TK_Task. * exp_ch3.adb (Init_Secondary_Tags): Modify the subprogram Init_Secondary_Tags_Internal to allow its use with interface types and also to generate the code for the new additional actual required by Set_Offset_To_Top. (Build_Init_Statements): In case of components associated with abstract interface types there is no need to generate a call to its IP. (Freeze_Record_Type): Generate Select Specific Data tables only for concurrent types. (Make_Predefined_Primitive_Specs, Predefined_Primitive_Bodies): Generate the bodies and specifications of the predefined primitive operations dealing with dispatching selects and abort, 'Callable, 'Terminated only for concurrent types. * exp_sel.ads, exp_sel.adb: New files. * exp_ch9.adb (Build_Protected_Entry, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Make_Initialize_Protection): Handle properly protected objects and attach handler in the case of the restricted profile. Move embeded package Select_Expansion_Utilities into a separate external package. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Select, Expand_N_Timed_Entry_Call): Correct calls external package Exp_Sel. (Build_K, Build_S_Assignment): New subprograms, part of the select expansion utilities. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Entry_Call, Expand_N_Timed_Entry_Call): Optimize expansion of select statements where the trigger is a dispatching procedure of a limited tagged type. From-SVN: r108284
2005-12-09 18:13:28 +01:00
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Routines used in Chapter 9 for the expansion of dispatching triggers in
-- select statements (Ada 2005: AI-345)
with Types; use Types;
package Exp_Sel is
function Build_Abort_Block
(Loc : Source_Ptr;
Abr_Blk_Ent : Entity_Id;
Cln_Blk_Ent : Entity_Id;
Blk : Node_Id) return Node_Id;
-- Generate:
-- begin
-- Blk
-- exception
-- when Abort_Signal => Abort_Undefer / null;
a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates... 2005-12-05 Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates code that uses this subprogram. (Set_Interface_Table): Add missing assertion. Update documentation describing the run-time structure. (Displace): New subprogram that displaces the pointer to the object to reference one of its secondary dispatch tables. (IW_Membership): Modified to use the new table of interfaces. (Inherit_TSD): Modified to use the new table of interfaces. (Register_Interface_Tag): Use the additional formal to fill the contents of the new table of interfaces. (Set_Interface_Table): New subprogram that stores in the TSD the pointer to the table of interfaces. (Set_Offset_To_Top): Use the additional formal to save copy of the offset value in the table of interfaces. Update structure of GNAT Primary and Secondary dispatch table diagram. Add comment section on GNAT dispatch table prologue. (Offset_To_Signature): Update the constant value of the Signature field. (Dispatch_Table): Update comment on hidden fields in the prologue. (Get_Entry_Index, Get_Prim_Op_Kind, Get_Offset_Index, OSD, Set_Entry_Index, Set_Offset_Index, Set_Prim_Op_Kind, SSD, TSD): Change the type of formal parameter T to Tag, introduce additional assertions. (Get_Num_Prim_Ops, Set_Num_Prim_Ops): Remove an unnecessary type conversion. (Get_Tagged_Kind, Set_Tagged_Kind): New bodies. * exp_ch6.adb (Register_Interface_DT_Entry): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. Instead of referencing the record component containing the tag of the secondary dispatch table we have to use the Offset_To_Top run-time function to get this information; otherwise if the pointer to the base of the object has been displace we get a wrong value if we use the 'position attribute. * exp_disp.adb (Expand_Interface_Thunk): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. (Make_Secondary_DT): Secondary dispatch tables do not have a table of interfaces; hence the call to Set_Interface_Table was clearly wrong. (Collect_All_Interfaces): Modify the internal subprogram Collect to ensure that the interfaces implemented by the ancestors are placed at the header of the generated list. (Expand_Interface_Conversion): Handle the case in which the displacement associated with the interface conversion is not statically known. In this case we generate a call to the new run-time subprogram Displace. (Make_DT): Generate and fill the new table of interfaces. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Add entries for Get_Tagged_Kind and Set_Tagged_Kind. (Tagged_Kind): New function that determines the tagged kind of a type with respect to limitedness and concurrency and returns a reference to RE_Tagged_Kind. (Make_Disp_Asynchronous_Select_Body, Make_Disp_Conditional_Select_Body, Make_Disp_Timed_Select_Body): Correctly retrieve the pointer to the primary dispatch table for a type. (Make_DT, Make_Secondary_DT): Set the tagged kind in the primary and secondary dispatch table respectively of a tagged type. * exp_disp.ads (Expand_Interface_Thunk): Remove Thunk_Id formal. (Expand_Interface_Conversion): New subprogram to indicate if the displacement of the type conversion is statically known. (DT_Access_Action): Add values Get_Tagged_Kind and Set_Tagged_Kind. * rtsfind.ads (RE_Offset_To_Top): New entity (RTU_Id): Add Ada_Task_Termination to the list so that it is made accessible to users. (Re_Displace): New entity (RE_Interface_Data): New entity (RE_Set_Interface_Data): New_Entity (RE_Id, RE_Unit_Table): Add entry for RE_Get_Tagged_Kind, Set_Tagged_Kind, RE_Tagged_Kind, RE_TK_Abstract_Limited_Tagged, RE_TK_Abstract_Tagged, RE_TK_Limited_Tagged, RE_TK_Protected, RE_TK_Tagged, RE_TK_Task. * exp_ch3.adb (Init_Secondary_Tags): Modify the subprogram Init_Secondary_Tags_Internal to allow its use with interface types and also to generate the code for the new additional actual required by Set_Offset_To_Top. (Build_Init_Statements): In case of components associated with abstract interface types there is no need to generate a call to its IP. (Freeze_Record_Type): Generate Select Specific Data tables only for concurrent types. (Make_Predefined_Primitive_Specs, Predefined_Primitive_Bodies): Generate the bodies and specifications of the predefined primitive operations dealing with dispatching selects and abort, 'Callable, 'Terminated only for concurrent types. * exp_sel.ads, exp_sel.adb: New files. * exp_ch9.adb (Build_Protected_Entry, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Make_Initialize_Protection): Handle properly protected objects and attach handler in the case of the restricted profile. Move embeded package Select_Expansion_Utilities into a separate external package. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Select, Expand_N_Timed_Entry_Call): Correct calls external package Exp_Sel. (Build_K, Build_S_Assignment): New subprograms, part of the select expansion utilities. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Entry_Call, Expand_N_Timed_Entry_Call): Optimize expansion of select statements where the trigger is a dispatching procedure of a limited tagged type. From-SVN: r108284
2005-12-09 18:13:28 +01:00
-- end;
-- Abr_Blk_Ent is the name of the generated block, Cln_Blk_Ent is the name
-- of the encapsulated cleanup block, Blk is the actual block name.
-- The exception handler code is built by Build_Abort_Block_Handler.
function Build_Abort_Block_Handler (Loc : Source_Ptr) return Node_Id;
-- Generate if front-end exception:
-- when others =>
-- Abort_Under;
-- or if back-end exception:
-- when others =>
-- null;
-- This is an exception handler to stop propagation of aborts, without
-- modifying the deferal level.
a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates... 2005-12-05 Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * a-tags.ads, a-tags.adb (Offset_To_Top): Moved from the package body to the specification because the frontend generates code that uses this subprogram. (Set_Interface_Table): Add missing assertion. Update documentation describing the run-time structure. (Displace): New subprogram that displaces the pointer to the object to reference one of its secondary dispatch tables. (IW_Membership): Modified to use the new table of interfaces. (Inherit_TSD): Modified to use the new table of interfaces. (Register_Interface_Tag): Use the additional formal to fill the contents of the new table of interfaces. (Set_Interface_Table): New subprogram that stores in the TSD the pointer to the table of interfaces. (Set_Offset_To_Top): Use the additional formal to save copy of the offset value in the table of interfaces. Update structure of GNAT Primary and Secondary dispatch table diagram. Add comment section on GNAT dispatch table prologue. (Offset_To_Signature): Update the constant value of the Signature field. (Dispatch_Table): Update comment on hidden fields in the prologue. (Get_Entry_Index, Get_Prim_Op_Kind, Get_Offset_Index, OSD, Set_Entry_Index, Set_Offset_Index, Set_Prim_Op_Kind, SSD, TSD): Change the type of formal parameter T to Tag, introduce additional assertions. (Get_Num_Prim_Ops, Set_Num_Prim_Ops): Remove an unnecessary type conversion. (Get_Tagged_Kind, Set_Tagged_Kind): New bodies. * exp_ch6.adb (Register_Interface_DT_Entry): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. Instead of referencing the record component containing the tag of the secondary dispatch table we have to use the Offset_To_Top run-time function to get this information; otherwise if the pointer to the base of the object has been displace we get a wrong value if we use the 'position attribute. * exp_disp.adb (Expand_Interface_Thunk): Remove the Thunk_Id actual in all the calls to Expand_Interface_Thunk. (Make_Secondary_DT): Secondary dispatch tables do not have a table of interfaces; hence the call to Set_Interface_Table was clearly wrong. (Collect_All_Interfaces): Modify the internal subprogram Collect to ensure that the interfaces implemented by the ancestors are placed at the header of the generated list. (Expand_Interface_Conversion): Handle the case in which the displacement associated with the interface conversion is not statically known. In this case we generate a call to the new run-time subprogram Displace. (Make_DT): Generate and fill the new table of interfaces. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Add entries for Get_Tagged_Kind and Set_Tagged_Kind. (Tagged_Kind): New function that determines the tagged kind of a type with respect to limitedness and concurrency and returns a reference to RE_Tagged_Kind. (Make_Disp_Asynchronous_Select_Body, Make_Disp_Conditional_Select_Body, Make_Disp_Timed_Select_Body): Correctly retrieve the pointer to the primary dispatch table for a type. (Make_DT, Make_Secondary_DT): Set the tagged kind in the primary and secondary dispatch table respectively of a tagged type. * exp_disp.ads (Expand_Interface_Thunk): Remove Thunk_Id formal. (Expand_Interface_Conversion): New subprogram to indicate if the displacement of the type conversion is statically known. (DT_Access_Action): Add values Get_Tagged_Kind and Set_Tagged_Kind. * rtsfind.ads (RE_Offset_To_Top): New entity (RTU_Id): Add Ada_Task_Termination to the list so that it is made accessible to users. (Re_Displace): New entity (RE_Interface_Data): New entity (RE_Set_Interface_Data): New_Entity (RE_Id, RE_Unit_Table): Add entry for RE_Get_Tagged_Kind, Set_Tagged_Kind, RE_Tagged_Kind, RE_TK_Abstract_Limited_Tagged, RE_TK_Abstract_Tagged, RE_TK_Limited_Tagged, RE_TK_Protected, RE_TK_Tagged, RE_TK_Task. * exp_ch3.adb (Init_Secondary_Tags): Modify the subprogram Init_Secondary_Tags_Internal to allow its use with interface types and also to generate the code for the new additional actual required by Set_Offset_To_Top. (Build_Init_Statements): In case of components associated with abstract interface types there is no need to generate a call to its IP. (Freeze_Record_Type): Generate Select Specific Data tables only for concurrent types. (Make_Predefined_Primitive_Specs, Predefined_Primitive_Bodies): Generate the bodies and specifications of the predefined primitive operations dealing with dispatching selects and abort, 'Callable, 'Terminated only for concurrent types. * exp_sel.ads, exp_sel.adb: New files. * exp_ch9.adb (Build_Protected_Entry, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Make_Initialize_Protection): Handle properly protected objects and attach handler in the case of the restricted profile. Move embeded package Select_Expansion_Utilities into a separate external package. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Select, Expand_N_Timed_Entry_Call): Correct calls external package Exp_Sel. (Build_K, Build_S_Assignment): New subprograms, part of the select expansion utilities. (Expand_N_Asynchronous_Select, Expand_N_Conditional_Entry_Call, Expand_N_Timed_Entry_Call): Optimize expansion of select statements where the trigger is a dispatching procedure of a limited tagged type. From-SVN: r108284
2005-12-09 18:13:28 +01:00
function Build_B
(Loc : Source_Ptr;
Decls : List_Id) return Entity_Id;
-- Generate:
-- B : Boolean := False;
-- Append the object declaration to the list and return its defining
-- identifier.
function Build_C
(Loc : Source_Ptr;
Decls : List_Id) return Entity_Id;
-- Generate:
-- C : Ada.Tags.Prim_Op_Kind;
-- Append the object declaration to the list and return its defining
-- identifier.
function Build_Cleanup_Block
(Loc : Source_Ptr;
Blk_Ent : Entity_Id;
Stmts : List_Id;
Clean_Ent : Entity_Id) return Node_Id;
-- Generate:
-- declare
-- procedure _clean is
-- begin
-- ...
-- end _clean;
-- begin
-- Stmts
-- at end
-- _clean;
-- end;
-- Blk_Ent is the name of the generated block, Stmts is the list of
-- encapsulated statements and Clean_Ent is the parameter to the
-- _clean procedure.
function Build_K
(Loc : Source_Ptr;
Decls : List_Id;
Obj : Entity_Id) return Entity_Id;
-- Generate
-- K : Ada.Tags.Tagged_Kind :=
-- Ada.Tags.Get_Tagged_Kind (Ada.Tags.Tag (Obj));
-- where Obj is the pointer to a secondary table. Append the object
-- declaration to the list and return its defining identifier.
function Build_S
(Loc : Source_Ptr;
Decls : List_Id) return Entity_Id;
-- Generate:
-- S : Integer;
-- Append the object declaration to the list and return its defining
-- identifier.
function Build_S_Assignment
(Loc : Source_Ptr;
S : Entity_Id;
Obj : Entity_Id;
Call_Ent : Entity_Id) return Node_Id;
-- Generate:
-- S := Ada.Tags.Get_Offset_Index (
-- Ada.Tags.Tag (Obj), DT_Position (Call_Ent));
-- where Obj is the pointer to a secondary table, Call_Ent is the entity
-- of the dispatching call name. Return the generated assignment.
end Exp_Sel;