gcc/gcc/ada/par-ch12.adb

1307 lines
42 KiB
Ada
Raw Normal View History

2001-10-02 16:23:52 +02:00
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P A R . C H 1 2 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
2001-10-02 16:23:52 +02: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- --
2001-10-02 16:23:52 +02: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. --
2001-10-02 16:23:52 +02:00
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
Nathanael Nerode <neroden@gcc.gnu.org> PR ada/6919 (forward port of patch for PR ada/5904) Nathanael Nerode <neroden@gcc.gnu.org> PR ada/6919 (forward port of patch for PR ada/5904) * 1aexcept.adb 1aexcept.ads 41intnam.ads 42intnam.ads 4aintnam.ads 4cintnam.ads 4dintnam.ads 4hexcpol.adb 4lintnam.ads 4mintnam.ads 4nintnam.ads 4onumaux.ads 4pintnam.ads 4rintnam.ads 4sintnam.ads 4uintnam.ads 4vcalend.adb 4vintnam.ads 4wcalend.adb 4wexcpol.adb 4wintnam.ads 4zintnam.ads 4znumaux.ads 4zsytaco.adb 4zsytaco.ads 51osinte.adb 51osinte.ads 52osinte.adb 52osinte.ads 52system.ads 53osinte.ads 5aosinte.ads 5asystem.ads 5atasinf.ads 5ataspri.ads 5avxwork.ads 5bosinte.ads 5bsystem.ads 5cosinte.ads 5dosinte.ads 5esystem.ads 5fosinte.ads 5fsystem.ads 5ftasinf.ads 5ginterr.adb 5gmastop.adb 5gosinte.ads 5gproinf.adb 5gproinf.ads 5gsystem.ads 5gtasinf.adb 5gtasinf.ads 5gtpgetc.adb 5hparame.ads 5hsystem.ads 5htaspri.ads 5iosinte.ads 5itaspri.ads 5ksystem.ads 5kvxwork.ads 5losinte.ads 5lsystem.ads 5mosinte.ads 5mvxwork.ads 5ninmaop.adb 5nintman.adb 5nosinte.ads 5ntaspri.ads 5oosprim.adb 5oparame.adb 5osystem.ads 5posinte.ads 5posprim.adb 5pvxwork.ads 5rosinte.ads 5rparame.adb 5sintman.adb 5sosinte.ads 5sparame.adb 5ssystem.ads 5stasinf.adb 5stasinf.ads 5staspri.ads 5svxwork.ads 5tosinte.ads 5uosinte.ads 5vasthan.adb 5vinterr.adb 5vintman.ads 5vosinte.ads 5vosprim.adb 5vosprim.ads 5vparame.ads 5vsystem.ads 5vtaspri.ads 5vtpopde.adb 5vtpopde.ads 5vvaflop.adb 5wintman.adb 5wmemory.adb 5wosinte.ads 5wosprim.adb 5wsystem.ads 5wtaprop.adb 5wtaspri.ads 5ysystem.ads 5zinterr.adb 5zosinte.adb 5zosinte.ads 5zosprim.adb 5zsystem.ads 6vcpp.adb 6vcstrea.adb 7sosprim.adb 86numaux.adb 86numaux.ads 9drpc.adb a-astaco.adb a-caldel.ads a-calend.adb a-calend.ads a-chahan.adb a-chahan.ads a-colien.adb a-colien.ads a-colire.adb a-colire.ads a-comlin.adb a-comlin.ads a-cwila1.ads a-decima.adb a-decima.ads a-diocst.adb a-diocst.ads a-direio.adb a-direio.ads a-einuoc.adb a-einuoc.ads a-except.adb a-except.ads a-excpol.adb a-exctra.adb a-exctra.ads a-filico.adb a-filico.ads a-finali.adb a-finali.ads a-interr.ads a-intsig.adb a-intsig.ads a-ngcefu.adb a-ngcoty.adb a-ngcoty.ads a-ngelfu.adb a-nudira.adb a-nudira.ads a-nuflra.adb a-nuflra.ads a-numaux.ads a-reatim.ads a-retide.ads a-sequio.adb a-sequio.ads a-siocst.adb a-siocst.ads a-ssicst.adb a-ssicst.ads a-stmaco.ads a-storio.adb a-strbou.adb a-strbou.ads a-stream.ads a-strfix.adb a-strfix.ads a-strmap.adb a-strmap.ads a-strsea.adb a-strsea.ads a-strunb.adb a-strunb.ads a-ststio.adb a-ststio.ads a-stunau.adb a-stunau.ads a-stwibo.adb a-stwibo.ads a-stwifi.adb a-stwima.adb a-stwima.ads a-stwise.adb a-stwise.ads a-stwiun.adb a-stwiun.ads a-suteio.adb a-suteio.ads a-swmwco.ads a-swuwti.adb a-swuwti.ads a-sytaco.adb a-sytaco.ads a-tags.adb a-tags.ads a-tasatt.ads a-taside.adb a-taside.ads a-teioed.adb a-teioed.ads a-textio.adb a-textio.ads a-ticoau.adb a-ticoau.ads a-ticoio.adb a-ticoio.ads a-tideau.adb a-tideau.ads a-tideio.adb a-tideio.ads a-tienau.adb a-tienau.ads a-tienio.adb a-tienio.ads a-tifiio.adb a-tifiio.ads a-tiflau.adb a-tiflau.ads a-tiflio.adb a-tiflio.ads a-tigeau.adb a-tigeau.ads a-tiinau.adb a-tiinau.ads a-tiinio.adb a-tiinio.ads a-timoau.adb a-timoau.ads a-timoio.adb a-timoio.ads a-tiocst.adb a-tiocst.ads a-titest.adb a-witeio.adb a-witeio.ads a-wtcoau.adb a-wtcoau.ads a-wtcoio.adb a-wtcstr.adb a-wtcstr.ads a-wtdeau.adb a-wtdeau.ads a-wtdeio.adb a-wtdeio.ads a-wtedit.adb a-wtedit.ads a-wtenau.adb a-wtenau.ads a-wtenio.adb a-wtenio.ads a-wtfiio.adb a-wtfiio.ads a-wtflau.adb a-wtflau.ads a-wtflio.adb a-wtflio.ads a-wtgeau.adb a-wtgeau.ads a-wtinau.adb a-wtinau.ads a-wtinio.adb a-wtmoau.adb a-wtmoau.ads a-wtmoio.adb a-wtmoio.ads a-wttest.adb ada-tree.def ada-tree.h ada.h adaint.c adaint.h ali-util.adb ali-util.ads ali.adb ali.ads alloc.ads argv.c atree.adb atree.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 cal.c casing.adb casing.ads ceinfo.adb checks.adb checks.ads cio.c comperr.adb comperr.ads csets.adb csets.ads csinfo.adb cstand.adb cstand.ads cstreams.c cuintp.c debug.adb debug.ads debug_a.adb debug_a.ads dec-io.adb dec-io.ads dec.ads decl.c deftarg.c einfo.adb einfo.ads einfo.h elists.adb elists.ads elists.h errno.c errout.adb errout.ads eval_fat.adb eval_fat.ads exit.c exp_aggr.adb exp_aggr.ads exp_attr.adb exp_attr.ads exp_ch10.ads exp_ch11.adb exp_ch11.ads exp_ch12.adb exp_ch12.ads exp_ch13.adb exp_ch13.ads exp_ch2.adb exp_ch2.ads exp_ch3.adb 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.adb 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_smem.ads exp_strm.adb exp_strm.ads exp_tss.adb exp_tss.ads exp_util.adb exp_util.ads exp_vfpt.adb exp_vfpt.ads expander.adb expander.ads fe.h final.c fmap.adb fmap.ads fname-sf.adb fname-sf.ads fname-uf.adb fname-uf.ads fname.adb fname.ads freeze.adb freeze.ads frontend.adb frontend.ads g-calend.ads g-comlin.adb g-debpoo.adb g-debpoo.ads g-locfil.adb g-os_lib.ads g-regist.adb g-regist.ads get_targ.adb get_targ.ads gigi.h gmem.c gnat1drv.adb gnat1drv.ads gnat_ug.texi gnatbind.adb gnatbind.ads gnatbl.c 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 gnatprep.adb gnatprep.ads gnatpsta.adb gnatvsn.ads gnatxref.adb hlo.adb hlo.ads hostparm.ads i-c.adb i-cexten.ads i-cobol.adb i-cobol.ads i-cpoint.adb i-cpoint.ads i-cpp.adb i-cpp.ads i-cstrea.adb i-cstrea.ads i-cstrin.adb i-cstrin.ads i-fortra.adb i-os2err.ads i-os2lib.adb i-os2lib.ads i-os2syn.ads i-os2thr.ads i-pacdec.adb i-pacdec.ads impunit.adb impunit.ads init.c inline.adb inline.ads io-aux.c itypes.adb itypes.ads krunch.adb krunch.ads lang-options.h lang-specs.h layout.adb layout.ads lib-list.adb lib-load.adb lib-load.ads lib-sort.adb lib-util.adb lib-util.ads lib-writ.adb lib-writ.ads lib-xref.adb lib-xref.ads lib.adb lib.ads link.c live.adb live.ads make.adb make.ads makeusg.adb makeusg.ads math_lib.adb mdll.adb mdll.ads memtrack.adb misc.c namet.adb namet.ads namet.h nlists.adb nlists.ads nlists.h nmake.adb nmake.ads nmake.adt opt.adb opt.ads osint.adb osint.ads output.adb output.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 par.adb par.ads prj-attr.adb prj-attr.ads prj-com.adb prj-com.ads prj-dect.adb prj-dect.ads prj-env.adb prj-env.ads prj-ext.adb prj-ext.ads prj-nmsc.adb prj-nmsc.ads prj-pars.adb prj-pars.ads prj-part.adb prj-part.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 prj.adb prj.ads raise.c raise.h repinfo.adb repinfo.ads repinfo.h restrict.adb restrict.ads rident.ads rtsfind.adb rtsfind.ads s-addima.adb s-addima.ads s-arit64.adb s-arit64.ads s-assert.adb s-assert.ads s-asthan.adb s-asthan.ads s-atacco.adb s-auxdec.adb s-auxdec.ads s-bitops.adb s-bitops.ads s-chepoo.ads s-direio.adb s-direio.ads s-except.ads s-exctab.adb s-exctab.ads s-exnflt.ads s-exngen.adb s-exngen.ads s-exnint.ads s-exnlfl.ads s-exnlin.ads s-exnllf.ads s-exnlli.ads s-exnsfl.ads s-exnsin.ads s-exnssi.ads s-expflt.ads s-expgen.adb s-expgen.ads s-expint.ads s-explfl.ads s-explin.ads s-expllf.ads s-explli.ads s-expllu.adb s-expllu.ads s-expmod.adb s-expmod.ads s-expsfl.ads s-expsin.ads s-expssi.ads s-expuns.adb s-expuns.ads s-fatflt.ads s-fatgen.adb s-fatgen.ads s-fatlfl.ads s-fatllf.ads s-fatsfl.ads s-ficobl.ads s-fileio.adb s-fileio.ads s-finimp.adb s-finimp.ads s-finroo.adb s-finroo.ads s-fore.adb s-fore.ads s-imgbiu.adb s-imgbiu.ads s-imgboo.adb s-imgboo.ads s-imgcha.adb s-imgcha.ads s-imgdec.adb s-imgdec.ads s-imgenu.adb s-imgenu.ads s-imgint.adb s-imgint.ads s-imgllb.adb s-imgllb.ads s-imglld.adb s-imglld.ads s-imglli.adb s-imglli.ads s-imgllu.adb s-imgllu.ads s-imgllw.adb s-imgllw.ads s-imgrea.adb s-imgrea.ads s-imguns.adb s-imguns.ads s-imgwch.adb s-imgwch.ads s-imgwiu.adb s-imgwiu.ads s-inmaop.ads s-interr.adb s-interr.ads s-intman.ads s-io.adb s-io.ads s-maccod.ads s-mantis.adb s-mantis.ads s-memory.adb s-memory.ads s-osprim.ads s-pack03.adb s-pack03.ads s-pack05.adb s-pack05.ads s-pack06.adb s-pack06.ads s-pack07.adb s-pack07.ads s-pack09.adb s-pack09.ads s-pack10.adb s-pack10.ads s-pack11.adb s-pack11.ads s-pack12.adb s-pack12.ads s-pack13.adb s-pack13.ads s-pack14.adb s-pack14.ads s-pack15.adb s-pack15.ads s-pack17.adb s-pack17.ads s-pack18.adb s-pack18.ads s-pack19.adb s-pack19.ads s-pack20.adb s-pack20.ads s-pack21.adb s-pack21.ads s-pack22.adb s-pack22.ads s-pack23.adb s-pack23.ads s-pack24.adb s-pack24.ads s-pack25.adb s-pack25.ads s-pack26.adb s-pack26.ads s-pack27.adb s-pack27.ads s-pack28.adb s-pack28.ads s-pack29.adb s-pack29.ads s-pack30.adb s-pack30.ads s-pack31.adb s-pack31.ads s-pack33.adb s-pack33.ads s-pack34.adb s-pack34.ads s-pack35.adb s-pack35.ads s-pack36.adb s-pack36.ads s-pack37.adb s-pack37.ads s-pack38.adb s-pack38.ads s-pack39.adb s-pack39.ads s-pack40.adb s-pack40.ads s-pack41.adb s-pack41.ads s-pack42.adb s-pack42.ads s-pack43.adb s-pack43.ads s-pack44.adb s-pack44.ads s-pack45.adb s-pack45.ads s-pack46.adb s-pack46.ads s-pack47.adb s-pack47.ads s-pack48.adb s-pack48.ads s-pack49.adb s-pack49.ads s-pack50.adb s-pack50.ads s-pack51.adb s-pack51.ads s-pack52.adb s-pack52.ads s-pack53.adb s-pack53.ads s-pack54.adb s-pack54.ads s-pack55.adb s-pack55.ads s-pack56.adb s-pack56.ads s-pack57.adb s-pack57.ads s-pack58.adb s-pack58.ads s-pack59.adb s-pack59.ads s-pack60.adb s-pack60.ads s-pack61.adb s-pack61.ads s-pack62.adb s-pack62.ads s-pack63.adb s-pack63.ads s-parame.adb s-parame.ads s-parint.adb s-parint.ads s-pooglo.adb s-pooglo.ads s-pooloc.adb s-pooloc.ads s-poosiz.adb s-poosiz.ads s-powtab.ads s-proinf.adb s-proinf.ads s-rpc.adb s-rpc.ads s-scaval.ads s-secsta.adb s-secsta.ads s-sequio.adb s-sequio.ads s-shasto.adb s-shasto.ads s-soflin.adb s-soflin.ads s-sopco3.adb s-sopco3.ads s-sopco4.adb s-sopco4.ads s-sopco5.adb s-sopco5.ads s-stache.adb s-stache.ads s-stalib.adb s-stalib.ads s-stoele.adb s-stopoo.ads s-stratt.adb s-stratt.ads s-strops.adb s-strops.ads s-taprob.ads s-taprop.ads s-tarest.ads s-tasdeb.adb s-tasdeb.ads s-tasinf.adb s-tasinf.ads s-tasini.ads s-taskin.ads s-tasren.ads s-tasres.ads s-tassta.ads s-tpinop.adb s-tpinop.ads s-tpoben.ads s-tpobop.ads s-unstyp.ads s-vaflop.adb s-vaflop.ads s-valboo.adb s-valboo.ads s-valcha.adb s-valcha.ads s-valdec.adb s-valdec.ads s-valenu.adb s-valenu.ads s-valint.adb s-valint.ads s-vallld.adb s-vallld.ads s-vallli.adb s-vallli.ads s-valllu.adb s-valllu.ads s-valrea.adb s-valrea.ads s-valuns.adb s-valuns.ads s-valuti.adb s-valuti.ads s-valwch.adb s-valwch.ads s-vercon.adb s-vercon.ads s-vmexta.adb s-vmexta.ads s-wchcnv.adb s-wchcnv.ads s-wchcon.ads s-wchjis.adb s-wchjis.ads s-wchstw.adb s-wchstw.ads s-wchwts.adb s-wchwts.ads s-widboo.adb s-widboo.ads s-widcha.adb s-widcha.ads s-widenu.adb s-widenu.ads s-widlli.adb s-widlli.ads s-widllu.adb s-widllu.ads s-widwch.adb s-widwch.ads s-wwdcha.adb s-wwdcha.ads s-wwdenu.adb s-wwdenu.ads s-wwdwch.adb s-wwdwch.ads scans.adb scans.ads scn-nlit.adb scn-slit.adb scn.adb scn.ads sdefault.ads sem.adb sem.ads sem_aggr.adb sem_aggr.ads sem_attr.adb sem_attr.ads 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.adb sem_ch12.ads sem_ch13.adb sem_ch13.ads sem_ch2.adb sem_ch2.ads sem_ch3.adb sem_ch3.ads sem_ch4.adb 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.adb sfn_scan.ads sinfo-cn.adb sinfo-cn.ads sinfo.adb sinfo.ads sinfo.h sinput-l.adb sinput-l.ads sinput-p.adb sinput-p.ads sinput.adb sinput.ads snames.adb snames.ads snames.h sprint.adb sprint.ads stand.adb stand.ads stringt.adb stringt.ads stringt.h style.adb style.ads stylesw.adb stylesw.ads switch.adb switch.ads sysdep.c system.ads table.adb table.ads targparm.adb targparm.ads targtyps.c tbuild.adb tbuild.ads trans.c tree_gen.adb tree_gen.ads tree_in.adb tree_in.ads tree_io.adb tree_io.ads treepr.adb treepr.ads treeprs.ads treeprs.adt ttypef.ads ttypes.ads types.adb types.ads types.h uintp.adb uintp.ads uintp.h uname.adb uname.ads urealp.adb urealp.ads urealp.h usage.adb usage.ads utils.c utils2.c validsw.adb validsw.ads widechar.adb widechar.ads xeinfo.adb xnmake.adb xr_tabls.adb xr_tabls.ads xref_lib.adb xref_lib.ads xsinfo.adb xsnames.adb xtreeprs.adb: Correct statements in comments about maintainership of GNAT. From-SVN: r58442
2002-10-23 09:33:35 +02:00
-- Extensive contributions were provided by Ada Core Technologies Inc. --
2001-10-02 16:23:52 +02:00
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- Turn off subprogram body ordering check. Subprograms are in order
-- by RM section rather than alphabetical
separate (Par)
package body Ch12 is
-- Local functions, used only in this chapter
function P_Formal_Derived_Type_Definition return Node_Id;
function P_Formal_Discrete_Type_Definition return Node_Id;
function P_Formal_Fixed_Point_Definition return Node_Id;
function P_Formal_Floating_Point_Definition return Node_Id;
function P_Formal_Modular_Type_Definition return Node_Id;
function P_Formal_Package_Declaration return Node_Id;
function P_Formal_Private_Type_Definition return Node_Id;
function P_Formal_Signed_Integer_Type_Definition return Node_Id;
function P_Formal_Subprogram_Declaration return Node_Id;
function P_Formal_Type_Declaration return Node_Id;
function P_Formal_Type_Definition return Node_Id;
function P_Generic_Association return Node_Id;
procedure P_Formal_Object_Declarations (Decls : List_Id);
-- Scans one or more formal object declarations and appends them to
-- Decls. Scans more than one declaration only in the case where the
-- source has a declaration with multiple defining identifiers.
--------------------------------
-- 12.1 Generic (also 8.5.5) --
--------------------------------
-- This routine parses either one of the forms of a generic declaration
-- or a generic renaming declaration.
-- GENERIC_DECLARATION ::=
-- GENERIC_SUBPROGRAM_DECLARATION | GENERIC_PACKAGE_DECLARATION
-- GENERIC_SUBPROGRAM_DECLARATION ::=
-- GENERIC_FORMAL_PART SUBPROGRAM_SPECIFICATION
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
-- GENERIC_PACKAGE_DECLARATION ::=
-- GENERIC_FORMAL_PART PACKAGE_SPECIFICATION
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
-- GENERIC_FORMAL_PART ::=
-- generic {GENERIC_FORMAL_PARAMETER_DECLARATION | USE_CLAUSE}
-- GENERIC_RENAMING_DECLARATION ::=
-- generic package DEFINING_PROGRAM_UNIT_NAME
-- renames generic_package_NAME
[multiple changes] 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add entries in the Has_Aspect_Specifications_Flag table for package body and body stubs. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * aspects.ads (Move_Aspects): Update comment on usage. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * par-ch3.adb: Update the grammar of private_type_declaration, private_extension_declaration, object_renaming_declaration, and exception_renaming_declaration. (P_Subprogram): Parse the aspect specifications that apply to a body stub. * par-ch6.adb: Update the grammar of subprogram_body_stub and generic_instantiation. * par-ch7.adb: Update the grammar of package_declaration, package_specification, package_body, package_renaming_declaration, package_body_stub. (P_Package): Parse the aspect specifications that apply to a body, a body stub and package renaming. * par-ch9.adb: Update the grammar of entry_declaration, protected_body, protected_body_stub, task_body, and task_body_stub. (P_Protected): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a protected body and a protected body stub. (P_Task): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a task body and a task body stub. * par-ch12.adb: Update the grammar of generic_renaming_declaration. (P_Generic): Parse the aspect specifications that apply to a generic renaming. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not emit an error when analyzing aspects that apply to a body stub. Such aspects are relocated to the proper body. * sem_ch7.adb (Analyze_Package_Body_Helper): Analyze the aspect specifications that apply to a body. * sem_ch9.adb (Analyze_Protected_Body): Warn about user-defined aspects not being supported on protected bodies. Remove the aspect specifications. (Analyze_Single_Protected_Declaration): Analyze the aspects that apply to a single protected declaration. (Analyze_Task_Body): Warn about user-defined aspects not being supported on task bodies. Remove the aspect specifications. * sem_ch10.adb: Add with and use clause for Aspects. (Analyze_Package_Body_Stub): Propagate the aspect specifications from the stub to the proper body. * sem_ch13.adb (Analyze_Aspect_Specifications): Insert the corresponding pragma of an aspect that applies to a body in the declarations of the body. * sinfo.ads: Update the gramma of expression_function, private_type_declaration, private_extension_declaration, object_renaming_declaration, exception_renaming_declaration, package_renaming_declaration, subprogram_renaming_declaration, generic_renaming_declaration, entry_declaration, subprogram_body_stub, package_body_stub, task_body_stub, generic_subprogram_declaration. 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Add processing for aspect/pragma SPARK_Mode when it applies to a [library-level] subprogram or package [body]. 2013-09-10 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Document that -gnatc and -gnatR cannot be given together. * switch-c.adb (Scan_Front_End_Switches): Give error if both -gnatR and -gnatc given. 2013-09-10 Robert Dewar <dewar@adacore.com> * g-table.ads, g-table.adb (For_Each): New generic procedure (Sort_Table): New generic procedure. From-SVN: r202460
2013-09-10 17:05:40 +02:00
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
-- | generic procedure DEFINING_PROGRAM_UNIT_NAME
-- renames generic_procedure_NAME
[multiple changes] 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add entries in the Has_Aspect_Specifications_Flag table for package body and body stubs. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * aspects.ads (Move_Aspects): Update comment on usage. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * par-ch3.adb: Update the grammar of private_type_declaration, private_extension_declaration, object_renaming_declaration, and exception_renaming_declaration. (P_Subprogram): Parse the aspect specifications that apply to a body stub. * par-ch6.adb: Update the grammar of subprogram_body_stub and generic_instantiation. * par-ch7.adb: Update the grammar of package_declaration, package_specification, package_body, package_renaming_declaration, package_body_stub. (P_Package): Parse the aspect specifications that apply to a body, a body stub and package renaming. * par-ch9.adb: Update the grammar of entry_declaration, protected_body, protected_body_stub, task_body, and task_body_stub. (P_Protected): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a protected body and a protected body stub. (P_Task): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a task body and a task body stub. * par-ch12.adb: Update the grammar of generic_renaming_declaration. (P_Generic): Parse the aspect specifications that apply to a generic renaming. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not emit an error when analyzing aspects that apply to a body stub. Such aspects are relocated to the proper body. * sem_ch7.adb (Analyze_Package_Body_Helper): Analyze the aspect specifications that apply to a body. * sem_ch9.adb (Analyze_Protected_Body): Warn about user-defined aspects not being supported on protected bodies. Remove the aspect specifications. (Analyze_Single_Protected_Declaration): Analyze the aspects that apply to a single protected declaration. (Analyze_Task_Body): Warn about user-defined aspects not being supported on task bodies. Remove the aspect specifications. * sem_ch10.adb: Add with and use clause for Aspects. (Analyze_Package_Body_Stub): Propagate the aspect specifications from the stub to the proper body. * sem_ch13.adb (Analyze_Aspect_Specifications): Insert the corresponding pragma of an aspect that applies to a body in the declarations of the body. * sinfo.ads: Update the gramma of expression_function, private_type_declaration, private_extension_declaration, object_renaming_declaration, exception_renaming_declaration, package_renaming_declaration, subprogram_renaming_declaration, generic_renaming_declaration, entry_declaration, subprogram_body_stub, package_body_stub, task_body_stub, generic_subprogram_declaration. 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Add processing for aspect/pragma SPARK_Mode when it applies to a [library-level] subprogram or package [body]. 2013-09-10 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Document that -gnatc and -gnatR cannot be given together. * switch-c.adb (Scan_Front_End_Switches): Give error if both -gnatR and -gnatc given. 2013-09-10 Robert Dewar <dewar@adacore.com> * g-table.ads, g-table.adb (For_Each): New generic procedure (Sort_Table): New generic procedure. From-SVN: r202460
2013-09-10 17:05:40 +02:00
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
-- | generic function DEFINING_PROGRAM_UNIT_NAME
-- renames generic_function_NAME
[multiple changes] 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add entries in the Has_Aspect_Specifications_Flag table for package body and body stubs. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * aspects.ads (Move_Aspects): Update comment on usage. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * par-ch3.adb: Update the grammar of private_type_declaration, private_extension_declaration, object_renaming_declaration, and exception_renaming_declaration. (P_Subprogram): Parse the aspect specifications that apply to a body stub. * par-ch6.adb: Update the grammar of subprogram_body_stub and generic_instantiation. * par-ch7.adb: Update the grammar of package_declaration, package_specification, package_body, package_renaming_declaration, package_body_stub. (P_Package): Parse the aspect specifications that apply to a body, a body stub and package renaming. * par-ch9.adb: Update the grammar of entry_declaration, protected_body, protected_body_stub, task_body, and task_body_stub. (P_Protected): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a protected body and a protected body stub. (P_Task): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a task body and a task body stub. * par-ch12.adb: Update the grammar of generic_renaming_declaration. (P_Generic): Parse the aspect specifications that apply to a generic renaming. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not emit an error when analyzing aspects that apply to a body stub. Such aspects are relocated to the proper body. * sem_ch7.adb (Analyze_Package_Body_Helper): Analyze the aspect specifications that apply to a body. * sem_ch9.adb (Analyze_Protected_Body): Warn about user-defined aspects not being supported on protected bodies. Remove the aspect specifications. (Analyze_Single_Protected_Declaration): Analyze the aspects that apply to a single protected declaration. (Analyze_Task_Body): Warn about user-defined aspects not being supported on task bodies. Remove the aspect specifications. * sem_ch10.adb: Add with and use clause for Aspects. (Analyze_Package_Body_Stub): Propagate the aspect specifications from the stub to the proper body. * sem_ch13.adb (Analyze_Aspect_Specifications): Insert the corresponding pragma of an aspect that applies to a body in the declarations of the body. * sinfo.ads: Update the gramma of expression_function, private_type_declaration, private_extension_declaration, object_renaming_declaration, exception_renaming_declaration, package_renaming_declaration, subprogram_renaming_declaration, generic_renaming_declaration, entry_declaration, subprogram_body_stub, package_body_stub, task_body_stub, generic_subprogram_declaration. 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Add processing for aspect/pragma SPARK_Mode when it applies to a [library-level] subprogram or package [body]. 2013-09-10 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Document that -gnatc and -gnatR cannot be given together. * switch-c.adb (Scan_Front_End_Switches): Give error if both -gnatR and -gnatc given. 2013-09-10 Robert Dewar <dewar@adacore.com> * g-table.ads, g-table.adb (For_Each): New generic procedure (Sort_Table): New generic procedure. From-SVN: r202460
2013-09-10 17:05:40 +02:00
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
-- GENERIC_FORMAL_PARAMETER_DECLARATION ::=
-- FORMAL_OBJECT_DECLARATION
-- | FORMAL_TYPE_DECLARATION
-- | FORMAL_SUBPROGRAM_DECLARATION
-- | FORMAL_PACKAGE_DECLARATION
-- The caller has checked that the initial token is GENERIC
-- Error recovery: can raise Error_Resync
function P_Generic return Node_Id is
Gen_Sloc : constant Source_Ptr := Token_Ptr;
Gen_Decl : Node_Id;
Decl_Node : Node_Id;
Decls : List_Id;
Def_Unit : Node_Id;
Ren_Token : Token_Type;
Scan_State : Saved_Scan_State;
begin
Scan; -- past GENERIC
if Token = Tok_Private then
Error_Msg_SC -- CODEFIX
("PRIVATE goes before GENERIC, not after");
2001-10-02 16:23:52 +02:00
Scan; -- past junk PRIVATE token
end if;
Save_Scan_State (Scan_State); -- at token past GENERIC
-- Check for generic renaming declaration case
if Token = Tok_Package
or else Token = Tok_Function
or else Token = Tok_Procedure
then
Ren_Token := Token;
Scan; -- scan past PACKAGE, FUNCTION or PROCEDURE
if Token = Tok_Identifier then
Def_Unit := P_Defining_Program_Unit_Name;
Check_Misspelling_Of (Tok_Renames);
if Token = Tok_Renames then
if Ren_Token = Tok_Package then
Decl_Node := New_Node
(N_Generic_Package_Renaming_Declaration, Gen_Sloc);
elsif Ren_Token = Tok_Procedure then
Decl_Node := New_Node
(N_Generic_Procedure_Renaming_Declaration, Gen_Sloc);
else -- Ren_Token = Tok_Function then
Decl_Node := New_Node
(N_Generic_Function_Renaming_Declaration, Gen_Sloc);
end if;
Scan; -- past RENAMES
Set_Defining_Unit_Name (Decl_Node, Def_Unit);
Set_Name (Decl_Node, P_Name);
[multiple changes] 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add entries in the Has_Aspect_Specifications_Flag table for package body and body stubs. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * aspects.ads (Move_Aspects): Update comment on usage. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * par-ch3.adb: Update the grammar of private_type_declaration, private_extension_declaration, object_renaming_declaration, and exception_renaming_declaration. (P_Subprogram): Parse the aspect specifications that apply to a body stub. * par-ch6.adb: Update the grammar of subprogram_body_stub and generic_instantiation. * par-ch7.adb: Update the grammar of package_declaration, package_specification, package_body, package_renaming_declaration, package_body_stub. (P_Package): Parse the aspect specifications that apply to a body, a body stub and package renaming. * par-ch9.adb: Update the grammar of entry_declaration, protected_body, protected_body_stub, task_body, and task_body_stub. (P_Protected): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a protected body and a protected body stub. (P_Task): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a task body and a task body stub. * par-ch12.adb: Update the grammar of generic_renaming_declaration. (P_Generic): Parse the aspect specifications that apply to a generic renaming. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not emit an error when analyzing aspects that apply to a body stub. Such aspects are relocated to the proper body. * sem_ch7.adb (Analyze_Package_Body_Helper): Analyze the aspect specifications that apply to a body. * sem_ch9.adb (Analyze_Protected_Body): Warn about user-defined aspects not being supported on protected bodies. Remove the aspect specifications. (Analyze_Single_Protected_Declaration): Analyze the aspects that apply to a single protected declaration. (Analyze_Task_Body): Warn about user-defined aspects not being supported on task bodies. Remove the aspect specifications. * sem_ch10.adb: Add with and use clause for Aspects. (Analyze_Package_Body_Stub): Propagate the aspect specifications from the stub to the proper body. * sem_ch13.adb (Analyze_Aspect_Specifications): Insert the corresponding pragma of an aspect that applies to a body in the declarations of the body. * sinfo.ads: Update the gramma of expression_function, private_type_declaration, private_extension_declaration, object_renaming_declaration, exception_renaming_declaration, package_renaming_declaration, subprogram_renaming_declaration, generic_renaming_declaration, entry_declaration, subprogram_body_stub, package_body_stub, task_body_stub, generic_subprogram_declaration. 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Add processing for aspect/pragma SPARK_Mode when it applies to a [library-level] subprogram or package [body]. 2013-09-10 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Document that -gnatc and -gnatR cannot be given together. * switch-c.adb (Scan_Front_End_Switches): Give error if both -gnatR and -gnatc given. 2013-09-10 Robert Dewar <dewar@adacore.com> * g-table.ads, g-table.adb (For_Each): New generic procedure (Sort_Table): New generic procedure. From-SVN: r202460
2013-09-10 17:05:40 +02:00
P_Aspect_Specifications (Decl_Node, Semicolon => False);
2001-10-02 16:23:52 +02:00
TF_Semicolon;
return Decl_Node;
end if;
end if;
end if;
-- Fall through if this is *not* a generic renaming declaration
Restore_Scan_State (Scan_State);
Decls := New_List;
-- Loop through generic parameter declarations and use clauses
Decl_Loop : loop
P_Pragmas_Opt (Decls);
if Token = Tok_Private then
Error_Msg_S ("generic private child packages not permitted");
Scan; -- past PRIVATE
end if;
2001-10-02 16:23:52 +02:00
if Token = Tok_Use then
Append (P_Use_Clause, Decls);
2001-10-02 16:23:52 +02:00
else
-- Parse a generic parameter declaration
if Token = Tok_Identifier then
P_Formal_Object_Declarations (Decls);
elsif Token = Tok_Type then
Append (P_Formal_Type_Declaration, Decls);
elsif Token = Tok_With then
Scan; -- past WITH
if Token = Tok_Package then
Append (P_Formal_Package_Declaration, Decls);
elsif Token = Tok_Procedure or Token = Tok_Function then
Append (P_Formal_Subprogram_Declaration, Decls);
else
Error_Msg_BC -- CODEFIX
2001-10-02 16:23:52 +02:00
("FUNCTION, PROCEDURE or PACKAGE expected here");
Resync_Past_Semicolon;
end if;
elsif Token = Tok_Subtype then
Error_Msg_SC ("subtype declaration not allowed " &
"as generic parameter declaration!");
Resync_Past_Semicolon;
else
exit Decl_Loop;
end if;
end if;
end loop Decl_Loop;
-- Generic formal part is scanned, scan out subprogram or package spec
if Token = Tok_Package then
Gen_Decl := New_Node (N_Generic_Package_Declaration, Gen_Sloc);
Set_Specification (Gen_Decl, P_Package (Pf_Spcn));
-- Aspects have been parsed by the package spec. Move them to the
-- generic declaration where they belong.
Move_Aspects (Specification (Gen_Decl), Gen_Decl);
2001-10-02 16:23:52 +02:00
else
Gen_Decl := New_Node (N_Generic_Subprogram_Declaration, Gen_Sloc);
Set_Specification (Gen_Decl, P_Subprogram_Specification);
[multiple changes] 2004-06-11 Vincent Celier <celier@gnat.com> * mlib-tgt-vms-alpha.adb (Build_Dynamic_Library): Issue switch -R to gnatsym, when symbol policy is Restricted. * mlib-tgt-vms-ia64.adb (Build_Dynamic_Library): Issue switch -R to gnatsym, when symbol policy is Restricted. * symbols-vms-alpha.adb (Initialize): When symbol policy is Restricted, read the symbol file. (Finalize): Fail in symbol policy Restricted if a symbol in the original symbol file is not in the object files. Do not create a new symbol file when symbol policy is Restricted. * gnatbind.adb (Gnatbind): Initialize Snames, because Snames is used in Scng. * gnatsym.adb (Parse_Vmd_Line): Process new switch -R for symbol policy Restricted. (Usage): Line for new switch -R * make.adb (Initialize): When the platform is not VMS, add the directory where gnatmake is invoked in the front of the path, if gnatmake is invoked with directory information. Change the Scan_Args while loop to a for loop. (Recursive_Compute_Depth): Remove parameter Visited. Improve efficiency: if Depth is equal or greater than the proposed depth, there is nothing to do. (Initialize): Call Recursive_Compute_Depth with initial Depth equal to 1 instead of 0. * prj.ads: Add new symbol policy Restricted. * prj-dect.adb (Parse_Case_Construction): Call End_Case_Construction with the new parameters Check_All_Labels and Case_Location. * prj-nmsc.adb (Ada_Check): Process new symbol policy Restricted (Library_Symbol_File needs to be defined). * prj-strt.adb (End_Case_Construction): New parameters Check_All_Labels and Case_Location If Check_All_Labels is True, check that all values of the string type are used, and output warning(s) if they are not. * prj-strt.ads (End_Case_Construction): New parameters Check_All_Labels and Case_Location. * gnat_ugn.texi: Reorder subclauses in menus "Switches for gcc" * gnat_ugn.texi: Update documentation about the library directory in Library Projects. * makegpr.adb (Display_Command): In verbose mode, also display the value of the CPATH env var, when the compiler is gcc. (Initialize): Change the Scan_Args while loop to a for loop (Compile_Individual_Sources): Change directory to object directory before compilations. * symbols.ads: New symbol policy Restricted. 2004-06-11 Olivier Hainque <hainque@act-europe.fr> * a-except.adb (Raise_After_Setup family): Remove. The responsibility is now taken care of internally in the Exception_Propagation package and does not require clients assistance any more. * a-exexpr.adb (Is_Setup_And_Not_Propagated, Set_Setup_And_Not_Propagated, and Clear_Setup_And_Not_Propagated): New functions. Helpers to maintain a predicate required in the handling of occurrence transfer between tasks. This is now handled internally and does not require clients assistance for the setup/propagate separation anymore. (Setup_Exception, Propagate_Exception): Simplify the Private_Data allocation strategy, handle the Setup_And_Not_Propagated predicate and document. * s-taenca.adb (Check_Exception): Use raise_with_msg instead of raise_after_setup, now that everything is handled internally within the setup/propagation engine. 2004-06-11 Hristian Kirtchev <kirtchev@gnat.com> * exp_ch6.adb (Expand_Inlined_Call): Add function Formal_Is_Used_Once. Add additional conditions for the case of an actual being a simple name or literal. Improve inlining by preventing the generation of temporaries with a short lifetime (one use). 2004-06-11 Hristian Kirtchev <kirtchev@gnat.com> PR ada/15587 * einfo.ads: Minor comment updates for Has_Completion and E_Constant list of flags. * sem_ch3.adb (Analyze_Object_Declaration): Full constant declarations and constant redeclarations now set the Has_Completion flag of their defining identifiers. * sem_ch7.adb (Analyze_Package_Spec): Add procedure Inspect_Deferred_Constant_Completion. Used to detect private deferred constants that have not been completed either by a constant redeclaration or pragma Import. Emits error message "constant declaration requires initialization expression". * sem_prag.adb (Process_Import_Or_Interface): An Import pragma now completes a deferred constant. 2004-06-11 Geert Bosch <bosch@gnat.com> * eval_fat.adb (Decompose_Int): Fix rounding of negative numbers. * s-fatgen.adb (Gradual_Scaling): Correct off-by-one error in calculating exponent for scaling denormal numbers. (Leading_Part): Properly raise Constraint_Error for zero or negative Adjustment. (Remainder): Properly raise Constraint_Error for zero divisor. 2004-06-11 Thomas Quinot <quinot@act-europe.fr> * sem_util.adb: Minor reformatting. * exp_ch2.adb (Expand_Entry_Parameter): Generate an explicit dereference when accessing the entry parameter record. (Check_Array_Type): Always check for possible implicit dereference. (maybe_implicit_dereference): Rename to check_no_implicit_derefence. Abort if a pointer is still present (denoting that an implicit dereference was left in the tree by the front-end). * sem_attr.adb (Expand_Entry_Parameter): Generate an explicit dereference when accessing the entry parameter record. (Check_Array_Type): Always check for possible implicit dereference. (maybe_implicit_dereference): Rename to check_no_implicit_derefence. Abort if a pointer is still present (denoting that an implicit dereference was left in the tree by the front-end). 2004-06-11 Emmanuel Briot <briot@act-europe.fr> * g-debpoo.adb (Deallocate, Dereference): Add prefix "error:" to error message, like the compiler itself does. Easier to parse the output. * g-debpoo.ads: (Allocate, Deallocate, Dereference): Add comments. * gnat_ugn.texi (gnatxref, gnatfind): Clarify that source names should be base names, and not includes directories. 2004-06-11 Arnaud Charlet <charlet@act-europe.fr> * Makefile.generic ($(EXEC)): Depend on $(OBJECTS), not $(OBJ_FILES), so that dependencies are properly taken into account by make. 2004-06-11 Arnaud Charlet <charlet@act-europe.fr> PR ada/15622 * s-unstyp.ads, s-maccod.ads, sem_ch8.adb, s-auxdec.ads, exp_intr.adb, s-auxdec-vms_64.ads: Fix typo: instrinsic -> intrinsic 2004-06-11 Jerome Guitton <guitton@act-europe.fr> * Makefile.in (install-gnatlib): install target-specific run-time files. * Make-lang.in: Remove obsolete targets. 2004-06-11 Ed Schonberg <schonberg@gnat.com> * par-ch12.adb (P_Generic): Add scope before analyzing subprogram specification, to catch misuses of program unit names. * sem_res.adb (Resolve_Type_Conversion): Do not emit warnings on superfluous conversions in an instance. 2004-06-11 Ed Schonberg <schonberg@gnat.com> PR ada/15403 * sem_ch12.adb (Save_References): If operator node has been folded to enumeration literal, associated_node must be discarded. 2004-06-11 Jose Ruiz <ruiz@act-europe.fr> * s-stchop-vxworks.adb: Add required pragma Convention to Task_Descriptor because it is updated by a C function. From-SVN: r82973
2004-06-11 12:47:39 +02:00
[multiple changes] 2004-06-14 Pascal Obry <obry@gnat.com> * gnat_ugn.texi: Document relocatable vs. dynamic Library_Kind on Windows. Fix minor typo. * mlib-tgt-mingw.adb: New implementation using the GCC -shared option which is now supported on Windows. With this implementation using the Library Project feature is no different on Windows than on UNIX. 2004-06-14 Vincent Celier <celier@gnat.com> * makegpr.adb (Compile_Sources): Nothing to do when there are no non-Ada sources. * mlib-tgt-vxworks.adb (Library_Exists_For): Remove incorrect comment * prj-part.adb (Parse_Single_Project): When a duplicate project name is found, show the project name and the path of the previously parsed project file. 2004-06-14 Ed Schonberg <schonberg@gnat.com> * exp_ch6.adb (Add_Call_By_Copy_Code): For an out-parameter that is an array, avoid copying the actual before the call. 2004-06-14 Thomas Quinot <quinot@act-europe.fr> * g-debpoo.adb: Remove alignment assumptions from GNAT.Debug_Pools. Instead, allocate memory on worst-case alignment assumptions, and then return an aligned address within the allocated zone. 2004-06-14 Robert Dewar <dewar@gnat.com> * bindgen.adb (Gen_Adainit_Ada): Do not generate external references to elab entities in predefined units in No_Run_Time_Mode. (Gen_Adainit_C): Same fix (Gen_Elab_Calls_Ada): Do not generate calls to elaborate predefined units in No_Run_Time_Mode (Gen_Elab_Calls_C): Same fix * symbols-vms-alpha.adb: Minor reformatting * g-debpoo.ads: Minor reformatting * lib.adb (In_Same_Extended_Unit): Version working on node id's * lib.ads (In_Same_Extended_Unit): Version working on node id's * lib-xref.adb: Minor cleanup, use new version of In_Same_Extended_Unit working on nodes. * make.adb: Minor reformatting * par-ch12.adb: Minor reformatting * par-prag.adb: Add dummy entry for pragma Profile_Warnings * prj-strt.adb: Minor reformatting * restrict.ads, restrict.adb: Redo handling of profile restrictions to be more general. * sem_attr.adb: Minor reformatting * sem_ch7.adb: Minor reformatting * sem_elab.adb (Check_A_Call): Deal with problem of calling init proc for type in the same unit as the object declaration. * sem_prag.adb (Check_Arg_Is_External_Name): New procedure, allows static string expressions and not just string literals. Minor reformatting (Set_Warning): Reset restriction warning flag for restriction pragma Implement pragma Profile_Warnings Implement pragma Profile (Restricted) Give obolescent messages for old restrictions and pragmas * snames.h, snames.ads, snames.adb: Add new entry for pragma Profile_Warnings. * s-rident.ads: Add declarations for restrictions required by profile Restricted and profile Ravenscar. * targparm.ads, targparm.adb: Allow pragma Profile in system.ads * gnat_ugn.texi: Correct some missing entries in the list of GNAT configuration pragmas. From-SVN: r83099
2004-06-14 15:19:14 +02:00
if Nkind (Defining_Unit_Name (Specification (Gen_Decl))) =
N_Defining_Program_Unit_Name
[multiple changes] 2004-06-11 Vincent Celier <celier@gnat.com> * mlib-tgt-vms-alpha.adb (Build_Dynamic_Library): Issue switch -R to gnatsym, when symbol policy is Restricted. * mlib-tgt-vms-ia64.adb (Build_Dynamic_Library): Issue switch -R to gnatsym, when symbol policy is Restricted. * symbols-vms-alpha.adb (Initialize): When symbol policy is Restricted, read the symbol file. (Finalize): Fail in symbol policy Restricted if a symbol in the original symbol file is not in the object files. Do not create a new symbol file when symbol policy is Restricted. * gnatbind.adb (Gnatbind): Initialize Snames, because Snames is used in Scng. * gnatsym.adb (Parse_Vmd_Line): Process new switch -R for symbol policy Restricted. (Usage): Line for new switch -R * make.adb (Initialize): When the platform is not VMS, add the directory where gnatmake is invoked in the front of the path, if gnatmake is invoked with directory information. Change the Scan_Args while loop to a for loop. (Recursive_Compute_Depth): Remove parameter Visited. Improve efficiency: if Depth is equal or greater than the proposed depth, there is nothing to do. (Initialize): Call Recursive_Compute_Depth with initial Depth equal to 1 instead of 0. * prj.ads: Add new symbol policy Restricted. * prj-dect.adb (Parse_Case_Construction): Call End_Case_Construction with the new parameters Check_All_Labels and Case_Location. * prj-nmsc.adb (Ada_Check): Process new symbol policy Restricted (Library_Symbol_File needs to be defined). * prj-strt.adb (End_Case_Construction): New parameters Check_All_Labels and Case_Location If Check_All_Labels is True, check that all values of the string type are used, and output warning(s) if they are not. * prj-strt.ads (End_Case_Construction): New parameters Check_All_Labels and Case_Location. * gnat_ugn.texi: Reorder subclauses in menus "Switches for gcc" * gnat_ugn.texi: Update documentation about the library directory in Library Projects. * makegpr.adb (Display_Command): In verbose mode, also display the value of the CPATH env var, when the compiler is gcc. (Initialize): Change the Scan_Args while loop to a for loop (Compile_Individual_Sources): Change directory to object directory before compilations. * symbols.ads: New symbol policy Restricted. 2004-06-11 Olivier Hainque <hainque@act-europe.fr> * a-except.adb (Raise_After_Setup family): Remove. The responsibility is now taken care of internally in the Exception_Propagation package and does not require clients assistance any more. * a-exexpr.adb (Is_Setup_And_Not_Propagated, Set_Setup_And_Not_Propagated, and Clear_Setup_And_Not_Propagated): New functions. Helpers to maintain a predicate required in the handling of occurrence transfer between tasks. This is now handled internally and does not require clients assistance for the setup/propagate separation anymore. (Setup_Exception, Propagate_Exception): Simplify the Private_Data allocation strategy, handle the Setup_And_Not_Propagated predicate and document. * s-taenca.adb (Check_Exception): Use raise_with_msg instead of raise_after_setup, now that everything is handled internally within the setup/propagation engine. 2004-06-11 Hristian Kirtchev <kirtchev@gnat.com> * exp_ch6.adb (Expand_Inlined_Call): Add function Formal_Is_Used_Once. Add additional conditions for the case of an actual being a simple name or literal. Improve inlining by preventing the generation of temporaries with a short lifetime (one use). 2004-06-11 Hristian Kirtchev <kirtchev@gnat.com> PR ada/15587 * einfo.ads: Minor comment updates for Has_Completion and E_Constant list of flags. * sem_ch3.adb (Analyze_Object_Declaration): Full constant declarations and constant redeclarations now set the Has_Completion flag of their defining identifiers. * sem_ch7.adb (Analyze_Package_Spec): Add procedure Inspect_Deferred_Constant_Completion. Used to detect private deferred constants that have not been completed either by a constant redeclaration or pragma Import. Emits error message "constant declaration requires initialization expression". * sem_prag.adb (Process_Import_Or_Interface): An Import pragma now completes a deferred constant. 2004-06-11 Geert Bosch <bosch@gnat.com> * eval_fat.adb (Decompose_Int): Fix rounding of negative numbers. * s-fatgen.adb (Gradual_Scaling): Correct off-by-one error in calculating exponent for scaling denormal numbers. (Leading_Part): Properly raise Constraint_Error for zero or negative Adjustment. (Remainder): Properly raise Constraint_Error for zero divisor. 2004-06-11 Thomas Quinot <quinot@act-europe.fr> * sem_util.adb: Minor reformatting. * exp_ch2.adb (Expand_Entry_Parameter): Generate an explicit dereference when accessing the entry parameter record. (Check_Array_Type): Always check for possible implicit dereference. (maybe_implicit_dereference): Rename to check_no_implicit_derefence. Abort if a pointer is still present (denoting that an implicit dereference was left in the tree by the front-end). * sem_attr.adb (Expand_Entry_Parameter): Generate an explicit dereference when accessing the entry parameter record. (Check_Array_Type): Always check for possible implicit dereference. (maybe_implicit_dereference): Rename to check_no_implicit_derefence. Abort if a pointer is still present (denoting that an implicit dereference was left in the tree by the front-end). 2004-06-11 Emmanuel Briot <briot@act-europe.fr> * g-debpoo.adb (Deallocate, Dereference): Add prefix "error:" to error message, like the compiler itself does. Easier to parse the output. * g-debpoo.ads: (Allocate, Deallocate, Dereference): Add comments. * gnat_ugn.texi (gnatxref, gnatfind): Clarify that source names should be base names, and not includes directories. 2004-06-11 Arnaud Charlet <charlet@act-europe.fr> * Makefile.generic ($(EXEC)): Depend on $(OBJECTS), not $(OBJ_FILES), so that dependencies are properly taken into account by make. 2004-06-11 Arnaud Charlet <charlet@act-europe.fr> PR ada/15622 * s-unstyp.ads, s-maccod.ads, sem_ch8.adb, s-auxdec.ads, exp_intr.adb, s-auxdec-vms_64.ads: Fix typo: instrinsic -> intrinsic 2004-06-11 Jerome Guitton <guitton@act-europe.fr> * Makefile.in (install-gnatlib): install target-specific run-time files. * Make-lang.in: Remove obsolete targets. 2004-06-11 Ed Schonberg <schonberg@gnat.com> * par-ch12.adb (P_Generic): Add scope before analyzing subprogram specification, to catch misuses of program unit names. * sem_res.adb (Resolve_Type_Conversion): Do not emit warnings on superfluous conversions in an instance. 2004-06-11 Ed Schonberg <schonberg@gnat.com> PR ada/15403 * sem_ch12.adb (Save_References): If operator node has been folded to enumeration literal, associated_node must be discarded. 2004-06-11 Jose Ruiz <ruiz@act-europe.fr> * s-stchop-vxworks.adb: Add required pragma Convention to Task_Descriptor because it is updated by a C function. From-SVN: r82973
2004-06-11 12:47:39 +02:00
and then Scope.Last > 0
then
Error_Msg_SP ("child unit allowed only at library level");
end if;
P_Aspect_Specifications (Gen_Decl);
2001-10-02 16:23:52 +02:00
end if;
Set_Generic_Formal_Declarations (Gen_Decl, Decls);
return Gen_Decl;
end P_Generic;
-------------------------------
-- 12.1 Generic Declaration --
-------------------------------
-- Parsed by P_Generic (12.1)
------------------------------------------
-- 12.1 Generic Subprogram Declaration --
------------------------------------------
-- Parsed by P_Generic (12.1)
---------------------------------------
-- 12.1 Generic Package Declaration --
---------------------------------------
-- Parsed by P_Generic (12.1)
-------------------------------
-- 12.1 Generic Formal Part --
-------------------------------
-- Parsed by P_Generic (12.1)
-------------------------------------------------
-- 12.1 Generic Formal Parameter Declaration --
-------------------------------------------------
-- Parsed by P_Generic (12.1)
---------------------------------
-- 12.3 Generic Instantiation --
---------------------------------
-- Generic package instantiation parsed by P_Package (7.1)
-- Generic procedure instantiation parsed by P_Subprogram (6.1)
-- Generic function instantiation parsed by P_Subprogram (6.1)
-------------------------------
-- 12.3 Generic Actual Part --
-------------------------------
-- GENERIC_ACTUAL_PART ::=
-- (GENERIC_ASSOCIATION {, GENERIC_ASSOCIATION})
-- Returns a list of generic associations, or Empty if none are present
-- Error recovery: cannot raise Error_Resync
function P_Generic_Actual_Part_Opt return List_Id is
Association_List : List_Id;
begin
-- Figure out if a generic actual part operation is present. Clearly
-- there is no generic actual part if the current token is semicolon
Fix typos in gcc/ada. gcc/ada/: * projects.texi: Fix typos. * gnat_rm.texi: Likewise. * gnat_ugn.texi: Likewise. * sem_util.adb: Fix typo in variable, typos in comments. * a-btgbso.adb: Fix typos in comments. * a-cbdlli.adb, a-cbhase.ads, a-cdlili.adb, a-cobove.adb, a-coinve.adb, a-convec.adb, a-direct.ads, a-strunb-shared.adb, a-strunb-shared.ads, a-stuten.ads, a-stwiun-shared.adb, a-stwiun-shared.ads, a-stzunb-shared.adb, a-stzunb-shared.ads, a-suenco.adb, a-suenst.adb, a-suewst.adb, a-suezst.adb, ali.ads, aspects.ads, atree.ads, binde.adb, bindgen.adb, checks.adb, checks.ads, einfo.ads, err_vars.ads, errout.adb, errout.ads, exp_aggr.adb, exp_attr.adb, exp_cg.adb, exp_ch3.adb, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_dbug.ads, exp_disp.adb, exp_fixd.ads, freeze.adb, g-altive.ads, g-comlin.ads, g-excact.ads, g-mbdira.adb, g-sechas.ads, g-sehash.ads, g-sha1.ads, g-sha224.ads, g-sha256.ads, g-sha384.ads, g-sha512.ads, g-shsh32.ads, g-shsh64.ads, g-socket.adb, g-socket.ads, g-sothco.ads, gcc-interface/decl.c, gcc-interface/trans.c, gcc-interface/utils2.c, gnat1drv.adb, init.c, inline.adb, link.c, locales.c, make.adb, mingw32.h, namet.ads, osint.adb, par-ch12.adb, par-ch13.adb, par-ch3.adb, par-ch4.adb, par-prag.adb, par.adb, par_sco.adb, prepcomp.adb, prj-conf.ads, prj-dect.adb, prj-env.adb, prj-env.ads, prj-nmsc.adb, prj-tree.ads, prj-util.ads, prj.adb, prj.ads, s-auxdec-vms-alpha.adb, s-auxdec-vms_64.ads, s-oscons-tmplt.c, s-osinte-vxworks.ads, s-osprim-mingw.adb, s-regexp.adb, s-stusta.adb, s-taprop-mingw.adb, s-taprop-solaris.adb, scn.adb, scos.ads, sem.adb, sem_aggr.adb, sem_attr.adb, sem_aux.adb, sem_aux.ads, sem_ch12.adb, sem_ch12.ads, sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch4.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_disp.adb, sem_disp.ads, sem_eval.adb, sem_intr.adb, sem_prag.adb, sem_res.adb, sem_scil.adb, sem_util.ads, sem_warn.adb, sem_warn.ads, sinfo.ads, socket.c, styleg.adb, switch.ads, sysdep.c, tb-alvxw.c, xoscons.adb: Likewise. From-SVN: r168082
2010-12-20 08:26:57 +01:00
-- or if we have aspect specifications present.
2001-10-02 16:23:52 +02:00
if Token = Tok_Semicolon or else Aspect_Specifications_Present then
2001-10-02 16:23:52 +02:00
return No_List;
-- If we don't have a left paren, then we have an error, and the job
-- is to figure out whether a left paren or semicolon was intended.
-- We assume a missing left paren (and hence a generic actual part
-- present) if the current token is not on a new line, or if it is
-- indented from the subprogram token. Otherwise assume missing
-- semicolon (which will be diagnosed by caller) and no generic part
elsif Token /= Tok_Left_Paren
and then Token_Is_At_Start_Of_Line
and then Start_Column <= Scope.Table (Scope.Last).Ecol
then
return No_List;
-- Otherwise we have a generic actual part (either a left paren is
-- present, or we have decided that there must be a missing left paren)
else
Association_List := New_List;
T_Left_Paren;
loop
Append (P_Generic_Association, Association_List);
exit when not Comma_Present;
end loop;
T_Right_Paren;
return Association_List;
end if;
end P_Generic_Actual_Part_Opt;
-------------------------------
-- 12.3 Generic Association --
-------------------------------
-- GENERIC_ASSOCIATION ::=
-- [generic_formal_parameter_SELECTOR_NAME =>]
-- EXPLICIT_GENERIC_ACTUAL_PARAMETER
-- EXPLICIT_GENERIC_ACTUAL_PARAMETER ::=
-- EXPRESSION | variable_NAME | subprogram_NAME
-- | entry_NAME | SUBTYPE_MARK | package_instance_NAME
-- Error recovery: cannot raise Error_Resync
function P_Generic_Association return Node_Id is
Scan_State : Saved_Scan_State;
Param_Name_Node : Node_Id;
Generic_Assoc_Node : Node_Id;
begin
Generic_Assoc_Node := New_Node (N_Generic_Association, Token_Ptr);
-- Ada 2005: an association can be given by: others => <>
if Token = Tok_Others then
if Ada_Version < Ada_2005 then
Error_Msg_SP
("partial parameterization of formal packages"
& " is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
end if;
Scan; -- past OTHERS
if Token /= Tok_Arrow then
Error_Msg_BC ("expect arrow after others");
else
Scan; -- past arrow
end if;
if Token /= Tok_Box then
Error_Msg_BC ("expect Box after arrow");
else
Scan; -- past box
end if;
-- Source position of the others choice is beginning of construct
return New_Node (N_Others_Choice, Sloc (Generic_Assoc_Node));
end if;
2001-10-02 16:23:52 +02:00
if Token in Token_Class_Desig then
Param_Name_Node := Token_Node;
Save_Scan_State (Scan_State); -- at designator
Scan; -- past simple name or operator symbol
if Token = Tok_Arrow then
Scan; -- past arrow
Set_Selector_Name (Generic_Assoc_Node, Param_Name_Node);
else
Restore_Scan_State (Scan_State); -- to designator
end if;
end if;
s-intman-irix.adb, [...]: Minor reformatting 2007-08-14 Robert Dewar <dewar@adacore.com> * s-intman-irix.adb, s-osinte-irix.adb, s-osinte-irix.ads, s-proinf-irix-athread.ads, s-osinte-hpux-dce.adb, s-osinte-hpux-dce.ads, s-parame-hpux.ads, s-intman-dummy.adb, s-tasinf-solaris.adb, s-tasinf-solaris.ads, s-asthan-vms-alpha.adb, s-inmaop-vms.adb, s-intman-vms.adb, s-intman-vms.ads, s-osprim-mingw.adb, s-parame-vms-restrict.ads, s-parame-ae653.ads, s-intman-vxworks.ads, s-intman-vxworks.ads, s-intman-vxworks.adb, s-parame-vxworks.ads, s-tfsetr-vxworks.adb, s-interr.adb, s-interr.ads, a-tasatt.adb, exp_ch13.adb, s-htable.ads, s-imgboo.ads, s-imglli.ads, s-imgllu.ads, s-imguns.ads, g-eacodu.adb, par-ch12.adb, s-stache.ads, s-stausa.adb, s-poosiz.adb, s-parame.ads, s-mastop.ads, s-osinte-darwin.ads, a-chtgke.adb, s-asthan-vms-alpha.adb, s-parame-vms-alpha.ads, s-parame-vms-ia64.ads, s-parame-vxworks.adb, s-except.ads, g-altcon.adb: Minor reformatting ada-tree.h: Delete empty line. ali.ads: Minor reformatting Clarification of comments. Minor spelling correction * exp_dbug.adb: Add Warnings Off to suppress new warning * a-witeio.adb (Write): Add Warnings (Off) for unneeded IN OUT mode formal * a-strunb.adb (Set_Unbounded_String): Avoid memory leak by freeing old value * a-textio.adb (Write): Remove an unnecessary IN OUT mode from * a-textio.ads: Reorder the standard input/output/error declarations for consistency. * g-dirope.adb, g-dirope.ads: Change Dir to mode IN for Open call * par-ch2.adb: Recognize RM specially in errout Change 'R'M to RM in all error messages * scng.adb: Recognize RM specially in errout * sem.ads, sem.adb, exp_strm.adb, exp_ch5.ads, expander.adb: Rename N_Return node to be N_Simple_Return, to reflect Ada 2005 terminology. * s-direio.adb: Add missing routine header box. * sem_attr.ads: Add ??? comments * sem_eval.adb: Recognize RM specially in errout Change 'R'M to RM in all error messages * sem_maps.adb, sem_maps.ads: Remove some unnecessary IN OUT modes * s-tasinf.ads: Fix minor comment typo. * a-cihama.adb: Minor comment addition * a-ztexio.adb (Write): Add Warnings (Off) for unneeded IN OUT mode formal * s-tasinf-tru64.ads: Fix minor comment typo. * itypes.ads: Comment update. * ali-util.adb: Remove Generic_Separately_Compiled guard, not needed anymore. * argv.c: Added protection against null gnat_argv and gnat_envp. * bcheck.adb (Check_Consistency): Use correct markup character ({) in warning message when Tolerate_Consistency_Errors is True. * cstand.adb (Create_Standard): Do not call Init_Size_Alignment for Any_Id, as this subprogram is only applicable to *type* entities (it sets RM_Size). Instead initialize just Esize and Alignment. From-SVN: r127440
2007-08-14 10:45:25 +02:00
-- In Ada 2005 the actual can be a box
if Token = Tok_Box then
Scan;
Set_Box_Present (Generic_Assoc_Node);
Set_Explicit_Generic_Actual_Parameter (Generic_Assoc_Node, Empty);
else
Set_Explicit_Generic_Actual_Parameter
(Generic_Assoc_Node, P_Expression);
end if;
2001-10-02 16:23:52 +02:00
return Generic_Assoc_Node;
end P_Generic_Association;
---------------------------------------------
-- 12.3 Explicit Generic Actual Parameter --
---------------------------------------------
-- Parsed by P_Generic_Association (12.3)
--------------------------------------
-- 12.4 Formal Object Declarations --
--------------------------------------
-- FORMAL_OBJECT_DECLARATION ::=
-- DEFINING_IDENTIFIER_LIST :
-- MODE [NULL_EXCLUSION] SUBTYPE_MARK [:= DEFAULT_EXPRESSION]
-- [ASPECT_SPECIFICATIONS];
-- | DEFINING_IDENTIFIER_LIST :
-- MODE ACCESS_DEFINITION [:= DEFAULT_EXPRESSION];
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
-- The caller has checked that the initial token is an identifier
-- Error recovery: cannot raise Error_Resync
procedure P_Formal_Object_Declarations (Decls : List_Id) is
Decl_Node : Node_Id;
Ident : Nat;
Not_Null_Present : Boolean := False;
Num_Idents : Nat;
Scan_State : Saved_Scan_State;
2001-10-02 16:23:52 +02:00
Idents : array (Int range 1 .. 4096) of Entity_Id;
-- This array holds the list of defining identifiers. The upper bound
-- of 4096 is intended to be essentially infinite, and we do not even
-- bother to check for it being exceeded.
begin
Idents (1) := P_Defining_Identifier (C_Comma_Colon);
2001-10-02 16:23:52 +02:00
Num_Idents := 1;
while Comma_Present loop
Num_Idents := Num_Idents + 1;
Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
2001-10-02 16:23:52 +02:00
end loop;
T_Colon;
-- If there are multiple identifiers, we repeatedly scan the
-- type and initialization expression information by resetting
-- the scan pointer (so that we get completely separate trees
-- for each occurrence).
if Num_Idents > 1 then
Save_Scan_State (Scan_State);
end if;
-- Loop through defining identifiers in list
Ident := 1;
Ident_Loop : loop
Decl_Node := New_Node (N_Formal_Object_Declaration, Token_Ptr);
Set_Defining_Identifier (Decl_Node, Idents (Ident));
P_Mode (Decl_Node);
Not_Null_Present := P_Null_Exclusion; -- Ada 2005 (AI-423)
-- Ada 2005 (AI-423): Formal object with an access definition
if Token = Tok_Access then
-- The access definition is still parsed and set even though
-- the compilation may not use the proper switch. This action
-- ensures the required local error recovery.
Set_Access_Definition (Decl_Node,
P_Access_Definition (Not_Null_Present));
if Ada_Version < Ada_2005 then
Error_Msg_SP
("access definition not allowed in formal object " &
"declaration");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
-- Formal object with a subtype mark
else
Set_Null_Exclusion_Present (Decl_Node, Not_Null_Present);
Set_Subtype_Mark (Decl_Node, P_Subtype_Mark_Resync);
end if;
2001-10-02 16:23:52 +02:00
No_Constraint;
Set_Default_Expression (Decl_Node, Init_Expr_Opt);
P_Aspect_Specifications (Decl_Node);
2001-10-02 16:23:52 +02:00
if Ident > 1 then
Set_Prev_Ids (Decl_Node, True);
end if;
if Ident < Num_Idents then
Set_More_Ids (Decl_Node, True);
end if;
Append (Decl_Node, Decls);
exit Ident_Loop when Ident = Num_Idents;
Ident := Ident + 1;
Restore_Scan_State (Scan_State);
end loop Ident_Loop;
end P_Formal_Object_Declarations;
-----------------------------------
-- 12.5 Formal Type Declaration --
-----------------------------------
-- FORMAL_TYPE_DECLARATION ::=
-- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
-- is FORMAL_TYPE_DEFINITION
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
-- The caller has checked that the initial token is TYPE
-- Error recovery: cannot raise Error_Resync
function P_Formal_Type_Declaration return Node_Id is
Decl_Node : Node_Id;
Def_Node : Node_Id;
2001-10-02 16:23:52 +02:00
begin
Decl_Node := New_Node (N_Formal_Type_Declaration, Token_Ptr);
Scan; -- past TYPE
Set_Defining_Identifier (Decl_Node, P_Defining_Identifier);
if P_Unknown_Discriminant_Part_Opt then
Set_Unknown_Discriminants_Present (Decl_Node, True);
else
Set_Discriminant_Specifications
(Decl_Node, P_Known_Discriminant_Part_Opt);
end if;
[multiple changes] 2011-08-29 Matthew Heaney <heaney@adacore.com> * a-comutr.adb, a-cimutr.adb, a-cbmutr.adb (Splice_Subtree): Only check for sibling when common parent. 2011-08-29 Thomas Quinot <quinot@adacore.com> * get_scos.adb: Literals of Pragma_Id are pragma names prefixed with "pragma_". 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Enable freeze actions for the return type when in ASIS mode. 2011-08-29 Vincent Celier <celier@adacore.com> * make.adb (Gnatmake): Get the default search dirs, then the target parameters after getting the Builder switches, as the Builder switches may include --RTS= and that could change the default search dirs. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Make_Adjust_Call): Rewrite to mimic the structure of Make_Final_Call. Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. (Make_Final_Call): Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. * s-stposu.adb (Allocate_Any_Controlled): Correct the membership check. Add code to account for alignments larger than the list header. Add a comment illustrating the structure of the allocated object + padding + header. (Deallocate_Any_Controlled): Add code to account for alignments larger than the list header. 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New node kind N_Formal_Incomplete_Type_Definition, related flags. par-ch12.adb (P_Formal_Type_Declaration, G_Formal_Type_Definition): Parse formal incomplete types. * sem.adb (Analyze): Formal_Incomplete_Type_Definitions are handled in sem_ch12. * sem_ch7.adb (Analyze_Package_Specification, Unit_Requires_Body): Formal incomplete types do not need completion. * sem_ch12.adb (Analyze_Formal_Incomplete_Type, Validate_Incomplete_Type_Instance): New procedures to handle formal incomplete types. * freeze.adb (Freeze_Entity): Do not freeze the subtype of an actual that corresponds to a formal incomplete type. * sprint.adb: Handle formal incomplete type declarations. * exp_util.adb (Insert_Actions): An incomplete_type_definition is not an insertion point. From-SVN: r178184
2011-08-29 12:02:08 +02:00
if Token = Tok_Semicolon then
-- Ada 2012: Incomplete formal type
[multiple changes] 2011-08-29 Matthew Heaney <heaney@adacore.com> * a-comutr.adb, a-cimutr.adb, a-cbmutr.adb (Splice_Subtree): Only check for sibling when common parent. 2011-08-29 Thomas Quinot <quinot@adacore.com> * get_scos.adb: Literals of Pragma_Id are pragma names prefixed with "pragma_". 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Enable freeze actions for the return type when in ASIS mode. 2011-08-29 Vincent Celier <celier@adacore.com> * make.adb (Gnatmake): Get the default search dirs, then the target parameters after getting the Builder switches, as the Builder switches may include --RTS= and that could change the default search dirs. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Make_Adjust_Call): Rewrite to mimic the structure of Make_Final_Call. Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. (Make_Final_Call): Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. * s-stposu.adb (Allocate_Any_Controlled): Correct the membership check. Add code to account for alignments larger than the list header. Add a comment illustrating the structure of the allocated object + padding + header. (Deallocate_Any_Controlled): Add code to account for alignments larger than the list header. 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New node kind N_Formal_Incomplete_Type_Definition, related flags. par-ch12.adb (P_Formal_Type_Declaration, G_Formal_Type_Definition): Parse formal incomplete types. * sem.adb (Analyze): Formal_Incomplete_Type_Definitions are handled in sem_ch12. * sem_ch7.adb (Analyze_Package_Specification, Unit_Requires_Body): Formal incomplete types do not need completion. * sem_ch12.adb (Analyze_Formal_Incomplete_Type, Validate_Incomplete_Type_Instance): New procedures to handle formal incomplete types. * freeze.adb (Freeze_Entity): Do not freeze the subtype of an actual that corresponds to a formal incomplete type. * sprint.adb: Handle formal incomplete type declarations. * exp_util.adb (Insert_Actions): An incomplete_type_definition is not an insertion point. From-SVN: r178184
2011-08-29 12:02:08 +02:00
Scan; -- past semicolon
Error_Msg_Ada_2012_Feature
("formal incomplete type", Sloc (Decl_Node));
[multiple changes] 2011-08-29 Matthew Heaney <heaney@adacore.com> * a-comutr.adb, a-cimutr.adb, a-cbmutr.adb (Splice_Subtree): Only check for sibling when common parent. 2011-08-29 Thomas Quinot <quinot@adacore.com> * get_scos.adb: Literals of Pragma_Id are pragma names prefixed with "pragma_". 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Enable freeze actions for the return type when in ASIS mode. 2011-08-29 Vincent Celier <celier@adacore.com> * make.adb (Gnatmake): Get the default search dirs, then the target parameters after getting the Builder switches, as the Builder switches may include --RTS= and that could change the default search dirs. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Make_Adjust_Call): Rewrite to mimic the structure of Make_Final_Call. Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. (Make_Final_Call): Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. * s-stposu.adb (Allocate_Any_Controlled): Correct the membership check. Add code to account for alignments larger than the list header. Add a comment illustrating the structure of the allocated object + padding + header. (Deallocate_Any_Controlled): Add code to account for alignments larger than the list header. 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New node kind N_Formal_Incomplete_Type_Definition, related flags. par-ch12.adb (P_Formal_Type_Declaration, G_Formal_Type_Definition): Parse formal incomplete types. * sem.adb (Analyze): Formal_Incomplete_Type_Definitions are handled in sem_ch12. * sem_ch7.adb (Analyze_Package_Specification, Unit_Requires_Body): Formal incomplete types do not need completion. * sem_ch12.adb (Analyze_Formal_Incomplete_Type, Validate_Incomplete_Type_Instance): New procedures to handle formal incomplete types. * freeze.adb (Freeze_Entity): Do not freeze the subtype of an actual that corresponds to a formal incomplete type. * sprint.adb: Handle formal incomplete type declarations. * exp_util.adb (Insert_Actions): An incomplete_type_definition is not an insertion point. From-SVN: r178184
2011-08-29 12:02:08 +02:00
Set_Formal_Type_Definition
(Decl_Node,
[multiple changes] 2011-08-29 Robert Dewar <dewar@adacore.com> * exp_ch5.adb, sinfo.ads, make.adb, s-pooglo.adb, sem_ch12.adb, freeze.adb, sem_ch6.adb, par-ch12.adb: Minor reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * system-darwin-x86.ads, system-linux-s390x.ads, system-linux-alpha.ads, system-tru64.ads, system-irix-n32.ads, system-vxworks-arm.ads, system-linux-hppa.ads, system-linux-s390.ads, system-solaris-sparcv9.ads, system-mingw.ads, system-linux-ia64.ads, system-vms_64.ads, system-vxworks-sparcv9.ads, system-linux-ppc.ads, system-aix64.ads, system-lynxos-ppc.ads, system-linux-sh4.ads, system-solaris-x86.ads, system-linux-x86_64.ads, system-linux-x86.ads, system-vxworks-ppc.ads, system-hpux.ads, system-darwin-ppc.ads, system-solaris-sparc.ads, system-lynxos-x86.ads, system-vxworks-m68k.ads, system-hpux-ia64.ads, system-irix-o32.ads, system-solaris-x86_64.ads, system-mingw-x86_64.ads, system-vxworks-mips.ads, system-linux-sparc.ads, system-vms-ia64.ads, system-freebsd-x86.ads, system-aix.ads, system-darwin-x86_64.ads, system-vxworks-x86.ads: Remove GCC_ZCX_Support * s-taprop-posix.adb, s-taprop-irix.adb, s-taprop-vxworks.adb, s-taprop-tru64.adb, s-taprop-linux.adb, s-taprop-solaris.adb: Ditto. * opt.ads: Adjust comment. * targparm.ads, targparm.adb: Remove GCC_ZCX_Support_On_Target. * gnat1drv.adb: Do not check for GCC_ZCX_Support_On_Target. * system.ads: Move GCC_ZCX_Support to obsolete entries. 2011-08-29 Emmanuel Briot <briot@adacore.com> * makeutl.adb (Do_Complete): Resolve symbolic links when a relative file name is specified on the gnatmake or gprbuild command line, and before we search for that file in the project. 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sem_type.adb (Within_Instance): New predicate in Collect_Interps, used to determine whether a possible interpretation for an overloadable entity is declared within the current instantiation and should be included in the candidate set. 2011-08-29 Vasiliy Fofanov <fofanov@adacore.com> * gnat_rm.texi, gnat_ugn.texi: Clean ups. From-SVN: r178186
2011-08-29 12:14:45 +02:00
New_Node (N_Formal_Incomplete_Type_Definition, Token_Ptr));
[multiple changes] 2011-08-29 Matthew Heaney <heaney@adacore.com> * a-comutr.adb, a-cimutr.adb, a-cbmutr.adb (Splice_Subtree): Only check for sibling when common parent. 2011-08-29 Thomas Quinot <quinot@adacore.com> * get_scos.adb: Literals of Pragma_Id are pragma names prefixed with "pragma_". 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Enable freeze actions for the return type when in ASIS mode. 2011-08-29 Vincent Celier <celier@adacore.com> * make.adb (Gnatmake): Get the default search dirs, then the target parameters after getting the Builder switches, as the Builder switches may include --RTS= and that could change the default search dirs. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Make_Adjust_Call): Rewrite to mimic the structure of Make_Final_Call. Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. (Make_Final_Call): Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. * s-stposu.adb (Allocate_Any_Controlled): Correct the membership check. Add code to account for alignments larger than the list header. Add a comment illustrating the structure of the allocated object + padding + header. (Deallocate_Any_Controlled): Add code to account for alignments larger than the list header. 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New node kind N_Formal_Incomplete_Type_Definition, related flags. par-ch12.adb (P_Formal_Type_Declaration, G_Formal_Type_Definition): Parse formal incomplete types. * sem.adb (Analyze): Formal_Incomplete_Type_Definitions are handled in sem_ch12. * sem_ch7.adb (Analyze_Package_Specification, Unit_Requires_Body): Formal incomplete types do not need completion. * sem_ch12.adb (Analyze_Formal_Incomplete_Type, Validate_Incomplete_Type_Instance): New procedures to handle formal incomplete types. * freeze.adb (Freeze_Entity): Do not freeze the subtype of an actual that corresponds to a formal incomplete type. * sprint.adb: Handle formal incomplete type declarations. * exp_util.adb (Insert_Actions): An incomplete_type_definition is not an insertion point. From-SVN: r178184
2011-08-29 12:02:08 +02:00
return Decl_Node;
else
T_Is;
end if;
2001-10-02 16:23:52 +02:00
Def_Node := P_Formal_Type_Definition;
if Nkind (Def_Node) = N_Formal_Incomplete_Type_Definition then
Error_Msg_Ada_2012_Feature
("formal incomplete type", Sloc (Decl_Node));
[multiple changes] 2011-08-29 Matthew Heaney <heaney@adacore.com> * a-comutr.adb, a-cimutr.adb, a-cbmutr.adb (Splice_Subtree): Only check for sibling when common parent. 2011-08-29 Thomas Quinot <quinot@adacore.com> * get_scos.adb: Literals of Pragma_Id are pragma names prefixed with "pragma_". 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Enable freeze actions for the return type when in ASIS mode. 2011-08-29 Vincent Celier <celier@adacore.com> * make.adb (Gnatmake): Get the default search dirs, then the target parameters after getting the Builder switches, as the Builder switches may include --RTS= and that could change the default search dirs. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Make_Adjust_Call): Rewrite to mimic the structure of Make_Final_Call. Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. (Make_Final_Call): Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. * s-stposu.adb (Allocate_Any_Controlled): Correct the membership check. Add code to account for alignments larger than the list header. Add a comment illustrating the structure of the allocated object + padding + header. (Deallocate_Any_Controlled): Add code to account for alignments larger than the list header. 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New node kind N_Formal_Incomplete_Type_Definition, related flags. par-ch12.adb (P_Formal_Type_Declaration, G_Formal_Type_Definition): Parse formal incomplete types. * sem.adb (Analyze): Formal_Incomplete_Type_Definitions are handled in sem_ch12. * sem_ch7.adb (Analyze_Package_Specification, Unit_Requires_Body): Formal incomplete types do not need completion. * sem_ch12.adb (Analyze_Formal_Incomplete_Type, Validate_Incomplete_Type_Instance): New procedures to handle formal incomplete types. * freeze.adb (Freeze_Entity): Do not freeze the subtype of an actual that corresponds to a formal incomplete type. * sprint.adb: Handle formal incomplete type declarations. * exp_util.adb (Insert_Actions): An incomplete_type_definition is not an insertion point. From-SVN: r178184
2011-08-29 12:02:08 +02:00
end if;
if Def_Node /= Error then
Set_Formal_Type_Definition (Decl_Node, Def_Node);
P_Aspect_Specifications (Decl_Node);
s-stalib.adb: Add more comments on with statements being needed * s-stalib.adb: Add more comments on with statements being needed * par-ch12.adb: Minor reformatting * prj-dect.ads: Fix copyright header * s-arit64.adb (Multiply_With_Ovflo_Check): Fix case where both inputs fit in 32 bits, but the result still overflows. * s-fatgen.ads: Minor comment improvement * sem_ch4.adb (Analyze_Selected_Component): If the prefix is of a formal derived type, look for an inherited component from the full view of the parent, if any. * checks.ads (Apply_Alignment_Check): New procedure. * exp_ch13.adb (Expand_N_Freeze_Entity): Generate dynamic check to ensure that the alignment of objects with address clauses is appropriate, and raise PE if not. * exp_util.ads (Must_Be_Aligned): Removed, replaced by Exp_Pakd.Known_Aligned_Enough * mdllfile.ads: Minor reformatting * mlib-fil.ads: Minor reformatting * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): Extend previous fix to any component reference if enclosing record has non-standard representation. * g-dirope.ads (Find, Wildcard_Iterator): Moved to child package Iteration * freeze.ads: Make Freeze_Fixed_Point_Type visible, for use in sem_attr. * impunit.adb: Add entry for GNAT.Directory_Operations.Iteration * g-regexp.adb: Remove all debug code, since it isn't required anymore, and it adds dependencies to system.io. * g-dirope.adb (Expand_Path.Var): Correctly detect end of variable name. *** s-stalib.adb 2001/09/03 15:24:33 1.17 --- s-stalib.adb 2001/10/16 13:14:46 1.18 *************** *** 46,59 **** -- elaboration circularities with Ada.Exceptions if polling is on. with System.Soft_Links; ! -- Referenced directly from generated code ! -- Also referenced from exception handling routines. -- This is needed for programs that don't use exceptions explicitely but -- direct calls to Ada.Exceptions are generated by gigi (for example, -- by calling __gnat_raise_constraint_error directly). with System.Memory; ! -- Referenced directly from generated code package body System.Standard_Library is --- 46,62 ---- -- elaboration circularities with Ada.Exceptions if polling is on. with System.Soft_Links; ! -- Referenced directly from generated code using external symbols so it ! -- must always be present in a build, even if no unit has a direct with ! -- of this unit. Also referenced from exception handling routines. -- This is needed for programs that don't use exceptions explicitely but -- direct calls to Ada.Exceptions are generated by gigi (for example, -- by calling __gnat_raise_constraint_error directly). with System.Memory; ! -- Referenced directly from generated code using external symbols, so it ! -- must always be present in a build, even if no unit has a direct with ! -- of this unit. package body System.Standard_Library is *** par-ch12.adb 2001/10/19 15:22:18 1.48 --- par-ch12.adb 2001/10/19 15:24:48 1.49 *************** *** 452,466 **** if Def_Node /= Error then Set_Formal_Type_Definition (Decl_Node, Def_Node); TF_Semicolon; else Decl_Node := Error; if Token = Tok_Semicolon then - -- Avoid further cascaded errors. Scan; end if; end if; - return Decl_Node; end P_Formal_Type_Declaration; --- 452,467 ---- if Def_Node /= Error then Set_Formal_Type_Definition (Decl_Node, Def_Node); TF_Semicolon; + else Decl_Node := Error; + -- If we have semicolon, skip it to avoid cascaded errors + if Token = Tok_Semicolon then Scan; end if; end if; return Decl_Node; end P_Formal_Type_Declaration; *** prj-dect.ads 2001/10/20 10:28:13 1.4 --- prj-dect.ads 2001/10/20 11:43:56 1.5 *************** *** 8,14 **** -- -- -- $Revision$ -- -- ! -- Copyright (C) 2000-2001 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- -- --- 8,14 ---- -- -- -- $Revision$ -- -- ! -- Copyright (C) 2001 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- -- *** s-arit64.adb 2001/02/09 15:10:29 1.16 --- s-arit64.adb 2001/10/20 14:50:39 1.17 *************** *** 325,337 **** T2 := Xhi * Ylo; end if; ! else ! if Yhi /= 0 then ! T2 := Xlo * Yhi; ! else ! return X * Y; ! end if; end if; T1 := Xlo * Ylo; T2 := T2 + Hi (T1); --- 325,339 ---- T2 := Xhi * Ylo; end if; ! elsif Yhi /= 0 then ! T2 := Xlo * Yhi; ! ! else -- Yhi = Xhi = 0 ! T2 := 0; end if; + + -- Here we have T2 set to the contribution to the upper half + -- of the result from the upper halves of the input values. T1 := Xlo * Ylo; T2 := T2 + Hi (T1); *** s-fatgen.ads 2001/07/20 00:59:34 1.9 --- s-fatgen.ads 2001/10/20 18:37:39 1.10 *************** *** 89,97 **** function Unbiased_Rounding (X : T) return T; ! function Valid (X : access T) return Boolean; ! -- The argument must be passed by reference here, as T may be ! -- an abnormal value that can be passed in a floating point register. private pragma Inline (Machine); --- 89,100 ---- function Unbiased_Rounding (X : T) return T; ! function Valid (X : access T) return Boolean; ! -- This function checks if the object of type T referenced by X ! -- is valid, and returns True/False accordingly. The parameter is ! -- passed by reference (access) here, as the object of type T may ! -- be an abnormal value that cannot be passed in a floating-point ! -- register, and the whole point of 'Valid is to prevent exceptions. private pragma Inline (Machine); *** sem_ch4.adb 2001/09/24 22:32:31 1.511 --- sem_ch4.adb 2001/10/21 17:41:52 1.512 *************** *** 2691,2696 **** --- 2691,2708 ---- Check_Misspelled_Selector (Entity_List, Sel); + elsif Is_Generic_Type (Prefix_Type) + and then Ekind (Prefix_Type) = E_Record_Type_With_Private + and then Is_Record_Type (Etype (Prefix_Type)) + then + -- If this is a derived formal type, the parent may have a + -- different visibility at this point. Try for an inherited + -- component before reporting an error. + + Set_Etype (Prefix (N), Etype (Prefix_Type)); + Analyze_Selected_Component (N); + return; + else if Ekind (Prefix_Type) = E_Record_Subtype then *** checks.ads 2001/07/16 01:26:04 1.55 --- checks.ads 2001/10/28 15:13:02 1.56 *************** *** 83,88 **** --- 83,95 ---- -- the object denoted by the access parameter is not deeper than the -- level of the type Typ. Program_Error is raised if the check fails. + procedure Apply_Alignment_Check (E : Entity_Id; N : Node_Id); + -- E is the entity for an object. If there is an address clause for + -- this entity, and checks are enabled, then this procedure generates + -- a check that the specified address has an alignment consistent with + -- the alignment of the object, raising PE if this is not the case. The + -- resulting check (if one is generated) is inserted before node N. + procedure Apply_Array_Size_Check (N : Node_Id; Typ : Entity_Id); -- N is the node for an object declaration that declares an object of -- array type Typ. This routine generates, if necessary, a check that *** exp_ch13.adb 2001/07/16 21:21:29 1.76 --- exp_ch13.adb 2001/10/28 15:13:25 1.77 *************** *** 27,32 **** --- 27,33 ---- ------------------------------------------------------------------------------ with Atree; use Atree; + with Checks; use Checks; with Einfo; use Einfo; with Exp_Ch3; use Exp_Ch3; with Exp_Ch6; use Exp_Ch6; *************** *** 236,245 **** Decl : Node_Id; begin ! if not Is_Type (E) and then not Is_Subprogram (E) then return; end if; E_Scope := Scope (E); -- If we are freezing entities defined in protected types, they --- 237,256 ---- Decl : Node_Id; begin ! -- For object, with address clause, check alignment is OK ! ! if Is_Object (E) then ! Apply_Alignment_Check (E, N); ! ! -- Only other items requiring any front end action are ! -- types and subprograms. ! ! elsif not Is_Type (E) and then not Is_Subprogram (E) then return; end if; + -- Here E is a type or a subprogram + E_Scope := Scope (E); -- If we are freezing entities defined in protected types, they *************** *** 304,314 **** elsif Is_Subprogram (E) then Freeze_Subprogram (N); - - -- No other entities require any front end freeze actions - - else - null; end if; -- Analyze actions generated by freezing. The init_proc contains --- 315,320 ---- *** exp_util.ads 2001/07/23 10:05:17 1.112 --- exp_util.ads 2001/10/28 15:14:04 1.113 *************** *** 372,386 **** -- routine is to help avoid generating troublesome temporaries that -- intefere with the stack checking mechanism. - function Must_Be_Aligned (Obj : Node_Id) return Boolean; - -- Given an object reference, determines whether or not the object - -- is required to be aligned according to its type'alignment value. - -- Normally, objects are required to be aligned, and the result will - -- be True. The situation in which this is not the case is if the - -- object reference involves a component of a packed array, where - -- the type of the component is not required to have strict alignment. - -- In this case, false will be returned. - procedure Remove_Side_Effects (Exp : Node_Id; Name_Req : Boolean := False; --- 372,377 ---- *** mdllfile.ads 2001/10/29 02:06:24 1.2 --- mdllfile.ads 2001/10/29 02:50:12 1.3 *************** *** 26,52 **** -- -- ------------------------------------------------------------------------------ ! -- Simple services used by GNATDLL to deal with Filename extension. package MDLL.Files is No_Ext : constant String := ""; ! function Get_Ext (Filename : in String) ! return String; ! -- return filename's extension. ! ! function Is_Ali (Filename : in String) ! return Boolean; ! -- test if Filename is an Ada library file (.ali). ! ! function Is_Obj (Filename : in String) ! return Boolean; ! -- test if Filename is an object file (.o or .obj). ! ! function Ext_To (Filename : in String; ! New_Ext : in String := No_Ext) ! return String; ! -- return Filename with the extension change to New_Ext. end MDLL.Files; --- 26,51 ---- -- -- ------------------------------------------------------------------------------ ! -- Simple services used by GNATDLL to deal with Filename extension package MDLL.Files is No_Ext : constant String := ""; + -- Used to mark the absence of an extension ! function Get_Ext (Filename : String) return String; ! -- Return extension of Filename ! ! function Is_Ali (Filename : String) return Boolean; ! -- Test if Filename is an Ada library file (.ali). ! ! function Is_Obj (Filename : String) return Boolean; ! -- Test if Filename is an object file (.o or .obj) ! ! function Ext_To ! (Filename : String; ! New_Ext : String := No_Ext) ! return String; ! -- Return Filename with the extension change to New_Ext end MDLL.Files; *** mlib-fil.ads 2001/10/29 02:06:26 1.3 --- mlib-fil.ads 2001/10/29 02:51:28 1.4 *************** *** 36,51 **** return String; -- Return Filename with the extension change to New_Ext. ! function Get_Ext (Filename : in String) return String; -- Return extension of filename. function Is_Archive (Filename : String) return Boolean; -- Test if filename is an archive ! function Is_C (Filename : in String) return Boolean; -- Test if Filename is a C file ! function Is_Obj (Filename : in String) return Boolean; -- Test if Filename is an object file end MLib.Fil; --- 36,51 ---- return String; -- Return Filename with the extension change to New_Ext. ! function Get_Ext (Filename : String) return String; -- Return extension of filename. function Is_Archive (Filename : String) return Boolean; -- Test if filename is an archive ! function Is_C (Filename : String) return Boolean; -- Test if Filename is a C file ! function Is_Obj (Filename : String) return Boolean; -- Test if Filename is an object file end MLib.Fil; *** exp_ch8.adb 2001/10/03 02:17:32 1.30 --- exp_ch8.adb 2001/10/29 17:32:24 1.31 *************** *** 59,65 **** -- of the renamed object. The cases in which this is not true are when -- this address is not computable, since it involves extraction of a -- packed array element, or of a record component to which a component ! -- clause applies (that can specify an arbitrary bit boundary). -- In these two cases, we pre-evaluate the renaming expression, by -- extracting and freezing the values of any subscripts, and then we --- 59,66 ---- -- of the renamed object. The cases in which this is not true are when -- this address is not computable, since it involves extraction of a -- packed array element, or of a record component to which a component ! -- clause applies (that can specify an arbitrary bit boundary), or where ! -- the enclosing record itself has a non-standard representation. -- In these two cases, we pre-evaluate the renaming expression, by -- extracting and freezing the values of any subscripts, and then we *************** *** 211,228 **** end if; elsif Nkind (Nam) = N_Selected_Component then ! if Present (Component_Clause (Entity (Selector_Name (Nam)))) then ! return True; ! elsif Ekind (Entity (Selector_Name (Nam))) = E_Discriminant ! and then Is_Record_Type (Etype (Prefix (Nam))) ! and then not Is_Concurrent_Record_Type (Etype (Prefix (Nam))) ! then ! return True; ! else ! return Evaluation_Required (Prefix (Nam)); ! end if; else return False; --- 212,236 ---- end if; elsif Nkind (Nam) = N_Selected_Component then ! declare ! Rec_Type : Entity_Id := Etype (Prefix (Nam)); ! begin ! if Present (Component_Clause (Entity (Selector_Name (Nam)))) ! or else Has_Non_Standard_Rep (Rec_Type) ! then ! return True; ! ! elsif Ekind (Entity (Selector_Name (Nam))) = E_Discriminant ! and then Is_Record_Type (Rec_Type) ! and then not Is_Concurrent_Record_Type (Rec_Type) ! then ! return True; ! else ! return Evaluation_Required (Prefix (Nam)); ! end if; ! end; else return False; *** g-dirope.ads 2001/08/27 09:48:38 1.12 --- g-dirope.ads 2001/10/29 19:18:13 1.13 *************** *** 38,43 **** --- 38,47 ---- -- can be treated as a file, using open and close routines, and a scanning -- routine is provided for iterating through the entries in a directory. + -- See also child package GNAT.Directory_Operations.Iteration + + with Ada.Strings.Maps; + package GNAT.Directory_Operations is subtype Dir_Name_Str is String; *************** *** 187,248 **** -- returned in target-OS form. Raises Directory_Error if Dir has not -- be opened (Dir = Null_Dir). - generic - with procedure Action - (Item : String; - Index : Positive; - Quit : in out Boolean); - procedure Wildcard_Iterator (Path : Path_Name); - -- Calls Action for each path matching Path. Path can include wildcards '*' - -- and '?' and [...]. The rules are: - -- - -- * can be replaced by any sequence of characters - -- ? can be replaced by a single character - -- [a-z] match one character in the range 'a' through 'z' - -- [abc] match either character 'a', 'b' or 'c' - -- - -- Item is the filename that has been matched. Index is set to one for the - -- first call and is incremented by one at each call. The iterator's - -- termination can be controlled by setting Quit to True. It is by default - -- set to False. - -- - -- For example, if we have the following directory structure: - -- /boo/ - -- foo.ads - -- /sed/ - -- foo.ads - -- file/ - -- foo.ads - -- /sid/ - -- foo.ads - -- file/ - -- foo.ads - -- /life/ - -- - -- A call with expression "/s*/file/*" will call Action for the following - -- items: - -- /sed/file/foo.ads - -- /sid/file/foo.ads - - generic - with procedure Action - (Item : String; - Index : Positive; - Quit : in out Boolean); - procedure Find - (Root_Directory : Dir_Name_Str; - File_Pattern : String); - -- Recursively searches the directory structure rooted at Root_Directory. - -- This provides functionality similar to the UNIX 'find' command. - -- Action will be called for every item matching the regular expression - -- File_Pattern (see GNAT.Regexp). Item is the full pathname to the file - -- starting with Root_Directory that has been matched. Index is set to one - -- for the first call and is incremented by one at each call. The iterator - -- will pass in the value False on each call to Action. The iterator will - -- terminate after passing the last matched path to Action or after - -- returning from a call to Action which sets Quit to True. - -- Raises GNAT.Regexp.Error_In_Regexp if File_Pattern is ill formed. - function Read_Is_Thread_Safe return Boolean; -- Indicates if procedure Read is thread safe. On systems where the -- target system supports this functionality, Read is thread safe, --- 191,196 ---- *************** *** 259,263 **** --- 207,215 ---- Null_Dir : constant Dir_Type := null; pragma Import (C, Dir_Separator, "__gnat_dir_separator"); + + Dir_Seps : constant Ada.Strings.Maps.Character_Set := + Ada.Strings.Maps.To_Set ("/\"); + -- UNIX and DOS style directory separators. end GNAT.Directory_Operations; *** freeze.ads 2001/10/29 02:06:04 1.15 --- freeze.ads 2001/10/30 01:36:24 1.16 *************** *** 205,210 **** --- 205,215 ---- -- so need to be similarly treated. Freeze_Expression takes care of -- determining the proper insertion point for generated freeze actions. + procedure Freeze_Fixed_Point_Type (Typ : Entity_Id); + -- Freeze fixed point type. For fixed-point types, we have to defer + -- setting the size and bounds till the freeze point, since they are + -- potentially affected by the presence of size and small clauses. + procedure Freeze_Itype (T : Entity_Id; N : Node_Id); -- This routine is called when an Itype is created and must be frozen -- immediately at the point of creation (for the sake of the expansion *** impunit.adb 2001/09/26 07:14:11 1.14 --- impunit.adb 2001/10/30 04:33:45 1.15 *************** *** 195,200 **** --- 195,201 ---- "g-curexc", -- GNAT.Current_Exception "g-debpoo", -- GNAT.Debug_Pools "g-debuti", -- GNAT.Debug_Utilities + "g-diopit", -- GNAT.Directory_Operations.Iteration "g-dirope", -- GNAT.Directory_Operations "g-dyntab", -- GNAT.Dynamic_Tables "g-exctra", -- GNAT.Exception_Traces *** g-regexp.adb 2001/10/21 11:04:16 1.28 --- g-regexp.adb 2001/10/30 15:25:04 1.29 *************** *** 32,38 **** -- -- ------------------------------------------------------------------------------ - with System.IO; with Unchecked_Deallocation; with Ada.Exceptions; with GNAT.Case_Util; --- 32,37 ---- *************** *** 73,82 **** end record; -- Deterministic finite-state machine - Debug : constant Boolean := False; - -- When True, the primary and secondary tables will be printed. - -- Gnat does not generate any code if this variable is False; - ----------------------- -- Local Subprograms -- ----------------------- --- 72,77 ---- *************** *** 188,199 **** pragma No_Return (Raise_Exception); -- Raise an exception, indicating an error at character Index in S. - procedure Print_Table - (Table : Regexp_Array; - Num_States : State_Index; - Is_Primary : Boolean := True); - -- Print a table for debugging purposes - -------------------- -- Create_Mapping -- -------------------- --- 183,188 ---- *************** *** 1225,1309 **** end loop; end loop; - if Debug then - System.IO.New_Line; - System.IO.Put_Line ("Secondary table : "); - Print_Table (R.States, Nb_State, False); - end if; - return (Ada.Finalization.Controlled with R => R); end; end Create_Secondary_Table; - ----------------- - -- Print_Table -- - ----------------- - - procedure Print_Table - (Table : Regexp_Array; - Num_States : State_Index; - Is_Primary : Boolean := True) - is - function Reverse_Mapping (N : Column_Index) return Character; - -- Return the character corresponding to a column in the mapping - - --------------------- - -- Reverse_Mapping -- - --------------------- - - function Reverse_Mapping (N : Column_Index) return Character is - begin - for Column in Map'Range loop - if Map (Column) = N then - return Column; - end if; - end loop; - - return ' '; - end Reverse_Mapping; - - -- Start of processing for Print_Table - - begin - -- Print the header line - - System.IO.Put (" [*] "); - - for Column in 1 .. Alphabet_Size loop - System.IO.Put - (String'(1 .. 1 => Reverse_Mapping (Column)) & " "); - end loop; - - if Is_Primary then - System.IO.Put ("closure...."); - end if; - - System.IO.New_Line; - - -- Print every line - - for State in 1 .. Num_States loop - System.IO.Put (State'Img); - - for K in 1 .. 3 - State'Img'Length loop - System.IO.Put (" "); - end loop; - - for K in 0 .. Alphabet_Size loop - System.IO.Put (Table (State, K)'Img & " "); - end loop; - - for K in Alphabet_Size + 1 .. Table'Last (2) loop - if Table (State, K) /= 0 then - System.IO.Put (Table (State, K)'Img & ","); - end if; - end loop; - - System.IO.New_Line; - end loop; - - end Print_Table; - --------------------- -- Raise_Exception -- --------------------- --- 1214,1223 ---- *************** *** 1345,1356 **** (Table, Num_States, Start_State, End_State); end if; - if Debug then - Print_Table (Table.all, Num_States); - System.IO.Put_Line ("Start_State : " & Start_State'Img); - System.IO.Put_Line ("End_State : " & End_State'Img); - end if; - -- Creates the secondary table R := Create_Secondary_Table --- 1259,1264 ---- *************** *** 1451,1467 **** New_Table := new Regexp_Array (Table'First (1) .. New_Lines, Table'First (2) .. New_Columns); New_Table.all := (others => (others => 0)); - - if Debug then - System.IO.Put_Line ("Reallocating table: Lines from " - & State_Index'Image (Table'Last (1)) - & " to " - & State_Index'Image (New_Lines)); - System.IO.Put_Line (" and columns from " - & Column_Index'Image (Table'Last (2)) - & " to " - & Column_Index'Image (New_Columns)); - end if; for J in Table'Range (1) loop for K in Table'Range (2) loop --- 1359,1364 ---- *** g-dirope.adb 2001/10/31 21:36:04 1.20 --- g-dirope.adb 2001/11/01 16:39:33 1.21 *************** *** 371,387 **** E := E + 1; Var_Name : loop ! exit Var_Name when E = Path'Last; if Characters.Handling.Is_Letter (Path (E)) or else Characters.Handling.Is_Digit (Path (E)) then E := E + 1; else - E := E - 1; exit Var_Name; end if; end loop Var_Name; declare Env : OS_Lib.String_Access := OS_Lib.Getenv (Path (K .. E)); --- 371,388 ---- E := E + 1; Var_Name : loop ! exit Var_Name when E > Path'Last; if Characters.Handling.Is_Letter (Path (E)) or else Characters.Handling.Is_Digit (Path (E)) then E := E + 1; else exit Var_Name; end if; end loop Var_Name; + + E := E - 1; declare Env : OS_Lib.String_Access := OS_Lib.Getenv (Path (K .. E)); 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch10.adb (Install_Withed_Unit): If the unit is a generic instance that is the parent of other generics, the instance body replaces the instance node. Retrieve the instance of the spec, which is the one that is visible in clients and within the body. 2001-12-11 Vincent Celier <celier@gnat.com> * gnatmain.adb: Initial version. * gnatmain.ads: Initial version. * prj-attr.adb (Initialisation_Data): Add package Gnatstub. * snames.adb: Updated to match snames.ads. * snames.ads: Added Gnatstub. 2001-12-11 Vincent Celier <celier@gnat.com> * prj-attr.adb (Initialization_Data): Change name from Initialisation_Data. 2001-12-11 Emmanuel Briot <briot@gnat.com> * g-regpat.adb (Parse_Literal): Properly handle simple operators ?, + and * applied to backslashed expressions like \r. 2001-12-11 Vasiliy Fofanov <fofanov@gnat.com> * g-os_lib.ads: String_List type added, Argument_List type is now subtype of String_List. 2001-12-11 Robert Dewar <dewar@gnat.com> * g-os_lib.ads: Change copyright to FSF Add comments for String_List type 2001-12-11 Vincent Celier <celier@gnat.com> * g-dirope.adb (Expand_Path): Fix bug. (wrong length when adding a string to the buffer). 2001-12-11 Ed Schonberg <schonber@gnat.com> * freeze.adb: Make Freeze_Fixed_Point_Type visible, for use in sem_attr. * sem_attr.adb: Simplify previous fix for Address. (Set_Bounds): If prefix is a non-frozen fixed-point type, freeze now, to avoid anomalies where the bound of the type appears to raise constraint error. 2001-12-11 Robert Dewar <dewar@gnat.com> * lib-xref.adb (Output_Refs): Make sure pointers are always properly handled. 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb (Analyze_Subprogram_Instantiation): Check for a renamed unit before checking for recursive instantiations. 2001-12-11 Emmanuel Briot <briot@gnat.com> * prj.ads: Add comments for some of the fields. 2001-12-11 Robert Dewar <dewar@gnat.com> * lib-xref.adb (Output_Refs): Don't output type references outside the main unit if they are not otherwise referenced. 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_attr.adb (Analyze_attribute, case Address and Size): Simplify code and diagnose additional illegal uses * sem_util.adb (Is_Object_Reference): An indexed component is an object only if the prefix is. 2001-12-11 Vincent Celier <celier@gnat.com> * g-diopit.adb: Initial version. * g-diopit.ads: Initial version. * g-dirope.adb: (Expand_Path): Avoid use of Unbounded_String (Find, Wildcard_Iterator): Moved to child package Iteration * Makefile.in: Added g-diopit.o to GNATRTL_NONTASKING_OBJS 2001-12-11 Robert Dewar <dewar@gnat.com> * sem_attr.adb: Minor reformatting 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb: Clarify some ???. 2001-12-11 Robert Dewar <dewar@gnat.com> * exp_util.adb (Must_Be_Aligned): Removed, replaced by Exp_Pakd.Known_Aligned_Enough * sem_ch13.adb (Check_Address_Alignment): Removed, extended version is moved to Exp_Ch13. 2001-12-11 Robert Dewar <dewar@gnat.com> * einfo.ads: Minor reformatting * exp_ch5.adb: Add comment for previous.change * ali.adb: New interface for extended typeref stuff. * ali.ads: New interface for typeref stuff. * checks.adb (Apply_Alignment_Check): New procedure. * debug.adb: Add -gnatdM for modified ALI output * exp_pakd.adb (Known_Aligned_Enough): Replaces Known_Aligned_Enough. * lib-xref.adb: Extend generation of <..> notation to cover subtype/object types. Note that this is a complete rewrite, getting rid of the very nasty quadratic algorithm previously used for derived type output. * lib-xref.ads: Extend description of <..> notation to cover subtype/object types. Uses {..} for these other cases. Also use (..) for pointer types. * sem_util.adb (Check_Potentially_Blocking_Operation): Slight cleanup. * exp_pakd.adb: Minor reformatting. Note that prevous RH should say: (Known_Aligned_Enough): Replaces Must_Be_Aligned. 2001-12-11 Vincent Celier <celier@gnat.com> * gnatcmd.adb: Changed /COMPILE_ONLY to /ACTIONS=COMPILE Changed /BIND_ONLY to /ACTIONS=BIND Changed /LINK_ONLY to /ACTIONS=LINK 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch8.adb (Find_Selected_Component): improved search for a candidate package in case of error. * sem_ch12.adb (Inline_Instance_Body): place head of use_clause chain back on scope stack before reinstalling use clauses. * exp_ch5.adb (Expand_N_If_Statement): if Constant_Condition_Warnings is enabled, do not kill the code for the condition, to preserve warning. 2001-12-11 Robert Dewar <dewar@gnat.com> * checks.adb (Insert_Valid_Check): Apply validity check to expression of conversion, not to result of conversion. 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Build_Derived_Record_Type): set Controlled flag before freezing parent. If the declarations are mutually recursive, an access to the current record type may be frozen before the derivation is complete. 2001-12-05 Vincent Celier <celier@gnat.com> * gnatcmd.adb: (MAKE): Add new translations: -b /BIND_ONLY, -c /COMPILE_ONLY, -l /LINK_ONLY * opt.ads: (Bind_Only): New Flag (Link_Only): New flag * switch.adb (Scan_Make_Switches): Add processing for -b (Bind_Only) and -l (Link_Only) * makeusg.adb: Add new switches -b and -l. Update Copyright notice. * make.adb: (Do_Compile_Step, Do_Bind_Step, Do_Link_Step): New flags. (Gnatmake): Set the step flags. Only perform a step if the corresponding step flag is True. (Scan_Make_Arg): Reset the bind and link step flags when -u or -gnatc has been specified. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_eval.adb (Eval_Concatenation): If left operand is a null string, get bounds from right operand. * sem_eval.adb: Minor reformatting * exp_util.adb (Make_Literal_Range): use bound of literal rather than Index'First, its lower bound may be different from 1. * exp_util.adb: Undo earlier change, fixes ACVC regressions C48009B and C48009J 2001-12-05 Vincent Celier <celier@gnat.com> * prj-nmsc.adb Minor reformatting * prj-nmsc.adb (Language_Independent_Check): Reset Library flag if set and libraries are not supported. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Build_Derived_Private_Type): set Public status of private view explicitly, so the back-end can treat as a global when appropriate. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb (Instantiate_Package_Body): if instance is a compilation unit, always replace instance node with new body, for ASIS use. 2001-12-05 Vincent Celier <celier@gnat.com> * prj-nmsc.adb (Language_Independent_Check): Issue a warning if libraries are not supported and both attributes Library_Name and Library_Dir are specified. * prj-proc.adb (Expression): Set location of Result to location of first term. * Makefile.in: Add mlib.o, mlib-fil.o, mlib-tgt and mlib-utl to GNATLS. (prj-nmsc is now importing MLib.Tgt) * prj-proc.adb: Put the change indicated above that was forgotten. 2001-12-05 Robert Dewar <dewar@gnat.com> * Makefile.in: Add dependencies for System.IO for GNAT.Regexp 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Build_Derived_Concurrent_Type): If derivation imposes a constraint, introduce explicit subtype declaration and derive from it. * sem_ch3.adb: Minor reformatting 2001-12-05 Robert Dewar <dewar@gnat.com> * checks.adb (Determine_Range): Increase cache size for checks. Minor reformatting * exp_ch6.adb: Minor reformatting (Expand_N_Subprogram_Body): Reset Is_Pure for any subprogram that has a parameter whose root type is System.Address, since treating such subprograms as pure in the code generator is almost surely a mistake that will lead to unexpected results. * exp_util.adb (Remove_Side_Effects): Clean up old ??? comment and change handling of conversions. * g-regexp.adb: Use System.IO instead of Ada.Text_IO. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Analyze_Object_Declaration): If expression is an aggregate with static wrong size, attach generated Raise node to declaration. 2001-12-05 Robert Dewar <dewar@gnat.com> * sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute. Fixes compilation abandoned bomb in B24009B. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb: Document use of Associated_Node on Selected_Components. (Save_Global_Operand_Descendants): Change to Save_Entity_Descendants, to clarify use of untyped descendant fields. 2001-12-05 Robert Dewar <dewar@gnat.com> * prj-dect.ads: Add ??? comment Add 2001 to copyright notice (was not done in after all) * prj-part.adb: Minor reformatting. Reword one awkward error message. * prj.ads: Minor reformatting throughout, and add some ??? comments * snames.ads: Minor reformatting 2001-12-05 Geert Bosch <bosch@gnat.com> * snames.adb: Autoupdate 2001-12-05 Vincent Celier <celier@gnat.com> * prj-dect.adb (Parse): Rename parameter Modifying to Extends. * prj-dect.ads (Parse): Rename parameter Modifying to Extends. * prj-env.adb: Minor comment changes (modifying -> extends). * prj-nmsc.adb: Minor comment changes (modifying -> extends). * prj-part.adb (Parse_Single_Project): Change Tok_Modifying to Tok_Extends. * prj.adb (Initialize): Change Modifying to Extends. * scans.ads (Token_Type): Change Tok_Modifying to Tok_Extends. * prj.ads: Minor comment change (Modifying -> extending). * snames.ads: Change modifying to extends. 2001-12-05 Robert Dewar <dewar@gnat.com> * sem_warn.adb: Remove stuff for conditionals, we are not going to do this after all. * sem_warn.ads: Remove stuff for conditionals, we are not going to do this after all. Add 2001 to copyright notice 2001-12-04 Geert Bosch <bosch@gnat.com> * einfo.h, sinfo.h, treeprs.ads: Regenerate. 2001-12-04 Robert Dewar <dewar@gnat.com> * errout.adb (Error_Msg): Ignore attempt to put error msg at junk location if we already have errors. Stops some cases of cascaded errors. * errout.adb: Improve comment. 2001-12-04 Robert Dewar <dewar@gnat.com> * sem_ch12.adb: (Analyze_Formal_Type_Definition): Defend against Error. (Analyze_Formal_Subprogram): Defend against Error. * par-ch12.adb (F_Formal_Type_Declaration): In case of error, remove following semicolon if present. Removes cascaded error. 2001-12-04 Douglas B. Rupp <rupp@gnat.com> * bindgen.adb: (Gen_Exception_Table_Ada): Write "begin" and then return if Num exceptions equals 0. (Gen_Exception_Table_C): Return if Num exceptions equals 0. Fixes PIWG E tests (which have to be run with -gnatL). 2001-12-04 Robert Dewar <dewar@gnat.com> * einfo.ads: Minor reformatting 2001-12-04 Ed Schonberg <schonber@gnat.com> * einfo.ads: Block_Node points to the identifier of the block, not to the block node itself, to preserve the link when the block is rewritten, e.g. within an if-statement with a static condition. * inline.adb (Cleanup_Scopes): recover block statement from block entity using new meaning of Block_Node. * sem_ch5.adb (Analyze_Block_Statement): set Block_Node to point to identifier of block node, rather than to node itself. 2001-12-04 Gary Dismukes <dismukes@gnat.com> * layout.adb: (Get_Max_Size): Fix "start of processing" comment to say Get_Max_Size. (Discrimify): Go back to setting the Etypes of the selected component because the Vname component does not exist at this point and will fail name resolution. Also set Analyzed. Remove with and use of Sem_Res. 2001-12-04 Arnaud Charlet <charlet@gnat.com> * Makefile.in: (HIE_SOURCES): add s-fat*. 2001-12-04 Robert Dewar <dewar@gnat.com> * sem_attr.adb: (Compile_Time_Known_Attribute): New procedure. (Eval_Attribute, case Size): Use Compile_Time_Known_Attribute to ensure proper range check. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_ch7.adb (New_Private_Type): Set Is_Tagged_Type flag before processing discriminants to diagnose illegal default values. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_attr.adb (Resolve_Attribute): Handle properly an non-classwide access discriminant within a type extension that constrains its parent discriminants. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Find_Type_Of_Subtype_Indic): If subtype indication is malformed, use instance of Any_Id to allow analysis to proceed. * par-ch12.adb (P_Formal_Type_Declaration): Propagate Error if type definition is illegal. (P_Formal_Derived_Type_Definition): Better recovery when TAGGED is misplaced. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_warn.adb (Output_Unreferenced_Messages): Extend previous fix to constants. 2001-12-04 Robert Dewar <dewar@gnat.com> * errout.adb: Minor reformatting 2001-12-04 Robert Dewar <dewar@gnat.com> * exp_util.adb: Minor reformatting from last change * errout.adb (Check_For_Warning): For a Raised_Constraint_Error node which is a rewriting of an expression, traverse the original expression to remove warnings that may have been posted on it. 2001-12-04 Ed Schonberg <schonber@gnat.com> * exp_util.adb (Must_Be_Aligned): Return false for a component of a record that has other packed components. 2001-12-04 Douglass B. Rupp <rupp@gnat.com> * adaint.c: Minor cleanups. 2001-12-04 Douglass B. Rupp <rupp@gnat.com> * adaint.c: Do not use utime.h on vxworks. 2001-12-04 Arnaud Charlet <charlet@gnat.com> * Makefile.adalib: Clarify step 3 (use of gnat.adc) as it causes more confusion than it solves. 2001-12-04 Geert bosch <bosch@gnat.com> * einfo.h, nmake.adb, nmake.ads, sinfo.h treeprs.ads: Regenerate. 2001-12-04 Geert Bosch <bosch@gnat.com> * Makefile.in (update-sources): New target. For use by gcc_release script. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_prag.adb (Analyze_Pragma, case Validity_Checks): do not treat as a configuration pragma, it is now legal wherever a pragma can appear. 2001-12-04 Zack Weinberg <zack@codesourcery.com> * Makefile.in: Don't set ALL. Delete @cross_defines@, @cross_overrides@, @build_overrides@ stanzas. INTERNAL_CFLAGS is now @CROSS@ -DIN_GCC; update comment. 2001-12-04 Robert Dewar <dewar@gnat.com> * einfo.adb (Has_Pragma_Pure_Function): New flag. Fix problem that stopped ceinfo from working * einfo.ads (Has_Pragma_Pure_Function): New flag. * sem_prag.adb (Pure_Function): Set new flag Has_Pragma_Pure_Function. 2001-12-04 Douglas B. Rupp <rupp@gnat.com> * gnatchop.adb: (File_Time_Stamp): New procedure. (Preserve_Mode): New boolean. (Write_Unit): Pass time stamp. Implement -p switch (preserve time stamps). * gnatcmd.adb (CHOP): Add translation for -p (/PRESERVE). * gnatchop.adb: Do usage info for -p switch * adaint.h (__gnat_set_file_time_name): New function * adaint.c (__gnat_set_file_time_name): Implement * adaint.h: Fix typo 2001-12-03 Robert Dewar <dewar@gnat.com> * sinfo.ads: Minor reformatting. N_Freeze_Entity node does not have Associated_Node. 2001-12-03 Robert Dewar <dewar@gnat.com> * prj-proc.adb: Minor reformatting * make.adb: Minor reformatting 2001-12-03 Geert Bosch <bosch@gnat.com> * make.adb: Minor reformatting. 2001-12-03 Robert Dewar <dewar@gnat.com> * sem_ch12.adb: Minor reformatting 2001-12-03 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb (Inline_Instance_Body): Use Save_Scope_Stack and push Standard on the stack before analyzing the instance body, in order to have a clean visibility environment. * sem_ch12.adb (Inline_Instance_Body): Remove redundant code. 2001-12-03 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb (Instantiate_Package_Body): Protect against double instantiation of a body that contains an inlined body. 2001-12-03 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb: (Analyze_generic_subprogram_Declaration): Set outer_generic_scope, to prevent freezing within formal packages. (Freeze_Subprogram_Body): If body comes from another instance that appeared before its own body, place freeze node at end of current declarative part, to prevent a back-end crash. (Inline_Instance_Body): Handle properly a package instance within a subprogram instance that is a child unit. 2001-12-01 Graham Stott <grahams@redhat.com> * Makefile.in (misc.o): Add missing $(srcdir) prefix and add optabs.h dependency. * misc.c: Include optabs.h (gnat_tree_code_type): Make static and const. (gnat_tree_code_length): Likewise. (gnat_tree_code_name): Likewise. (update_setjmp_buf): Obtain operands mode from insn_data. 2001-11-29 Richard Henderson <rth@redhat.com> * init.c: Remove obsolete dwarf2 frame.h section. 2001-11-29 Joseph S. Myers <jsm28@cam.ac.uk> * Make-lang.in (ada.generated-manpages): New dummy target. 2001-11-29 Ed Schonberg <schonber@gnat.com> * g-os_lib.adb (Add_To_Command): use explicit loop to move string into Command, an array conversion is illegal here. Uncovered by ACATS B460005. 2001/11/28 Geert Bosch <bosch@gnat.com> * init.c: Minor whitespace changes. 2001-11-28 Doug Rupp <rupp@gnat.com> * init.c: (__gnat_install_handler,VMS): Increase size of alternate signal stack. 2001-11-28 Zack Weinberg <zack@codesourcery.com> * misc.c (gnat_expand_constant): Move declaration above definition of lang_hooks. (LANG_HOOKS_EXPAND_CONSTANT): Set to gnat_expand_constant. (gnat_init): lang_expand_constant no longer exists. (internal_error_function): Remove #ifdef HAVE_VPRINTF. We always have vprintf. (gnat_init): Always call set_internal_error_function. 2001-11-27 Andreas Jaeger <aj@suse.de> * Makefile.in (stamp-tool_src_dir): Use symbolic link. 2001-11-27 Laurent Guerby <guerby@acm.org> * Makefile.in: Regenerate Ada dependencies. 2001-11-26 Richard Henderson <rth@redhat.com> * Make-lang.in (gnatbind, gnatmake, gnatbl, gnatchop, gnatcmd, gnatlink, gnatkr, gnatls, gnatmem, gnatprep, gnatpsta, gnatpsys, gnatxref, gnatfind, gnatlbr): Depend on CONFIG_H and prefix.o. 2001-11-25 Laurent Guerby <guerby@acm.org> * sysdep.c (rts_get_*): Fix style. 2001-11-19 Laurent Guerby <guerby@acm.org> * Makefile.in (INCLUDES_FOR_SUBDIR): Remove redundant system include since it is of no apparent use and cause warnings. 2001-11-18 Neil Booth <neil@daikokuya.demon.co.uk> * misc.c (gnat_decode_option, gnat_init_options): Make definitions static too. (gnat_init): Don't return NULL. (finish_parse): Remove. 2001-11-17 Laurent Guerby <guerby@acm.org> * Make-lang.in (GNATLIBFLAGS): Add -W -Wall. * gigi.h (init_decl_processing): Rename to gnat_init_decl_processing. * io-aux.c: Provide K&R prototypes to all functions, reformat code. * lang-spec.h: Add missing struct field to silence warnings. * sysdep.c (rts_get_*): Provide K&R prototype. * sysdep.c (Unlock_Task, Lock_Task): Move to K&R prototype. * traceback.c (Unlock_Task, Lock_Task): Likewise. * tracebak.c (__gnat_backtrace): Remove unused variable. * utils.c (end_subprog_body): Move to K&R style. Thu Nov 15 18:16:17 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * trans.c, utils2.c: Remove PALIGN parameter to get_inner_reference. 2001-11-15 Neil Booth <neil@daikokuya.demon.co.uk> * misc.c (gnat_init): Change prototype. Include the functionality of the old init_parse and init_decl_processing. (gnat_init_decl_processing): New prototype. (init_parse): Remove. * utils.c (init_decl_processing): Rename gnat_init_decl_processing. 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> * misc.c (gnat_print_decl, gnat_print_type): Renamed. (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE): Override. (print_lang_statistics, lang_print_xnode, print_lang_identifier, set_yydebug): Remove. 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> * misc.c (LANG_HOOKS_NAME, LANG_HOOKS_IDENTIFIER_SIZE): Override. (struct lang_hooks): Constify. (language_string, lang_identify): Remove. * utils.c (init_decl_processing): Update. 2001-11-06 Neil Booth <neil@cat.daikokuya.demon.co.uk> * misc.c: Include langhooks-def.h. * Makefile.in: Update. 2001-10-30 Robert Dewar <dewar@gnat.com> * style.adb: (Check_Identifier): Rewrite circuit to be compatible with use of letters in the upper half of ASCII. (Check_Identifier): Minor reformatting 2001-10-30 Geert Bosch <bosch@gnat.com> * (Associated_Node, Set_Associated_Node): Do not check for Freeze_Entity. 2001-10-30 Robert Dewar <dewar@gnat.com> * a-reatim.ads: Minor reformatting 2001-10-30 Robert Dewar <dewar@gnat.com> * gnatdll.adb: Minor reformatting throughout. Many ??? added for undocumented declarations. 2001-10-30 Pascal Obry <obry@gnat.com> * gnatdll.adb (Parse_Command_Line): handle -g option to be passed to the binder and linker. Minor style fix. * mdll.ads: Fix layout. Update copyright notice. * mdll.adb: Fix layout. Update copyright notice. 2001-10-30 Robert Dewar <dewar@gnat.com> * usage.adb: Minor fix to output for -gnaty. 2001-10-30 Ed Schonberg <schonber@gnat.com> * a-reatim.ads: Makes Seconds_Count into a 64-bit integer, to accommodate all its possible values. * a-reatim.adb (Split): Special-case handling of Time_Span_First and of small absolute values of T. 2001-10-30 Richard Kenner <kenner@gnat.com> * misc.c (gnat_expand_expr, case NULL_EXPR): Remove call to set_mem_attributes since not needed and wrong if RESULT if a REG; fixes ACATS failures. 2001-10-30 Geert Bosch <bosch@gnat.com> * 86numaux.adb, a-tigeau.ads, a-wtgeau.ads, fname-sf.ads, g-traceb.ads, s-tasdeb.ads, sem_maps.ads: Add 2001 to copyright notice. 2001-10-30 Robert Dewar <dewar@gnat.com> * bindusg.adb: Undocument -f switch. * gnatcmd.adb: Remove /FULL_ELABORATION. * opt.ads (Force_RM_Elaboration_Order): Document that this is obsolescent. * gnatbind.adb: Output new warning for use of obsolescent -f switch. * gnatbind.adb: Minor update of warning msg. 2001-10-30 Vincent Celier <celier@gnat.com> * gnatcmd.adb (MAKE, BIND, LINK, LIST, FIND, XREF): Add translations for project file switches (-P (/PROJECT_FILE=), -X (/EXTERNAL_REFERENCE=) and -vPx (/PROJECT_FILE_VERBOSITY=DEFAULT or MEDIUM or HIGH) 2001-10-30 Geert Bosch <bosch@gnat.com> * decl.c: Minor whitespace fixes. 2001-10-30 Richard Kenner <kenner@gnat.com> * utils2.c (build_allocator): Test for SIZE overflow in array case too 2001-10-30 Geert Bosch <bosch@gnat.com> * ali-util.adb (Initialize_Checksum): Use out-mode instead of in out. Found due to GCC 3.0 warning of using uninitialized value. * layout.adb: (Get_Max_Size): Use variant record for tracking value/expression. Makes logic clearer and prevents warnings for uninitialized variables. (Layout_Array_Type): Use variant record for tracking value/expression. Makes logic clearer and prevents warnings for uninitialized variables. 2001-10-30 Robert Dewar <dewar@gnat.com> * lib.adb: Minor reformatting * s-taprop.ads: Minor reformatting 2001-10-29 Laurent Guerby <guerby@acm.org> * init.c: (Raise_From_Signal_Handler, Propagate_Signal_Exception): Make arg const. (_gnat_error_handler): Make MSG const. 2001-10-29 Richard Kenner <kenner@gnat.com> * sysdep.c: Fix localtime_r problem on LynxOS. Also remove #elif to avoid warnings. * misc.c (yyparse): Don't set up and register jmpbuf; remove decls used by this. * decl.c (annotate_value): Make SIZE unsigned to avoid warning. 2001-10-28 Joseph S. Myers <jsm28@cam.ac.uk> * 86numaux.adb, a-tigeau.ads, a-wtgeau.ads, decl.c, exp_ch6.adb, exp_ch9.adb, exp_util.adb, fname-sf.ads, freeze.ads, g-awk.adb, g-comlin.ads, g-dirope.adb, g-dyntab.ads, g-socket.ads, g-table.ads, g-traceb.ads, gnat-style.texi, gnatchop.adb, init.c, layout.adb, layout.ads, mdllfile.ads, mlib-fil.ads, osint.ads, s-fatgen.adb, s-imgrea.adb, s-taprop.ads, s-tasdeb.ads, sem_aggr.adb, sem_attr.adb, sem_case.ads, sem_ch13.adb, sem_ch3.adb, sem_elab.adb, sem_maps.ads, sem_res.adb, sem_util.ads, sinfo.ads, sinput.ads, table.adb, table.ads, types.ads, urealp.adb: Fix spelling errors. 2001-10-27 Laurent Guerby <guerby@acm.org> * trans.c (gigi): Fix non determinism leading to bootstrap comparison failures for debugging information. 2001-10-26 Florian Weimer <fw@deneb.enyo.de> * gnat_rm.texi: Use @./@: where appropriate. 2001-10-26 Robert Dewar <dewar@gnat.com> * sinfo.adb: Define Associated_Node to overlap Entity field. Cleanup. 2001-10-26 Richard Kenner <kenner@gnat.com> * gmem.c (__gnat_gmem_read_next): Properly check for EOF 2001-10-26 Richard Kenner <kenner@gnat.com> * decl.c (validate_size): Modify message for bad size to avoid implication that compiler is modifying the size. 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-util.adb: Minor reformatting. Fix bad header format. 2001-10-26 Robert Dewar <dewar@gnat.com> * sinfo.ads: Define Associated_Node to overlap Entity field. Cleanup. * sinfo.ads: Clarify use of Associated_Node (documentation only). * sem_ch12.adb: Change Node4 to Associated_Node. Change Associated_Node to Get_Associated_Node. Put use of Unchecked_Access much more narrowly in places where needed. These are cleanups. 2001-10-26 Joel Brobecker <brobecke@gnat.com> * 5zosinte.ads (null_pthread): new constant. * 5ztaprop.adb: (Initialize_TCB): Initialize thread ID to null, to be able to verify later that this field has been set. (Finalize_TCB): ditto. (Suspend_Task): Verify that the thread ID is not null before using it. (Resume_Task): ditto. * s-tasdeb.adb: (Resume_All_Tasks): Lock the tasks list before using it. (Suspend_All_Tasks): ditto. 2001-10-26 Richard Kenner <kenner@gnat.com> * decl.c (gnat_to_gnu_entity, case E_General_Access_Type): Make constant variant of designated type for Is_Access_Constant. Call update_pointer_to with main variant. * trans.c (process_freeze_entity, process_type): Call update_pointer_to on main variant. * utils.c (update_pointer_to): Make corresponding variant for NEW_TYPE. If main variant, update all other variants. * utils2.c (build_unary_op, case INDIRECT_REF): No longer set TREE_STATIC. 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-util.adb: Minor reformatting 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-util.adb: Minor reformatting 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-attr.adb: Minor reformatting throughout 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-attr.ads: Minor reformatting Add ??? comment (this whole spec has almost no comments) 2001-10-26 Vincent Celier <celier@gnat.com> * g-os_lib.adb (Normalize_Pathname): Preserve the double slash ("//") that precede the drive letter on Interix. 2001-10-26 Geert Bosch <bosch@gnat.com> * gnat_rm.texi: Add GNAT Reference Manual. 2001-10-25 Robert Dewar <dewar@gnat.com> * sem_ch8.adb (Analyze_Package_Renaming): Skip analysis if Name is Error. Similar change for other renaming cases. 2001-10-25 Robert Dewar <dewar@gnat.com> * s-atacco.ads: Add pragma Inline_Always for functions. Fix header format. Add copyright 2001 2001-10-25 Ed Schonberg <schonber@gnat.com> * par-ch3.adb (P_Subtype_Mark_Resync): for an anonymous array return Error rather than Empty so that analysis can proceed. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_util.adb (Enter_Name): better handling of cascaded error messages when a unit appears in its own context. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_util.adb (Defining_Entity): in case of error, attach created entity to specification, so that semantic analysis can proceed. 2001-10-25 Robert Dewar <dewar@gnat.com> * sem_util.adb (Defining_Entity): Deal with Error. (Process_End_Label): Deal with bad end label for. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_elab.adb (Check_A_Call): refine message when call is in an instance but callee is not declared in the generic unit. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_elab.adb (Check_A_Call): check for renaming before finding the enclosing unit, which may already be different from the calling unit. 2001-10-25 Geert Bosch <bosch@gnat.com> * 4gintnam.ads: fix header format. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_res.adb (Resolve_Call): if the call is actually an indexing operation on the result of a parameterless call, perform elaboration check after the node has been properly rewritten. * sem_ch12.adb (Copy_Generic_Node): after the proper body has been inlined within the generic tree, the defining identifier is not a compilation_unit. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_res.adb (Resolve): special-case resolution of Null in an instance or an inlined body to avoid view conflicts. * sem_ch12.adb (Copy_Generic_Node): for allocators, check for view compatibility by retrieving the access type of the generic copy. 2001-10-25 Robert Dewar <dewar@gnat.com> * sem_ch3.adb: (Analyze_Number_Declaration): Handle error expression. (Signed_Integer_Type_Declaration): Handle error bound. (Analyze_Subtype_Indication): Handle error range. * sem_util.adb (Get_Index_Bounds): Check for Error. 2001-10-25 Robert Dewar <dewar@gnat.com> * restrict.adb (Set_No_Run_Time_Mode): Set Discard_Names as default in no run time mode. 2001-10-25 Pascal Obry <obry@gnat.com> * gnatmem.adb (Read_Next): fix Curs2 value to properly handle quiet mode case for ALLOC case. * gnatmem.adb (Read_Next): correctly fix parsing in Quiet mode on all platforms. Improvement of last change. 2001-10-25 Robert Dewar <dewar@gnat.com> * exp_ch4.adb (Expand_N_Allocator): Minor reformatting. 2001-10-25 Geert Bosch <bosch@gnat.com> * osint.adb (Is_Relative): Remove duplicate. 2001-10-25 Pascal Obry <obry@gnat.com> * osint.adb (Read_Default_Search_Dirs): correctly detect relative pathnames in UNIX and DOS style with drive letter. (Is_Relative): new routine. * osint.adb: Minor reformatting * osint.adb (Is_Relative): implementation using GNAT.OS_Lib.Is_Absolute_Path. Better fix. 2001-10-25 Pascal Obry <obry@gnat.com> * g-dirope.adb (Basename): correctly compute offset between the original Path and the translated one. * g-dirope.adb: (Base_Name): add some comments. 2001-10-25 Robert Dewar <dewar@gnat.com> * exp_imgv.adb (Expand_Image_Attribute): Defend against bad use in HIE mode, avoids compilation abandoned message * exp_imgv.adb: Correct typo in previous change * exp_imgv.adb: Correct typo in previous change (not my day!) 2001-10-25 Robert Dewar <dewar@gnat.com> * s-tpinop.ads: Add 2001 to copyright notice. Fix header format. 2001-10-25 Pascal Obry <obry@gnat.com> * g-awk.ads: Move all pragma inlines next to the routine declarations. This is more uniform with other GNAT spec. 2001-10-22 Geert Bosch <bosch@gnat.com> * Make-lang.in (gnattools, cross-gnattools): Remove gnatmem. 2001-10-19 Geert Bosch <bosch@gnat.com> * Makefile.in (tools, gnattools): Remove gnatmem. 2001-10-17 Richard Henderson <rth@redhat.com> * Makefile.in (misc.o): Depend on langhooks.h. * misc.c: Include it. (LANG_HOOKS_INIT, LANG_HOOKS_INIT_OPTIONS): New. (LANG_HOOKS_DECODE_OPTION): New. (lang_hooks): Use LANG_HOOKS_INITIALIZER. 2001-10-16 Florian Weimer <fw@deneb.enyo.de> * trans.c (tree_transform): Adjust to recent change in expand_asm_operands to implement named asm operands. 2001-10-11 Ed Schonberg <schonber@gnat.com> * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): Bugfix in renaming of discriminant for mutable record type. 2001-10-11 Robert Dewar <dewar@gnat.com> * validsw.adb: Properly save -gnatVn status. 2001-10-11 Robert Dewar <dewar@gnat.com> * usage.adb: Add lines for V switch. * gnatcmd.adb (COMPILE): Revise translations for -gnatV (/VALIDITY_CHECKING). 2001-10-11 Ed Schonberg <schonber@gnat.com> * sem_type.adb (Add_One_Interp): an operator for a type declared in an extension of System is known to be visible. 2001-10-11 Ed Schonberg <schonber@gnat.com> * sem_eval.adb (Compare_Fixup): get the bounds of a String_Literal properly. Fixes regression on ACATS C34005G. 2001-10-11 Robert Dewar <dewar@gnat.com> * sem_ch5.adb (Analyze_Iteration_Scheme): Suppress warning on null loop in generic instance, since this is likely not very useful. 2001-10-11 Robert Dewar <dewar@gnat.com> * restrict.adb (Disallow in No_Run_Time_Mode): Properly specialize the error message for high integrity mode. * rtsfind.adb (RTE): Give message if we try to find an entity that is not available in high integrity mode. * rtsfind.ads: (OK_To_Use_In_HIE_Mode): New array. (RTE): May return Empty in high integrity mode. * rtsfind.ads (OK_To_Use_In_No_Run_Time_Mode): New name for OK_To_Use_In_HIE_Mode, now includes System_FAT_xxx. * sem_ch6.adb (Analyze_Subprogram_Body): Kill body in predefined unit if not inlined always and in no runtime mode. Fixes problem caused by new Rtsfind changes. * sem_ch6.adb (Analyze_Subrogram_Body): Do not Check_References if body is deleted. * rtsfind.adb (RTE): Make sure we do not try to load unit after giving message for entity not available in high integrity mode. 2001-10-11 Pascal Obry <obry@gnat.com> * impunit.adb: Add GNAT.CRC32. 2001-10-11 Ed Schonberg <schonber@gnat.com> * exp_fixd.adb (Expand_Multiply_Fixed_By_Fixed_Giving_Fixed): handle properly the case where one universal operand in a non-static exponentiation of a real literal. 2001-10-11 Ed Schonberg <schonber@gnat.com> * exp_ch7.adb (Find_Final_List): for a type appearing in a with_type clause, return the gobal finalization list, for lack of anthing else. 2001-10-11 Ed Schonberg <schonber@gnat.com> * exp_ch7.adb (Make_Transient_Block): if statement is within exception handler, always use new transient scope to place Clean procedure. 2001-10-11 Pascal Obry <obry@gnat.com> * Makefile.in: (GNAT_ADA_OBJS): add g-crc32.o, a-tags.o, a-stream.o (GNATBIND_OBJS): add g-crc32.o, a-tags.o, a-stream.o (GNATLS_RTL_OBJS): add g-crc32.o (GNATMAKE_RTL_OBJS): add g-crc32.o * ali-util.adb: (CRC_Match): new function. (Get_File_Checksum): renamed Get_File_CRC. Use the GNAT.CRC32 unit instead of the previous simple checksum algorithm. (Time_Stamp_Mismatch): use CRC_Match for comparison. (Set_Source_Table): idem. * ali-util.ads: (Get_File_Checksum): renamed Get_File_CRC as now we compute CRC instead of simple checksum. (CRC_Match): new function. (CRC_Error): new constant. * ali.adb (Scan_ALI): rename variable Chk to CRC as we are handling a CRC now and not a simple checksum. A CRC uses lower-case hex letters, fixes ambiguity in parsing. * ali.ads (Sdep_Record.Checksum): renamed Sdep_Record.CRC as this is what this variable will store. * bcheck.adb: Change reference to chechsum in comments by CRC. (Check_Consistency): Rename Get_File_Checksum to Get_File_CRC. rename All_Checksum_Match to All_CRC_Match. Change due to API renaming since now GNAT does not use a simple checksum but a CRC using GNAT.CRC32. * gnatls.adb: Rename Checksum to CRC in many places, we use a CRC now and not anymore a simple checksum. * lib-load.adb: Use Source_CRC instead of Source_Checksum in many places. * lib-writ.adb (Write_ALI): Use Source_CRC instead of Source_Checksum. * scans.adb: (Restore_Scan_State): rename Checksum to CRC. (Save_Scan_State): idem. * scans.ads: With GNAT.CRC32. (Checksum): rename to CRC. (Saved_Scan_State): Save_Checksum field renamed to Save_CRC * scn-nlit.adb: Rename many Accumulate_Checksum to Update (from GNAT.CRC32). Update copyright notice. * scn-slit.adb: Rename many Accumulate_Checksum to Update (from GNAT.CRC32). Update copyright notice. * scn.adb: (Accumulate_Checksum): removed. (Update): new procedure. Add a wide-character into the CRC. * sinput-l.adb: (Complete_Source_File_Entry): use CRC32 instead of simple checksum. (Load_File): fix initialization of S (change Source_Checksum to Source_CRC) * sinput-p.adb (Load_Project_File): rename Source_Checksum to Source_CRC in S initialization. * sinput.adb (Source_Checksum): renamed to Source_CRC. * sinput.ads (Source_Checksum): renamed to Source_CRC. Update comments for the CRC. * types.adb (Hex): Use lowercase for the letter part. * types.ads (Get_Hex_String): Returns the hexadecimal representation for a word. This is currently used only for CRC. In previous version, the checksum was using a representation with all letter being upper-case. With the new implementation (using CRC) we do not remove the 32th bit of the CRC, so we can have an upper-case starting letter in the CRC. This is not possible to parse in Scan_ALI (ali.adb). It is ambigous since the CRC was optional and could be followed by options like EB, EE. So now this routines uses lower-case letter for the hexadecimal representation. Strange enough only lower case letters where checked in Scan_ALI (even if this was not a possible case). * gnatvsn.ads (Library_Version): changed to 3.15a. * s-crc32.ads: Initial version from GNAT.CRC32. This is the version for the compiler. * s-crc32.adb: Initial version from GNAT.CRC32. This is the version for the compiler. * ali-util.adb: Redo previous change to avoid using word CRC everywhere Add 2001 to copyright notice (Accumulate_Checksum): Modify to use System.CRC32. * ali-util.ads: Redo changes of previous revision to continue to use the word Checksum. Add 2001 to copyright notice. * ali.adb: Undo some of previous changes, not needed. Keep the change for lower case letters in the checksum. * ali.ads: Undo previous change not needed. * bcheck.adb: Undo most of previous change, not needed. But do use Checksums_Match for checksum comparison. * gnatls.adb: Undo most of previous change, not needed. But do use Checksums_Match for comparing checksums. * lib-load.adb: Undo previous change, not needed. * lib-writ.adb: Undo previous change, not needed. * lib-writ.ads: Document that checksums use lower case, not upper case letters. * scans.adb: Undo previous change, not needed * scans.ads: Undo previous change, not needed. * scn-nlit.adb: Undo previous changes, not needed. * scn-slit.adb: Undo previous change, not needed. Fix header format. * scn.adb: (Accumulate_Checksum): Use System.CRC32. (Initialize_Checksum): New procedure. Remove other changes of previous revision. * sinput-p.adb: Undo previous change, not needed. * sinput.adb: Undo previous change, not needed. * sinput-l.adb: Undo previous change, not needed. * sinput.ads: Undo previous change, not needed. Keep only comment on new checksum algorithm * Makefile.in: Add s-crc32 as needed, remove g-crc32. Also remove a-tags and a-stream from GNAT sources. * ali.adb (Scan_ALI): fix typo introduce in latest check-in. * Makefile.in (GNATRTL_NONTASKING_OBJS): Add g-crc32.o. 2001-10-11 Geert Bosch <bosch@gnat.com> * einfo.h: Regenerate. * nmake.ads: Regenerate. * nmake.adb: Regenerate. * sinfo.h: Regenerate. * treeprs.adb: Regenerate. 2001-10-10 Geert Bosch <bosch@gnat.com> * gnat-style.texi: New file describing coding guidelines for Ada. 2001-10-10 Ed Schonberg <schonber@gnat.com> * einfo.adb (Write_Entity_Flags): Elaboration_Entity_Required is Flag174. 2001-10-10 Geert Bosch <bosch@gnat.com> * snames.ads: Add new names for project facility. * snames.adb: Update to reflect snames.ads changes. * snames.h: Update to reflect snames.ads changes. 2001-10-10 Vincent Celier <celier@gnat.com> * make.adb: (Add_Switches): reflect the changes for the switches attributes Default_Switches indexed by the programming language, Switches indexed by the file name. (Collect_Arguments_And_Compile): Idem. Reflect the attribute name changes. * prj-attr.adb: (Initialisation_Data): Change the names of some packages and attributes. (Initialize): process case insensitive associative arrays. * prj-attr.ads: (Attribute_Kind): Remove Both, add Case_Insensitive_Associative_Array. * prj-dect.adb: (Parse_Attribute_Declaration): For case insensitive associative arrays, set the index string to lower case. * prj-env.adb: Reflect the changes of the project attributes. * prj-nmsc.adb: Replace Check_Naming_Scheme by Ada_Check and Language_Independent_Check. * prj-nmsc.ads: Replaced Check_Naming_Scheme by 2 procedures: Ada_Check and Language_Independent_Check. * prj-proc.adb: (Process_Declarative_Items): For case-insensitive associative arrays, set the index string to lower case. (Recursive_Check): Call Prj.Nmsc.Ada_Check, instead of Prj.Nmsc.Check_Naming_Scheme. * prj-tree.adb: (Case_Insensitive): New function (Set_Case_Insensitive): New procedure * prj-tree.ads: (Case_Insensitive): New function (Set_Case_Insensitive): New procedure (Project_Node_Record): New flag Case_Insensitive. * prj-util.adb: (Value_Of): new function to get the string value of a single string variable or attribute. * prj-util.ads: (Value_Of): new function to get the string value of a single string variable or attribute. * prj.adb: (Ada_Default_Spec_Suffix): New function (Ada_Default_Impl_Suffix): New function Change definitions of several constants to reflect new components of record types. * prj.ads: (Naming_Data): Change several components to reflect new elements of naming schemes. (Project_Data): New flags Sources_Present and Language_Independent_Checked. (Ada_Default_Spec_Suffix): New function. (Ada_Default_Impl_Suffix): New function. * snames.ads: Modification of predefined names for project manager: added Implementation, Specification_Exceptions, Implementation_Exceptions, Specification_Suffix, Implementation_Suffix, Separate_Suffix, Default_Switches, _Languages, Builder, Cross_Reference, Finder. Removed Body_Part, Specification_Append, Body_Append, Separate_Append, Gnatmake, Gnatxref, Gnatfind, Gnatbind, Gnatlink. * prj.ads: (Ada_Default_Spec_Suffix, Ada_Default_Impl_Suffix): Add comments. * prj-nmsc.adb (Ada_Check): Test that Separate_Suffix is defaulted, not that it is Nil_Variable_Value. * prj.ads: Add ??? for uncommented declarations 2001-10-10 Ed Schonberg <schonber@gnat.com> * sem_prag.adb: (Analyze_Pragma, case External): If entity is a constant, do not indicate possible modification, so that gigi can treat it as a bona fide constant. 2001-10-10 Robert Dewar <dewar@gnat.com> * sem_prag.adb: Add processing for pragma External. * snames.ads: Add entry for pragma External. * par-prag.adb: Add pragma External. * snames.adb: Updated to match snames.ads. 2001-10-10 Ed Schonberg <schonber@gnat.com> * exp_ch4.adb (Expand_N_Allocator): Generate meaningful names for a dynamic task if the allocator appears in an indexed assignment or selected component assignment. * exp_util.adb (Build_Task_Array_Image, Build_Task_Record_Image): For a dynamic task in an assignment statement, use target of assignment to generate meaningful name. 2001-10-10 Ed Schonberg <schonber@gnat.com> * einfo.adb (Write_Field19_Name): Body_Entity is also defined for a generic package. * einfo.ads: Body_Entity is also defined for generic package. Documentation change only * exp_aggr.adb (Build_Array_Aggr_Code): When expanding an others_choice for a discriminated component initialization, convert discriminant references into the corresponding discriminals. * exp_ch3.adb (Get_Simple_Init_Val): Add qualification to aggregate only if original type is private and expression has to be wrapped in a conversion. * checks.adb: (Apply_Constraint_Check): Do not perform length check if expression is an aggregate with only an others_choice. (Length_N_Cond): two references to the same in_parameter (typically the discriminal in an init_proc) denote the same value. Two useful optimization uncovered by bugfixes above. 2001-10-10 Robert Dewar <dewar@gnat.com> * xeinfo.adb: Change int to char in translation of enumeration types. This fixes a problem in the C representation of component alignment. Add 2001 to copyright notice 2001-10-10 Richard Kenner <kenner@gnat.com> * decl.c: (validate_size): Do check size of object of integral type if it is a packed array type. 2001-10-10 Richard Kenner <kenner@gnat.com> * decl.c: (gnat_to_gnu_entity, case object): Also materialize VAR_DECL for constant if not Is_Public but -O0. 2001-10-10 Richard Kenner <kenner@gnat.com> * misc.c (struct lang_hooks): Add new initializer to match GCC change. 2001-10-10 Geert Bosch <bosch@gnat.com> * xnmake.adb (XNmake): Fix handling of -s/-b options. No longer use '/' as switch character, allowing for absolute file names. 2001-10-09 Joseph S. Myers <jsm28@cam.ac.uk> * 4gintnam.ads, Make-lang.in, Makefile.in, config-lang.in: Update FSF address. 2001-10-08 Geert Bosch <bosch@gnat.com> * Makefile.in (treeprs.ads, einfo.h, sinfo.h, nmake.adb, nmake.ads): Automatically build utilities when files need to be regenerated. 2001-10-08 Geert Bosch <bosch@gnat.com> * xsnames.adb: New utility for updating snames.ads and snames.adb 2001-10-08 Zack Weinberg <zack@codesourcery.com> * Make-lang.in (ADAFLAGS): Add -W -Wall. (ADA_FLAGS_TO_PASS): Set ADA_CFLAGS=$(CFLAGS) also. (gnat1): Also depend on attribs.o. (gnatlib, gnatlib-shared): Set CC and ADAC in recursive make. * Makefile.in (X_ADAFLAGS, T_ADAFLAGS): New. (ADAC): Set to @ADAC@ in stage1, $(CC) later. (ADAFLAGS): Add -W -Wall. (ALL_ADAFLAGS, MOST_ADAFLAGS): Add X_ADAFLAGS and T_ADAFLAGS; take out CFLAGS. (.adb.o, .ads.o, a-numaux.o, a-teioed.o, s-interr.o, s-taskin.o, sdefault.o, s-tasdeb.o, s-vaflop.o, a-except.o, s-assert.o, s-stalib.o, s-memory.o, memtrack.o, mlib-tgt.o): Use $(ADAC), not $(CC), as compilation command. (gnattools): Depend directly on tools to build, don't use recursive make. (gnatlib): Set ADA_CFLAGS=$(GNATLIBCFLAGS) in recursive make. * einfo.h, sinfo.h: New files (autogenerated). 2001-10-08 Richard Henderson <rth@redhat.com> * comperr.adb (Abort_In_Progress): New. (Compiler_Abort): Use it to prevent recursion. 2001-10-08 Robert Dewar <dewar@gnat.com> * atree.adb: Set Error_Posted in Error node, helps error recovery. * par-endh.adb (Output_End_Expected): We should also not test Error_Posted on the Error node, since now it is always set. * cstand.adb (Create_Standard): Set Etype of Error to Any_Type to help error recovery. Part of general work on 9407-004. * par.adb: Add ??? for misuse of error * sem_res.adb: (Resolve): Defend against Error, fixes 9407-003. (Resolve_Discrete_Subtype_Indication): Defend against Error. * sinfo.ads (N_Error): Now has Etype field (which will be set to Any_Type to help error recovery). 2001-10-08 Richard Kenner (kenner@gnat.com) * misc.c (gnat_expand_expr, case UNCHECKED_CONVERT_EXPR): Consistently set MEM attributes from expression; fixes bootstrap failure on x86. 2001-10-08 Geert Bosch (bosch@gnat.com) * 5oosinte.adb: Add 2001 to copyright notice. 2001-10-08 Geert Bosch (bosch@gnat.com) * ceinfo.adb: Add utility for consistency checking of einfo.ad[bs]. * csinfo.adb: Add utility for consistency checking of sinfo.ad[bs]. 2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk> * 5oosinte.adb: Fix spelling error of "separate" as "seperate". 2001-10-05 Geert Bosch (bosch@gnat.com) * adaint.h: Small formatting fix. 2001-10-04 Geert Bosch <bosch@gnat.com> * sysdep.c (__gnat_set_binary_mode, __gnat_set_text_mode): Arg is int, not FILE *, in dummy version of functions. * adaint.h (__gnat_set_binary_mode, __gnat_set_text_mode): Arg is int, not FILE *. 2001-10-04 Geert Bosch <bosch@gnat.com> * 3lsoccon.ads: Added file, missed with initial check ins. * 4lintnam.ads: Fix header format. Change Linux to GNU/Linux. * 5iosinte.adb: Change Linux to GNU/Linux. * 5iosinte.ads: Change Linux to GNU/Linux. * 5itaprop.adb: Change Linux to GNU/Linux. * 5itaspri.ads: Change Linux to GNU/Linux. Update copyright notice. * 5lintman.adb: Change Linux to GNU/Linux. * 5lml-tgt.adb: Change Linux to GNU/Linux. * 5losinte.ads: Change Linux to GNU/Linux. * 5lsystem.ads: Change Linux to GNU/Linux. * 5qosinte.adb: Change Linux to GNU/Linux. * 5qosinte.ads: Change Linux to GNU/Linux. * 5qparame.ads: Change Linux to GNU/Linux. * 5qtaprop.adb: Change Linux to GNU/Linux. * 5qtaspri.ads: Change Linux to GNU/Linux. Add 2001 to copyright notice. * 5vintman.ads: Change Linux to GNU/Linux. Fix header format. Add 2001 to copyright notice. * g-soccon.ads: Change Linux to GNU/Linux. * g-trasym.ads: Change Linux to GNU/Linux. Add 2001 to copyright notice. * memtrack.adb: Change Linux to GNU/Linux. * s-intman.ads: Change Linux to GNU/Linux. Add 2001 to copyright notice. Fix header format. * s-stache.adb: Change Linux to GNU/Linux. * adaint.c: Change Linux to GNU/Linux. * cio.c: Change Linux to GNU/Linux. * cstreams.c: Change Linux to GNU/Linux. * init.c: Change Linux to GNU/Linux. * gmem.c: Change Linux to GNU/Linux. * tracebak.c: Change Linux to GNU/Linux. 2001-10-02 Geert Bosch <bosch@gnat.com> * misc.c (insert_default_attributes): Add dummy version. From-SVN: r47950
2001-12-12 22:26:45 +01:00
else
Decl_Node := Error;
-- If we have aspect specifications, skip them
if Aspect_Specifications_Present then
P_Aspect_Specifications (Error);
s-stalib.adb: Add more comments on with statements being needed * s-stalib.adb: Add more comments on with statements being needed * par-ch12.adb: Minor reformatting * prj-dect.ads: Fix copyright header * s-arit64.adb (Multiply_With_Ovflo_Check): Fix case where both inputs fit in 32 bits, but the result still overflows. * s-fatgen.ads: Minor comment improvement * sem_ch4.adb (Analyze_Selected_Component): If the prefix is of a formal derived type, look for an inherited component from the full view of the parent, if any. * checks.ads (Apply_Alignment_Check): New procedure. * exp_ch13.adb (Expand_N_Freeze_Entity): Generate dynamic check to ensure that the alignment of objects with address clauses is appropriate, and raise PE if not. * exp_util.ads (Must_Be_Aligned): Removed, replaced by Exp_Pakd.Known_Aligned_Enough * mdllfile.ads: Minor reformatting * mlib-fil.ads: Minor reformatting * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): Extend previous fix to any component reference if enclosing record has non-standard representation. * g-dirope.ads (Find, Wildcard_Iterator): Moved to child package Iteration * freeze.ads: Make Freeze_Fixed_Point_Type visible, for use in sem_attr. * impunit.adb: Add entry for GNAT.Directory_Operations.Iteration * g-regexp.adb: Remove all debug code, since it isn't required anymore, and it adds dependencies to system.io. * g-dirope.adb (Expand_Path.Var): Correctly detect end of variable name. *** s-stalib.adb 2001/09/03 15:24:33 1.17 --- s-stalib.adb 2001/10/16 13:14:46 1.18 *************** *** 46,59 **** -- elaboration circularities with Ada.Exceptions if polling is on. with System.Soft_Links; ! -- Referenced directly from generated code ! -- Also referenced from exception handling routines. -- This is needed for programs that don't use exceptions explicitely but -- direct calls to Ada.Exceptions are generated by gigi (for example, -- by calling __gnat_raise_constraint_error directly). with System.Memory; ! -- Referenced directly from generated code package body System.Standard_Library is --- 46,62 ---- -- elaboration circularities with Ada.Exceptions if polling is on. with System.Soft_Links; ! -- Referenced directly from generated code using external symbols so it ! -- must always be present in a build, even if no unit has a direct with ! -- of this unit. Also referenced from exception handling routines. -- This is needed for programs that don't use exceptions explicitely but -- direct calls to Ada.Exceptions are generated by gigi (for example, -- by calling __gnat_raise_constraint_error directly). with System.Memory; ! -- Referenced directly from generated code using external symbols, so it ! -- must always be present in a build, even if no unit has a direct with ! -- of this unit. package body System.Standard_Library is *** par-ch12.adb 2001/10/19 15:22:18 1.48 --- par-ch12.adb 2001/10/19 15:24:48 1.49 *************** *** 452,466 **** if Def_Node /= Error then Set_Formal_Type_Definition (Decl_Node, Def_Node); TF_Semicolon; else Decl_Node := Error; if Token = Tok_Semicolon then - -- Avoid further cascaded errors. Scan; end if; end if; - return Decl_Node; end P_Formal_Type_Declaration; --- 452,467 ---- if Def_Node /= Error then Set_Formal_Type_Definition (Decl_Node, Def_Node); TF_Semicolon; + else Decl_Node := Error; + -- If we have semicolon, skip it to avoid cascaded errors + if Token = Tok_Semicolon then Scan; end if; end if; return Decl_Node; end P_Formal_Type_Declaration; *** prj-dect.ads 2001/10/20 10:28:13 1.4 --- prj-dect.ads 2001/10/20 11:43:56 1.5 *************** *** 8,14 **** -- -- -- $Revision$ -- -- ! -- Copyright (C) 2000-2001 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- -- --- 8,14 ---- -- -- -- $Revision$ -- -- ! -- Copyright (C) 2001 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- -- *** s-arit64.adb 2001/02/09 15:10:29 1.16 --- s-arit64.adb 2001/10/20 14:50:39 1.17 *************** *** 325,337 **** T2 := Xhi * Ylo; end if; ! else ! if Yhi /= 0 then ! T2 := Xlo * Yhi; ! else ! return X * Y; ! end if; end if; T1 := Xlo * Ylo; T2 := T2 + Hi (T1); --- 325,339 ---- T2 := Xhi * Ylo; end if; ! elsif Yhi /= 0 then ! T2 := Xlo * Yhi; ! ! else -- Yhi = Xhi = 0 ! T2 := 0; end if; + + -- Here we have T2 set to the contribution to the upper half + -- of the result from the upper halves of the input values. T1 := Xlo * Ylo; T2 := T2 + Hi (T1); *** s-fatgen.ads 2001/07/20 00:59:34 1.9 --- s-fatgen.ads 2001/10/20 18:37:39 1.10 *************** *** 89,97 **** function Unbiased_Rounding (X : T) return T; ! function Valid (X : access T) return Boolean; ! -- The argument must be passed by reference here, as T may be ! -- an abnormal value that can be passed in a floating point register. private pragma Inline (Machine); --- 89,100 ---- function Unbiased_Rounding (X : T) return T; ! function Valid (X : access T) return Boolean; ! -- This function checks if the object of type T referenced by X ! -- is valid, and returns True/False accordingly. The parameter is ! -- passed by reference (access) here, as the object of type T may ! -- be an abnormal value that cannot be passed in a floating-point ! -- register, and the whole point of 'Valid is to prevent exceptions. private pragma Inline (Machine); *** sem_ch4.adb 2001/09/24 22:32:31 1.511 --- sem_ch4.adb 2001/10/21 17:41:52 1.512 *************** *** 2691,2696 **** --- 2691,2708 ---- Check_Misspelled_Selector (Entity_List, Sel); + elsif Is_Generic_Type (Prefix_Type) + and then Ekind (Prefix_Type) = E_Record_Type_With_Private + and then Is_Record_Type (Etype (Prefix_Type)) + then + -- If this is a derived formal type, the parent may have a + -- different visibility at this point. Try for an inherited + -- component before reporting an error. + + Set_Etype (Prefix (N), Etype (Prefix_Type)); + Analyze_Selected_Component (N); + return; + else if Ekind (Prefix_Type) = E_Record_Subtype then *** checks.ads 2001/07/16 01:26:04 1.55 --- checks.ads 2001/10/28 15:13:02 1.56 *************** *** 83,88 **** --- 83,95 ---- -- the object denoted by the access parameter is not deeper than the -- level of the type Typ. Program_Error is raised if the check fails. + procedure Apply_Alignment_Check (E : Entity_Id; N : Node_Id); + -- E is the entity for an object. If there is an address clause for + -- this entity, and checks are enabled, then this procedure generates + -- a check that the specified address has an alignment consistent with + -- the alignment of the object, raising PE if this is not the case. The + -- resulting check (if one is generated) is inserted before node N. + procedure Apply_Array_Size_Check (N : Node_Id; Typ : Entity_Id); -- N is the node for an object declaration that declares an object of -- array type Typ. This routine generates, if necessary, a check that *** exp_ch13.adb 2001/07/16 21:21:29 1.76 --- exp_ch13.adb 2001/10/28 15:13:25 1.77 *************** *** 27,32 **** --- 27,33 ---- ------------------------------------------------------------------------------ with Atree; use Atree; + with Checks; use Checks; with Einfo; use Einfo; with Exp_Ch3; use Exp_Ch3; with Exp_Ch6; use Exp_Ch6; *************** *** 236,245 **** Decl : Node_Id; begin ! if not Is_Type (E) and then not Is_Subprogram (E) then return; end if; E_Scope := Scope (E); -- If we are freezing entities defined in protected types, they --- 237,256 ---- Decl : Node_Id; begin ! -- For object, with address clause, check alignment is OK ! ! if Is_Object (E) then ! Apply_Alignment_Check (E, N); ! ! -- Only other items requiring any front end action are ! -- types and subprograms. ! ! elsif not Is_Type (E) and then not Is_Subprogram (E) then return; end if; + -- Here E is a type or a subprogram + E_Scope := Scope (E); -- If we are freezing entities defined in protected types, they *************** *** 304,314 **** elsif Is_Subprogram (E) then Freeze_Subprogram (N); - - -- No other entities require any front end freeze actions - - else - null; end if; -- Analyze actions generated by freezing. The init_proc contains --- 315,320 ---- *** exp_util.ads 2001/07/23 10:05:17 1.112 --- exp_util.ads 2001/10/28 15:14:04 1.113 *************** *** 372,386 **** -- routine is to help avoid generating troublesome temporaries that -- intefere with the stack checking mechanism. - function Must_Be_Aligned (Obj : Node_Id) return Boolean; - -- Given an object reference, determines whether or not the object - -- is required to be aligned according to its type'alignment value. - -- Normally, objects are required to be aligned, and the result will - -- be True. The situation in which this is not the case is if the - -- object reference involves a component of a packed array, where - -- the type of the component is not required to have strict alignment. - -- In this case, false will be returned. - procedure Remove_Side_Effects (Exp : Node_Id; Name_Req : Boolean := False; --- 372,377 ---- *** mdllfile.ads 2001/10/29 02:06:24 1.2 --- mdllfile.ads 2001/10/29 02:50:12 1.3 *************** *** 26,52 **** -- -- ------------------------------------------------------------------------------ ! -- Simple services used by GNATDLL to deal with Filename extension. package MDLL.Files is No_Ext : constant String := ""; ! function Get_Ext (Filename : in String) ! return String; ! -- return filename's extension. ! ! function Is_Ali (Filename : in String) ! return Boolean; ! -- test if Filename is an Ada library file (.ali). ! ! function Is_Obj (Filename : in String) ! return Boolean; ! -- test if Filename is an object file (.o or .obj). ! ! function Ext_To (Filename : in String; ! New_Ext : in String := No_Ext) ! return String; ! -- return Filename with the extension change to New_Ext. end MDLL.Files; --- 26,51 ---- -- -- ------------------------------------------------------------------------------ ! -- Simple services used by GNATDLL to deal with Filename extension package MDLL.Files is No_Ext : constant String := ""; + -- Used to mark the absence of an extension ! function Get_Ext (Filename : String) return String; ! -- Return extension of Filename ! ! function Is_Ali (Filename : String) return Boolean; ! -- Test if Filename is an Ada library file (.ali). ! ! function Is_Obj (Filename : String) return Boolean; ! -- Test if Filename is an object file (.o or .obj) ! ! function Ext_To ! (Filename : String; ! New_Ext : String := No_Ext) ! return String; ! -- Return Filename with the extension change to New_Ext end MDLL.Files; *** mlib-fil.ads 2001/10/29 02:06:26 1.3 --- mlib-fil.ads 2001/10/29 02:51:28 1.4 *************** *** 36,51 **** return String; -- Return Filename with the extension change to New_Ext. ! function Get_Ext (Filename : in String) return String; -- Return extension of filename. function Is_Archive (Filename : String) return Boolean; -- Test if filename is an archive ! function Is_C (Filename : in String) return Boolean; -- Test if Filename is a C file ! function Is_Obj (Filename : in String) return Boolean; -- Test if Filename is an object file end MLib.Fil; --- 36,51 ---- return String; -- Return Filename with the extension change to New_Ext. ! function Get_Ext (Filename : String) return String; -- Return extension of filename. function Is_Archive (Filename : String) return Boolean; -- Test if filename is an archive ! function Is_C (Filename : String) return Boolean; -- Test if Filename is a C file ! function Is_Obj (Filename : String) return Boolean; -- Test if Filename is an object file end MLib.Fil; *** exp_ch8.adb 2001/10/03 02:17:32 1.30 --- exp_ch8.adb 2001/10/29 17:32:24 1.31 *************** *** 59,65 **** -- of the renamed object. The cases in which this is not true are when -- this address is not computable, since it involves extraction of a -- packed array element, or of a record component to which a component ! -- clause applies (that can specify an arbitrary bit boundary). -- In these two cases, we pre-evaluate the renaming expression, by -- extracting and freezing the values of any subscripts, and then we --- 59,66 ---- -- of the renamed object. The cases in which this is not true are when -- this address is not computable, since it involves extraction of a -- packed array element, or of a record component to which a component ! -- clause applies (that can specify an arbitrary bit boundary), or where ! -- the enclosing record itself has a non-standard representation. -- In these two cases, we pre-evaluate the renaming expression, by -- extracting and freezing the values of any subscripts, and then we *************** *** 211,228 **** end if; elsif Nkind (Nam) = N_Selected_Component then ! if Present (Component_Clause (Entity (Selector_Name (Nam)))) then ! return True; ! elsif Ekind (Entity (Selector_Name (Nam))) = E_Discriminant ! and then Is_Record_Type (Etype (Prefix (Nam))) ! and then not Is_Concurrent_Record_Type (Etype (Prefix (Nam))) ! then ! return True; ! else ! return Evaluation_Required (Prefix (Nam)); ! end if; else return False; --- 212,236 ---- end if; elsif Nkind (Nam) = N_Selected_Component then ! declare ! Rec_Type : Entity_Id := Etype (Prefix (Nam)); ! begin ! if Present (Component_Clause (Entity (Selector_Name (Nam)))) ! or else Has_Non_Standard_Rep (Rec_Type) ! then ! return True; ! ! elsif Ekind (Entity (Selector_Name (Nam))) = E_Discriminant ! and then Is_Record_Type (Rec_Type) ! and then not Is_Concurrent_Record_Type (Rec_Type) ! then ! return True; ! else ! return Evaluation_Required (Prefix (Nam)); ! end if; ! end; else return False; *** g-dirope.ads 2001/08/27 09:48:38 1.12 --- g-dirope.ads 2001/10/29 19:18:13 1.13 *************** *** 38,43 **** --- 38,47 ---- -- can be treated as a file, using open and close routines, and a scanning -- routine is provided for iterating through the entries in a directory. + -- See also child package GNAT.Directory_Operations.Iteration + + with Ada.Strings.Maps; + package GNAT.Directory_Operations is subtype Dir_Name_Str is String; *************** *** 187,248 **** -- returned in target-OS form. Raises Directory_Error if Dir has not -- be opened (Dir = Null_Dir). - generic - with procedure Action - (Item : String; - Index : Positive; - Quit : in out Boolean); - procedure Wildcard_Iterator (Path : Path_Name); - -- Calls Action for each path matching Path. Path can include wildcards '*' - -- and '?' and [...]. The rules are: - -- - -- * can be replaced by any sequence of characters - -- ? can be replaced by a single character - -- [a-z] match one character in the range 'a' through 'z' - -- [abc] match either character 'a', 'b' or 'c' - -- - -- Item is the filename that has been matched. Index is set to one for the - -- first call and is incremented by one at each call. The iterator's - -- termination can be controlled by setting Quit to True. It is by default - -- set to False. - -- - -- For example, if we have the following directory structure: - -- /boo/ - -- foo.ads - -- /sed/ - -- foo.ads - -- file/ - -- foo.ads - -- /sid/ - -- foo.ads - -- file/ - -- foo.ads - -- /life/ - -- - -- A call with expression "/s*/file/*" will call Action for the following - -- items: - -- /sed/file/foo.ads - -- /sid/file/foo.ads - - generic - with procedure Action - (Item : String; - Index : Positive; - Quit : in out Boolean); - procedure Find - (Root_Directory : Dir_Name_Str; - File_Pattern : String); - -- Recursively searches the directory structure rooted at Root_Directory. - -- This provides functionality similar to the UNIX 'find' command. - -- Action will be called for every item matching the regular expression - -- File_Pattern (see GNAT.Regexp). Item is the full pathname to the file - -- starting with Root_Directory that has been matched. Index is set to one - -- for the first call and is incremented by one at each call. The iterator - -- will pass in the value False on each call to Action. The iterator will - -- terminate after passing the last matched path to Action or after - -- returning from a call to Action which sets Quit to True. - -- Raises GNAT.Regexp.Error_In_Regexp if File_Pattern is ill formed. - function Read_Is_Thread_Safe return Boolean; -- Indicates if procedure Read is thread safe. On systems where the -- target system supports this functionality, Read is thread safe, --- 191,196 ---- *************** *** 259,263 **** --- 207,215 ---- Null_Dir : constant Dir_Type := null; pragma Import (C, Dir_Separator, "__gnat_dir_separator"); + + Dir_Seps : constant Ada.Strings.Maps.Character_Set := + Ada.Strings.Maps.To_Set ("/\"); + -- UNIX and DOS style directory separators. end GNAT.Directory_Operations; *** freeze.ads 2001/10/29 02:06:04 1.15 --- freeze.ads 2001/10/30 01:36:24 1.16 *************** *** 205,210 **** --- 205,215 ---- -- so need to be similarly treated. Freeze_Expression takes care of -- determining the proper insertion point for generated freeze actions. + procedure Freeze_Fixed_Point_Type (Typ : Entity_Id); + -- Freeze fixed point type. For fixed-point types, we have to defer + -- setting the size and bounds till the freeze point, since they are + -- potentially affected by the presence of size and small clauses. + procedure Freeze_Itype (T : Entity_Id; N : Node_Id); -- This routine is called when an Itype is created and must be frozen -- immediately at the point of creation (for the sake of the expansion *** impunit.adb 2001/09/26 07:14:11 1.14 --- impunit.adb 2001/10/30 04:33:45 1.15 *************** *** 195,200 **** --- 195,201 ---- "g-curexc", -- GNAT.Current_Exception "g-debpoo", -- GNAT.Debug_Pools "g-debuti", -- GNAT.Debug_Utilities + "g-diopit", -- GNAT.Directory_Operations.Iteration "g-dirope", -- GNAT.Directory_Operations "g-dyntab", -- GNAT.Dynamic_Tables "g-exctra", -- GNAT.Exception_Traces *** g-regexp.adb 2001/10/21 11:04:16 1.28 --- g-regexp.adb 2001/10/30 15:25:04 1.29 *************** *** 32,38 **** -- -- ------------------------------------------------------------------------------ - with System.IO; with Unchecked_Deallocation; with Ada.Exceptions; with GNAT.Case_Util; --- 32,37 ---- *************** *** 73,82 **** end record; -- Deterministic finite-state machine - Debug : constant Boolean := False; - -- When True, the primary and secondary tables will be printed. - -- Gnat does not generate any code if this variable is False; - ----------------------- -- Local Subprograms -- ----------------------- --- 72,77 ---- *************** *** 188,199 **** pragma No_Return (Raise_Exception); -- Raise an exception, indicating an error at character Index in S. - procedure Print_Table - (Table : Regexp_Array; - Num_States : State_Index; - Is_Primary : Boolean := True); - -- Print a table for debugging purposes - -------------------- -- Create_Mapping -- -------------------- --- 183,188 ---- *************** *** 1225,1309 **** end loop; end loop; - if Debug then - System.IO.New_Line; - System.IO.Put_Line ("Secondary table : "); - Print_Table (R.States, Nb_State, False); - end if; - return (Ada.Finalization.Controlled with R => R); end; end Create_Secondary_Table; - ----------------- - -- Print_Table -- - ----------------- - - procedure Print_Table - (Table : Regexp_Array; - Num_States : State_Index; - Is_Primary : Boolean := True) - is - function Reverse_Mapping (N : Column_Index) return Character; - -- Return the character corresponding to a column in the mapping - - --------------------- - -- Reverse_Mapping -- - --------------------- - - function Reverse_Mapping (N : Column_Index) return Character is - begin - for Column in Map'Range loop - if Map (Column) = N then - return Column; - end if; - end loop; - - return ' '; - end Reverse_Mapping; - - -- Start of processing for Print_Table - - begin - -- Print the header line - - System.IO.Put (" [*] "); - - for Column in 1 .. Alphabet_Size loop - System.IO.Put - (String'(1 .. 1 => Reverse_Mapping (Column)) & " "); - end loop; - - if Is_Primary then - System.IO.Put ("closure...."); - end if; - - System.IO.New_Line; - - -- Print every line - - for State in 1 .. Num_States loop - System.IO.Put (State'Img); - - for K in 1 .. 3 - State'Img'Length loop - System.IO.Put (" "); - end loop; - - for K in 0 .. Alphabet_Size loop - System.IO.Put (Table (State, K)'Img & " "); - end loop; - - for K in Alphabet_Size + 1 .. Table'Last (2) loop - if Table (State, K) /= 0 then - System.IO.Put (Table (State, K)'Img & ","); - end if; - end loop; - - System.IO.New_Line; - end loop; - - end Print_Table; - --------------------- -- Raise_Exception -- --------------------- --- 1214,1223 ---- *************** *** 1345,1356 **** (Table, Num_States, Start_State, End_State); end if; - if Debug then - Print_Table (Table.all, Num_States); - System.IO.Put_Line ("Start_State : " & Start_State'Img); - System.IO.Put_Line ("End_State : " & End_State'Img); - end if; - -- Creates the secondary table R := Create_Secondary_Table --- 1259,1264 ---- *************** *** 1451,1467 **** New_Table := new Regexp_Array (Table'First (1) .. New_Lines, Table'First (2) .. New_Columns); New_Table.all := (others => (others => 0)); - - if Debug then - System.IO.Put_Line ("Reallocating table: Lines from " - & State_Index'Image (Table'Last (1)) - & " to " - & State_Index'Image (New_Lines)); - System.IO.Put_Line (" and columns from " - & Column_Index'Image (Table'Last (2)) - & " to " - & Column_Index'Image (New_Columns)); - end if; for J in Table'Range (1) loop for K in Table'Range (2) loop --- 1359,1364 ---- *** g-dirope.adb 2001/10/31 21:36:04 1.20 --- g-dirope.adb 2001/11/01 16:39:33 1.21 *************** *** 371,387 **** E := E + 1; Var_Name : loop ! exit Var_Name when E = Path'Last; if Characters.Handling.Is_Letter (Path (E)) or else Characters.Handling.Is_Digit (Path (E)) then E := E + 1; else - E := E - 1; exit Var_Name; end if; end loop Var_Name; declare Env : OS_Lib.String_Access := OS_Lib.Getenv (Path (K .. E)); --- 371,388 ---- E := E + 1; Var_Name : loop ! exit Var_Name when E > Path'Last; if Characters.Handling.Is_Letter (Path (E)) or else Characters.Handling.Is_Digit (Path (E)) then E := E + 1; else exit Var_Name; end if; end loop Var_Name; + + E := E - 1; declare Env : OS_Lib.String_Access := OS_Lib.Getenv (Path (K .. E)); 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch10.adb (Install_Withed_Unit): If the unit is a generic instance that is the parent of other generics, the instance body replaces the instance node. Retrieve the instance of the spec, which is the one that is visible in clients and within the body. 2001-12-11 Vincent Celier <celier@gnat.com> * gnatmain.adb: Initial version. * gnatmain.ads: Initial version. * prj-attr.adb (Initialisation_Data): Add package Gnatstub. * snames.adb: Updated to match snames.ads. * snames.ads: Added Gnatstub. 2001-12-11 Vincent Celier <celier@gnat.com> * prj-attr.adb (Initialization_Data): Change name from Initialisation_Data. 2001-12-11 Emmanuel Briot <briot@gnat.com> * g-regpat.adb (Parse_Literal): Properly handle simple operators ?, + and * applied to backslashed expressions like \r. 2001-12-11 Vasiliy Fofanov <fofanov@gnat.com> * g-os_lib.ads: String_List type added, Argument_List type is now subtype of String_List. 2001-12-11 Robert Dewar <dewar@gnat.com> * g-os_lib.ads: Change copyright to FSF Add comments for String_List type 2001-12-11 Vincent Celier <celier@gnat.com> * g-dirope.adb (Expand_Path): Fix bug. (wrong length when adding a string to the buffer). 2001-12-11 Ed Schonberg <schonber@gnat.com> * freeze.adb: Make Freeze_Fixed_Point_Type visible, for use in sem_attr. * sem_attr.adb: Simplify previous fix for Address. (Set_Bounds): If prefix is a non-frozen fixed-point type, freeze now, to avoid anomalies where the bound of the type appears to raise constraint error. 2001-12-11 Robert Dewar <dewar@gnat.com> * lib-xref.adb (Output_Refs): Make sure pointers are always properly handled. 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb (Analyze_Subprogram_Instantiation): Check for a renamed unit before checking for recursive instantiations. 2001-12-11 Emmanuel Briot <briot@gnat.com> * prj.ads: Add comments for some of the fields. 2001-12-11 Robert Dewar <dewar@gnat.com> * lib-xref.adb (Output_Refs): Don't output type references outside the main unit if they are not otherwise referenced. 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_attr.adb (Analyze_attribute, case Address and Size): Simplify code and diagnose additional illegal uses * sem_util.adb (Is_Object_Reference): An indexed component is an object only if the prefix is. 2001-12-11 Vincent Celier <celier@gnat.com> * g-diopit.adb: Initial version. * g-diopit.ads: Initial version. * g-dirope.adb: (Expand_Path): Avoid use of Unbounded_String (Find, Wildcard_Iterator): Moved to child package Iteration * Makefile.in: Added g-diopit.o to GNATRTL_NONTASKING_OBJS 2001-12-11 Robert Dewar <dewar@gnat.com> * sem_attr.adb: Minor reformatting 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb: Clarify some ???. 2001-12-11 Robert Dewar <dewar@gnat.com> * exp_util.adb (Must_Be_Aligned): Removed, replaced by Exp_Pakd.Known_Aligned_Enough * sem_ch13.adb (Check_Address_Alignment): Removed, extended version is moved to Exp_Ch13. 2001-12-11 Robert Dewar <dewar@gnat.com> * einfo.ads: Minor reformatting * exp_ch5.adb: Add comment for previous.change * ali.adb: New interface for extended typeref stuff. * ali.ads: New interface for typeref stuff. * checks.adb (Apply_Alignment_Check): New procedure. * debug.adb: Add -gnatdM for modified ALI output * exp_pakd.adb (Known_Aligned_Enough): Replaces Known_Aligned_Enough. * lib-xref.adb: Extend generation of <..> notation to cover subtype/object types. Note that this is a complete rewrite, getting rid of the very nasty quadratic algorithm previously used for derived type output. * lib-xref.ads: Extend description of <..> notation to cover subtype/object types. Uses {..} for these other cases. Also use (..) for pointer types. * sem_util.adb (Check_Potentially_Blocking_Operation): Slight cleanup. * exp_pakd.adb: Minor reformatting. Note that prevous RH should say: (Known_Aligned_Enough): Replaces Must_Be_Aligned. 2001-12-11 Vincent Celier <celier@gnat.com> * gnatcmd.adb: Changed /COMPILE_ONLY to /ACTIONS=COMPILE Changed /BIND_ONLY to /ACTIONS=BIND Changed /LINK_ONLY to /ACTIONS=LINK 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch8.adb (Find_Selected_Component): improved search for a candidate package in case of error. * sem_ch12.adb (Inline_Instance_Body): place head of use_clause chain back on scope stack before reinstalling use clauses. * exp_ch5.adb (Expand_N_If_Statement): if Constant_Condition_Warnings is enabled, do not kill the code for the condition, to preserve warning. 2001-12-11 Robert Dewar <dewar@gnat.com> * checks.adb (Insert_Valid_Check): Apply validity check to expression of conversion, not to result of conversion. 2001-12-11 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Build_Derived_Record_Type): set Controlled flag before freezing parent. If the declarations are mutually recursive, an access to the current record type may be frozen before the derivation is complete. 2001-12-05 Vincent Celier <celier@gnat.com> * gnatcmd.adb: (MAKE): Add new translations: -b /BIND_ONLY, -c /COMPILE_ONLY, -l /LINK_ONLY * opt.ads: (Bind_Only): New Flag (Link_Only): New flag * switch.adb (Scan_Make_Switches): Add processing for -b (Bind_Only) and -l (Link_Only) * makeusg.adb: Add new switches -b and -l. Update Copyright notice. * make.adb: (Do_Compile_Step, Do_Bind_Step, Do_Link_Step): New flags. (Gnatmake): Set the step flags. Only perform a step if the corresponding step flag is True. (Scan_Make_Arg): Reset the bind and link step flags when -u or -gnatc has been specified. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_eval.adb (Eval_Concatenation): If left operand is a null string, get bounds from right operand. * sem_eval.adb: Minor reformatting * exp_util.adb (Make_Literal_Range): use bound of literal rather than Index'First, its lower bound may be different from 1. * exp_util.adb: Undo earlier change, fixes ACVC regressions C48009B and C48009J 2001-12-05 Vincent Celier <celier@gnat.com> * prj-nmsc.adb Minor reformatting * prj-nmsc.adb (Language_Independent_Check): Reset Library flag if set and libraries are not supported. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Build_Derived_Private_Type): set Public status of private view explicitly, so the back-end can treat as a global when appropriate. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb (Instantiate_Package_Body): if instance is a compilation unit, always replace instance node with new body, for ASIS use. 2001-12-05 Vincent Celier <celier@gnat.com> * prj-nmsc.adb (Language_Independent_Check): Issue a warning if libraries are not supported and both attributes Library_Name and Library_Dir are specified. * prj-proc.adb (Expression): Set location of Result to location of first term. * Makefile.in: Add mlib.o, mlib-fil.o, mlib-tgt and mlib-utl to GNATLS. (prj-nmsc is now importing MLib.Tgt) * prj-proc.adb: Put the change indicated above that was forgotten. 2001-12-05 Robert Dewar <dewar@gnat.com> * Makefile.in: Add dependencies for System.IO for GNAT.Regexp 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Build_Derived_Concurrent_Type): If derivation imposes a constraint, introduce explicit subtype declaration and derive from it. * sem_ch3.adb: Minor reformatting 2001-12-05 Robert Dewar <dewar@gnat.com> * checks.adb (Determine_Range): Increase cache size for checks. Minor reformatting * exp_ch6.adb: Minor reformatting (Expand_N_Subprogram_Body): Reset Is_Pure for any subprogram that has a parameter whose root type is System.Address, since treating such subprograms as pure in the code generator is almost surely a mistake that will lead to unexpected results. * exp_util.adb (Remove_Side_Effects): Clean up old ??? comment and change handling of conversions. * g-regexp.adb: Use System.IO instead of Ada.Text_IO. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Analyze_Object_Declaration): If expression is an aggregate with static wrong size, attach generated Raise node to declaration. 2001-12-05 Robert Dewar <dewar@gnat.com> * sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute. Fixes compilation abandoned bomb in B24009B. 2001-12-05 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb: Document use of Associated_Node on Selected_Components. (Save_Global_Operand_Descendants): Change to Save_Entity_Descendants, to clarify use of untyped descendant fields. 2001-12-05 Robert Dewar <dewar@gnat.com> * prj-dect.ads: Add ??? comment Add 2001 to copyright notice (was not done in after all) * prj-part.adb: Minor reformatting. Reword one awkward error message. * prj.ads: Minor reformatting throughout, and add some ??? comments * snames.ads: Minor reformatting 2001-12-05 Geert Bosch <bosch@gnat.com> * snames.adb: Autoupdate 2001-12-05 Vincent Celier <celier@gnat.com> * prj-dect.adb (Parse): Rename parameter Modifying to Extends. * prj-dect.ads (Parse): Rename parameter Modifying to Extends. * prj-env.adb: Minor comment changes (modifying -> extends). * prj-nmsc.adb: Minor comment changes (modifying -> extends). * prj-part.adb (Parse_Single_Project): Change Tok_Modifying to Tok_Extends. * prj.adb (Initialize): Change Modifying to Extends. * scans.ads (Token_Type): Change Tok_Modifying to Tok_Extends. * prj.ads: Minor comment change (Modifying -> extending). * snames.ads: Change modifying to extends. 2001-12-05 Robert Dewar <dewar@gnat.com> * sem_warn.adb: Remove stuff for conditionals, we are not going to do this after all. * sem_warn.ads: Remove stuff for conditionals, we are not going to do this after all. Add 2001 to copyright notice 2001-12-04 Geert Bosch <bosch@gnat.com> * einfo.h, sinfo.h, treeprs.ads: Regenerate. 2001-12-04 Robert Dewar <dewar@gnat.com> * errout.adb (Error_Msg): Ignore attempt to put error msg at junk location if we already have errors. Stops some cases of cascaded errors. * errout.adb: Improve comment. 2001-12-04 Robert Dewar <dewar@gnat.com> * sem_ch12.adb: (Analyze_Formal_Type_Definition): Defend against Error. (Analyze_Formal_Subprogram): Defend against Error. * par-ch12.adb (F_Formal_Type_Declaration): In case of error, remove following semicolon if present. Removes cascaded error. 2001-12-04 Douglas B. Rupp <rupp@gnat.com> * bindgen.adb: (Gen_Exception_Table_Ada): Write "begin" and then return if Num exceptions equals 0. (Gen_Exception_Table_C): Return if Num exceptions equals 0. Fixes PIWG E tests (which have to be run with -gnatL). 2001-12-04 Robert Dewar <dewar@gnat.com> * einfo.ads: Minor reformatting 2001-12-04 Ed Schonberg <schonber@gnat.com> * einfo.ads: Block_Node points to the identifier of the block, not to the block node itself, to preserve the link when the block is rewritten, e.g. within an if-statement with a static condition. * inline.adb (Cleanup_Scopes): recover block statement from block entity using new meaning of Block_Node. * sem_ch5.adb (Analyze_Block_Statement): set Block_Node to point to identifier of block node, rather than to node itself. 2001-12-04 Gary Dismukes <dismukes@gnat.com> * layout.adb: (Get_Max_Size): Fix "start of processing" comment to say Get_Max_Size. (Discrimify): Go back to setting the Etypes of the selected component because the Vname component does not exist at this point and will fail name resolution. Also set Analyzed. Remove with and use of Sem_Res. 2001-12-04 Arnaud Charlet <charlet@gnat.com> * Makefile.in: (HIE_SOURCES): add s-fat*. 2001-12-04 Robert Dewar <dewar@gnat.com> * sem_attr.adb: (Compile_Time_Known_Attribute): New procedure. (Eval_Attribute, case Size): Use Compile_Time_Known_Attribute to ensure proper range check. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_ch7.adb (New_Private_Type): Set Is_Tagged_Type flag before processing discriminants to diagnose illegal default values. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_attr.adb (Resolve_Attribute): Handle properly an non-classwide access discriminant within a type extension that constrains its parent discriminants. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_ch3.adb (Find_Type_Of_Subtype_Indic): If subtype indication is malformed, use instance of Any_Id to allow analysis to proceed. * par-ch12.adb (P_Formal_Type_Declaration): Propagate Error if type definition is illegal. (P_Formal_Derived_Type_Definition): Better recovery when TAGGED is misplaced. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_warn.adb (Output_Unreferenced_Messages): Extend previous fix to constants. 2001-12-04 Robert Dewar <dewar@gnat.com> * errout.adb: Minor reformatting 2001-12-04 Robert Dewar <dewar@gnat.com> * exp_util.adb: Minor reformatting from last change * errout.adb (Check_For_Warning): For a Raised_Constraint_Error node which is a rewriting of an expression, traverse the original expression to remove warnings that may have been posted on it. 2001-12-04 Ed Schonberg <schonber@gnat.com> * exp_util.adb (Must_Be_Aligned): Return false for a component of a record that has other packed components. 2001-12-04 Douglass B. Rupp <rupp@gnat.com> * adaint.c: Minor cleanups. 2001-12-04 Douglass B. Rupp <rupp@gnat.com> * adaint.c: Do not use utime.h on vxworks. 2001-12-04 Arnaud Charlet <charlet@gnat.com> * Makefile.adalib: Clarify step 3 (use of gnat.adc) as it causes more confusion than it solves. 2001-12-04 Geert bosch <bosch@gnat.com> * einfo.h, nmake.adb, nmake.ads, sinfo.h treeprs.ads: Regenerate. 2001-12-04 Geert Bosch <bosch@gnat.com> * Makefile.in (update-sources): New target. For use by gcc_release script. 2001-12-04 Ed Schonberg <schonber@gnat.com> * sem_prag.adb (Analyze_Pragma, case Validity_Checks): do not treat as a configuration pragma, it is now legal wherever a pragma can appear. 2001-12-04 Zack Weinberg <zack@codesourcery.com> * Makefile.in: Don't set ALL. Delete @cross_defines@, @cross_overrides@, @build_overrides@ stanzas. INTERNAL_CFLAGS is now @CROSS@ -DIN_GCC; update comment. 2001-12-04 Robert Dewar <dewar@gnat.com> * einfo.adb (Has_Pragma_Pure_Function): New flag. Fix problem that stopped ceinfo from working * einfo.ads (Has_Pragma_Pure_Function): New flag. * sem_prag.adb (Pure_Function): Set new flag Has_Pragma_Pure_Function. 2001-12-04 Douglas B. Rupp <rupp@gnat.com> * gnatchop.adb: (File_Time_Stamp): New procedure. (Preserve_Mode): New boolean. (Write_Unit): Pass time stamp. Implement -p switch (preserve time stamps). * gnatcmd.adb (CHOP): Add translation for -p (/PRESERVE). * gnatchop.adb: Do usage info for -p switch * adaint.h (__gnat_set_file_time_name): New function * adaint.c (__gnat_set_file_time_name): Implement * adaint.h: Fix typo 2001-12-03 Robert Dewar <dewar@gnat.com> * sinfo.ads: Minor reformatting. N_Freeze_Entity node does not have Associated_Node. 2001-12-03 Robert Dewar <dewar@gnat.com> * prj-proc.adb: Minor reformatting * make.adb: Minor reformatting 2001-12-03 Geert Bosch <bosch@gnat.com> * make.adb: Minor reformatting. 2001-12-03 Robert Dewar <dewar@gnat.com> * sem_ch12.adb: Minor reformatting 2001-12-03 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb (Inline_Instance_Body): Use Save_Scope_Stack and push Standard on the stack before analyzing the instance body, in order to have a clean visibility environment. * sem_ch12.adb (Inline_Instance_Body): Remove redundant code. 2001-12-03 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb (Instantiate_Package_Body): Protect against double instantiation of a body that contains an inlined body. 2001-12-03 Ed Schonberg <schonber@gnat.com> * sem_ch12.adb: (Analyze_generic_subprogram_Declaration): Set outer_generic_scope, to prevent freezing within formal packages. (Freeze_Subprogram_Body): If body comes from another instance that appeared before its own body, place freeze node at end of current declarative part, to prevent a back-end crash. (Inline_Instance_Body): Handle properly a package instance within a subprogram instance that is a child unit. 2001-12-01 Graham Stott <grahams@redhat.com> * Makefile.in (misc.o): Add missing $(srcdir) prefix and add optabs.h dependency. * misc.c: Include optabs.h (gnat_tree_code_type): Make static and const. (gnat_tree_code_length): Likewise. (gnat_tree_code_name): Likewise. (update_setjmp_buf): Obtain operands mode from insn_data. 2001-11-29 Richard Henderson <rth@redhat.com> * init.c: Remove obsolete dwarf2 frame.h section. 2001-11-29 Joseph S. Myers <jsm28@cam.ac.uk> * Make-lang.in (ada.generated-manpages): New dummy target. 2001-11-29 Ed Schonberg <schonber@gnat.com> * g-os_lib.adb (Add_To_Command): use explicit loop to move string into Command, an array conversion is illegal here. Uncovered by ACATS B460005. 2001/11/28 Geert Bosch <bosch@gnat.com> * init.c: Minor whitespace changes. 2001-11-28 Doug Rupp <rupp@gnat.com> * init.c: (__gnat_install_handler,VMS): Increase size of alternate signal stack. 2001-11-28 Zack Weinberg <zack@codesourcery.com> * misc.c (gnat_expand_constant): Move declaration above definition of lang_hooks. (LANG_HOOKS_EXPAND_CONSTANT): Set to gnat_expand_constant. (gnat_init): lang_expand_constant no longer exists. (internal_error_function): Remove #ifdef HAVE_VPRINTF. We always have vprintf. (gnat_init): Always call set_internal_error_function. 2001-11-27 Andreas Jaeger <aj@suse.de> * Makefile.in (stamp-tool_src_dir): Use symbolic link. 2001-11-27 Laurent Guerby <guerby@acm.org> * Makefile.in: Regenerate Ada dependencies. 2001-11-26 Richard Henderson <rth@redhat.com> * Make-lang.in (gnatbind, gnatmake, gnatbl, gnatchop, gnatcmd, gnatlink, gnatkr, gnatls, gnatmem, gnatprep, gnatpsta, gnatpsys, gnatxref, gnatfind, gnatlbr): Depend on CONFIG_H and prefix.o. 2001-11-25 Laurent Guerby <guerby@acm.org> * sysdep.c (rts_get_*): Fix style. 2001-11-19 Laurent Guerby <guerby@acm.org> * Makefile.in (INCLUDES_FOR_SUBDIR): Remove redundant system include since it is of no apparent use and cause warnings. 2001-11-18 Neil Booth <neil@daikokuya.demon.co.uk> * misc.c (gnat_decode_option, gnat_init_options): Make definitions static too. (gnat_init): Don't return NULL. (finish_parse): Remove. 2001-11-17 Laurent Guerby <guerby@acm.org> * Make-lang.in (GNATLIBFLAGS): Add -W -Wall. * gigi.h (init_decl_processing): Rename to gnat_init_decl_processing. * io-aux.c: Provide K&R prototypes to all functions, reformat code. * lang-spec.h: Add missing struct field to silence warnings. * sysdep.c (rts_get_*): Provide K&R prototype. * sysdep.c (Unlock_Task, Lock_Task): Move to K&R prototype. * traceback.c (Unlock_Task, Lock_Task): Likewise. * tracebak.c (__gnat_backtrace): Remove unused variable. * utils.c (end_subprog_body): Move to K&R style. Thu Nov 15 18:16:17 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * trans.c, utils2.c: Remove PALIGN parameter to get_inner_reference. 2001-11-15 Neil Booth <neil@daikokuya.demon.co.uk> * misc.c (gnat_init): Change prototype. Include the functionality of the old init_parse and init_decl_processing. (gnat_init_decl_processing): New prototype. (init_parse): Remove. * utils.c (init_decl_processing): Rename gnat_init_decl_processing. 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> * misc.c (gnat_print_decl, gnat_print_type): Renamed. (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE): Override. (print_lang_statistics, lang_print_xnode, print_lang_identifier, set_yydebug): Remove. 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> * misc.c (LANG_HOOKS_NAME, LANG_HOOKS_IDENTIFIER_SIZE): Override. (struct lang_hooks): Constify. (language_string, lang_identify): Remove. * utils.c (init_decl_processing): Update. 2001-11-06 Neil Booth <neil@cat.daikokuya.demon.co.uk> * misc.c: Include langhooks-def.h. * Makefile.in: Update. 2001-10-30 Robert Dewar <dewar@gnat.com> * style.adb: (Check_Identifier): Rewrite circuit to be compatible with use of letters in the upper half of ASCII. (Check_Identifier): Minor reformatting 2001-10-30 Geert Bosch <bosch@gnat.com> * (Associated_Node, Set_Associated_Node): Do not check for Freeze_Entity. 2001-10-30 Robert Dewar <dewar@gnat.com> * a-reatim.ads: Minor reformatting 2001-10-30 Robert Dewar <dewar@gnat.com> * gnatdll.adb: Minor reformatting throughout. Many ??? added for undocumented declarations. 2001-10-30 Pascal Obry <obry@gnat.com> * gnatdll.adb (Parse_Command_Line): handle -g option to be passed to the binder and linker. Minor style fix. * mdll.ads: Fix layout. Update copyright notice. * mdll.adb: Fix layout. Update copyright notice. 2001-10-30 Robert Dewar <dewar@gnat.com> * usage.adb: Minor fix to output for -gnaty. 2001-10-30 Ed Schonberg <schonber@gnat.com> * a-reatim.ads: Makes Seconds_Count into a 64-bit integer, to accommodate all its possible values. * a-reatim.adb (Split): Special-case handling of Time_Span_First and of small absolute values of T. 2001-10-30 Richard Kenner <kenner@gnat.com> * misc.c (gnat_expand_expr, case NULL_EXPR): Remove call to set_mem_attributes since not needed and wrong if RESULT if a REG; fixes ACATS failures. 2001-10-30 Geert Bosch <bosch@gnat.com> * 86numaux.adb, a-tigeau.ads, a-wtgeau.ads, fname-sf.ads, g-traceb.ads, s-tasdeb.ads, sem_maps.ads: Add 2001 to copyright notice. 2001-10-30 Robert Dewar <dewar@gnat.com> * bindusg.adb: Undocument -f switch. * gnatcmd.adb: Remove /FULL_ELABORATION. * opt.ads (Force_RM_Elaboration_Order): Document that this is obsolescent. * gnatbind.adb: Output new warning for use of obsolescent -f switch. * gnatbind.adb: Minor update of warning msg. 2001-10-30 Vincent Celier <celier@gnat.com> * gnatcmd.adb (MAKE, BIND, LINK, LIST, FIND, XREF): Add translations for project file switches (-P (/PROJECT_FILE=), -X (/EXTERNAL_REFERENCE=) and -vPx (/PROJECT_FILE_VERBOSITY=DEFAULT or MEDIUM or HIGH) 2001-10-30 Geert Bosch <bosch@gnat.com> * decl.c: Minor whitespace fixes. 2001-10-30 Richard Kenner <kenner@gnat.com> * utils2.c (build_allocator): Test for SIZE overflow in array case too 2001-10-30 Geert Bosch <bosch@gnat.com> * ali-util.adb (Initialize_Checksum): Use out-mode instead of in out. Found due to GCC 3.0 warning of using uninitialized value. * layout.adb: (Get_Max_Size): Use variant record for tracking value/expression. Makes logic clearer and prevents warnings for uninitialized variables. (Layout_Array_Type): Use variant record for tracking value/expression. Makes logic clearer and prevents warnings for uninitialized variables. 2001-10-30 Robert Dewar <dewar@gnat.com> * lib.adb: Minor reformatting * s-taprop.ads: Minor reformatting 2001-10-29 Laurent Guerby <guerby@acm.org> * init.c: (Raise_From_Signal_Handler, Propagate_Signal_Exception): Make arg const. (_gnat_error_handler): Make MSG const. 2001-10-29 Richard Kenner <kenner@gnat.com> * sysdep.c: Fix localtime_r problem on LynxOS. Also remove #elif to avoid warnings. * misc.c (yyparse): Don't set up and register jmpbuf; remove decls used by this. * decl.c (annotate_value): Make SIZE unsigned to avoid warning. 2001-10-28 Joseph S. Myers <jsm28@cam.ac.uk> * 86numaux.adb, a-tigeau.ads, a-wtgeau.ads, decl.c, exp_ch6.adb, exp_ch9.adb, exp_util.adb, fname-sf.ads, freeze.ads, g-awk.adb, g-comlin.ads, g-dirope.adb, g-dyntab.ads, g-socket.ads, g-table.ads, g-traceb.ads, gnat-style.texi, gnatchop.adb, init.c, layout.adb, layout.ads, mdllfile.ads, mlib-fil.ads, osint.ads, s-fatgen.adb, s-imgrea.adb, s-taprop.ads, s-tasdeb.ads, sem_aggr.adb, sem_attr.adb, sem_case.ads, sem_ch13.adb, sem_ch3.adb, sem_elab.adb, sem_maps.ads, sem_res.adb, sem_util.ads, sinfo.ads, sinput.ads, table.adb, table.ads, types.ads, urealp.adb: Fix spelling errors. 2001-10-27 Laurent Guerby <guerby@acm.org> * trans.c (gigi): Fix non determinism leading to bootstrap comparison failures for debugging information. 2001-10-26 Florian Weimer <fw@deneb.enyo.de> * gnat_rm.texi: Use @./@: where appropriate. 2001-10-26 Robert Dewar <dewar@gnat.com> * sinfo.adb: Define Associated_Node to overlap Entity field. Cleanup. 2001-10-26 Richard Kenner <kenner@gnat.com> * gmem.c (__gnat_gmem_read_next): Properly check for EOF 2001-10-26 Richard Kenner <kenner@gnat.com> * decl.c (validate_size): Modify message for bad size to avoid implication that compiler is modifying the size. 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-util.adb: Minor reformatting. Fix bad header format. 2001-10-26 Robert Dewar <dewar@gnat.com> * sinfo.ads: Define Associated_Node to overlap Entity field. Cleanup. * sinfo.ads: Clarify use of Associated_Node (documentation only). * sem_ch12.adb: Change Node4 to Associated_Node. Change Associated_Node to Get_Associated_Node. Put use of Unchecked_Access much more narrowly in places where needed. These are cleanups. 2001-10-26 Joel Brobecker <brobecke@gnat.com> * 5zosinte.ads (null_pthread): new constant. * 5ztaprop.adb: (Initialize_TCB): Initialize thread ID to null, to be able to verify later that this field has been set. (Finalize_TCB): ditto. (Suspend_Task): Verify that the thread ID is not null before using it. (Resume_Task): ditto. * s-tasdeb.adb: (Resume_All_Tasks): Lock the tasks list before using it. (Suspend_All_Tasks): ditto. 2001-10-26 Richard Kenner <kenner@gnat.com> * decl.c (gnat_to_gnu_entity, case E_General_Access_Type): Make constant variant of designated type for Is_Access_Constant. Call update_pointer_to with main variant. * trans.c (process_freeze_entity, process_type): Call update_pointer_to on main variant. * utils.c (update_pointer_to): Make corresponding variant for NEW_TYPE. If main variant, update all other variants. * utils2.c (build_unary_op, case INDIRECT_REF): No longer set TREE_STATIC. 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-util.adb: Minor reformatting 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-util.adb: Minor reformatting 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-attr.adb: Minor reformatting throughout 2001-10-26 Robert Dewar <dewar@gnat.com> * prj-attr.ads: Minor reformatting Add ??? comment (this whole spec has almost no comments) 2001-10-26 Vincent Celier <celier@gnat.com> * g-os_lib.adb (Normalize_Pathname): Preserve the double slash ("//") that precede the drive letter on Interix. 2001-10-26 Geert Bosch <bosch@gnat.com> * gnat_rm.texi: Add GNAT Reference Manual. 2001-10-25 Robert Dewar <dewar@gnat.com> * sem_ch8.adb (Analyze_Package_Renaming): Skip analysis if Name is Error. Similar change for other renaming cases. 2001-10-25 Robert Dewar <dewar@gnat.com> * s-atacco.ads: Add pragma Inline_Always for functions. Fix header format. Add copyright 2001 2001-10-25 Ed Schonberg <schonber@gnat.com> * par-ch3.adb (P_Subtype_Mark_Resync): for an anonymous array return Error rather than Empty so that analysis can proceed. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_util.adb (Enter_Name): better handling of cascaded error messages when a unit appears in its own context. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_util.adb (Defining_Entity): in case of error, attach created entity to specification, so that semantic analysis can proceed. 2001-10-25 Robert Dewar <dewar@gnat.com> * sem_util.adb (Defining_Entity): Deal with Error. (Process_End_Label): Deal with bad end label for. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_elab.adb (Check_A_Call): refine message when call is in an instance but callee is not declared in the generic unit. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_elab.adb (Check_A_Call): check for renaming before finding the enclosing unit, which may already be different from the calling unit. 2001-10-25 Geert Bosch <bosch@gnat.com> * 4gintnam.ads: fix header format. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_res.adb (Resolve_Call): if the call is actually an indexing operation on the result of a parameterless call, perform elaboration check after the node has been properly rewritten. * sem_ch12.adb (Copy_Generic_Node): after the proper body has been inlined within the generic tree, the defining identifier is not a compilation_unit. 2001-10-25 Ed Schonberg <schonber@gnat.com> * sem_res.adb (Resolve): special-case resolution of Null in an instance or an inlined body to avoid view conflicts. * sem_ch12.adb (Copy_Generic_Node): for allocators, check for view compatibility by retrieving the access type of the generic copy. 2001-10-25 Robert Dewar <dewar@gnat.com> * sem_ch3.adb: (Analyze_Number_Declaration): Handle error expression. (Signed_Integer_Type_Declaration): Handle error bound. (Analyze_Subtype_Indication): Handle error range. * sem_util.adb (Get_Index_Bounds): Check for Error. 2001-10-25 Robert Dewar <dewar@gnat.com> * restrict.adb (Set_No_Run_Time_Mode): Set Discard_Names as default in no run time mode. 2001-10-25 Pascal Obry <obry@gnat.com> * gnatmem.adb (Read_Next): fix Curs2 value to properly handle quiet mode case for ALLOC case. * gnatmem.adb (Read_Next): correctly fix parsing in Quiet mode on all platforms. Improvement of last change. 2001-10-25 Robert Dewar <dewar@gnat.com> * exp_ch4.adb (Expand_N_Allocator): Minor reformatting. 2001-10-25 Geert Bosch <bosch@gnat.com> * osint.adb (Is_Relative): Remove duplicate. 2001-10-25 Pascal Obry <obry@gnat.com> * osint.adb (Read_Default_Search_Dirs): correctly detect relative pathnames in UNIX and DOS style with drive letter. (Is_Relative): new routine. * osint.adb: Minor reformatting * osint.adb (Is_Relative): implementation using GNAT.OS_Lib.Is_Absolute_Path. Better fix. 2001-10-25 Pascal Obry <obry@gnat.com> * g-dirope.adb (Basename): correctly compute offset between the original Path and the translated one. * g-dirope.adb: (Base_Name): add some comments. 2001-10-25 Robert Dewar <dewar@gnat.com> * exp_imgv.adb (Expand_Image_Attribute): Defend against bad use in HIE mode, avoids compilation abandoned message * exp_imgv.adb: Correct typo in previous change * exp_imgv.adb: Correct typo in previous change (not my day!) 2001-10-25 Robert Dewar <dewar@gnat.com> * s-tpinop.ads: Add 2001 to copyright notice. Fix header format. 2001-10-25 Pascal Obry <obry@gnat.com> * g-awk.ads: Move all pragma inlines next to the routine declarations. This is more uniform with other GNAT spec. 2001-10-22 Geert Bosch <bosch@gnat.com> * Make-lang.in (gnattools, cross-gnattools): Remove gnatmem. 2001-10-19 Geert Bosch <bosch@gnat.com> * Makefile.in (tools, gnattools): Remove gnatmem. 2001-10-17 Richard Henderson <rth@redhat.com> * Makefile.in (misc.o): Depend on langhooks.h. * misc.c: Include it. (LANG_HOOKS_INIT, LANG_HOOKS_INIT_OPTIONS): New. (LANG_HOOKS_DECODE_OPTION): New. (lang_hooks): Use LANG_HOOKS_INITIALIZER. 2001-10-16 Florian Weimer <fw@deneb.enyo.de> * trans.c (tree_transform): Adjust to recent change in expand_asm_operands to implement named asm operands. 2001-10-11 Ed Schonberg <schonber@gnat.com> * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): Bugfix in renaming of discriminant for mutable record type. 2001-10-11 Robert Dewar <dewar@gnat.com> * validsw.adb: Properly save -gnatVn status. 2001-10-11 Robert Dewar <dewar@gnat.com> * usage.adb: Add lines for V switch. * gnatcmd.adb (COMPILE): Revise translations for -gnatV (/VALIDITY_CHECKING). 2001-10-11 Ed Schonberg <schonber@gnat.com> * sem_type.adb (Add_One_Interp): an operator for a type declared in an extension of System is known to be visible. 2001-10-11 Ed Schonberg <schonber@gnat.com> * sem_eval.adb (Compare_Fixup): get the bounds of a String_Literal properly. Fixes regression on ACATS C34005G. 2001-10-11 Robert Dewar <dewar@gnat.com> * sem_ch5.adb (Analyze_Iteration_Scheme): Suppress warning on null loop in generic instance, since this is likely not very useful. 2001-10-11 Robert Dewar <dewar@gnat.com> * restrict.adb (Disallow in No_Run_Time_Mode): Properly specialize the error message for high integrity mode. * rtsfind.adb (RTE): Give message if we try to find an entity that is not available in high integrity mode. * rtsfind.ads: (OK_To_Use_In_HIE_Mode): New array. (RTE): May return Empty in high integrity mode. * rtsfind.ads (OK_To_Use_In_No_Run_Time_Mode): New name for OK_To_Use_In_HIE_Mode, now includes System_FAT_xxx. * sem_ch6.adb (Analyze_Subprogram_Body): Kill body in predefined unit if not inlined always and in no runtime mode. Fixes problem caused by new Rtsfind changes. * sem_ch6.adb (Analyze_Subrogram_Body): Do not Check_References if body is deleted. * rtsfind.adb (RTE): Make sure we do not try to load unit after giving message for entity not available in high integrity mode. 2001-10-11 Pascal Obry <obry@gnat.com> * impunit.adb: Add GNAT.CRC32. 2001-10-11 Ed Schonberg <schonber@gnat.com> * exp_fixd.adb (Expand_Multiply_Fixed_By_Fixed_Giving_Fixed): handle properly the case where one universal operand in a non-static exponentiation of a real literal. 2001-10-11 Ed Schonberg <schonber@gnat.com> * exp_ch7.adb (Find_Final_List): for a type appearing in a with_type clause, return the gobal finalization list, for lack of anthing else. 2001-10-11 Ed Schonberg <schonber@gnat.com> * exp_ch7.adb (Make_Transient_Block): if statement is within exception handler, always use new transient scope to place Clean procedure. 2001-10-11 Pascal Obry <obry@gnat.com> * Makefile.in: (GNAT_ADA_OBJS): add g-crc32.o, a-tags.o, a-stream.o (GNATBIND_OBJS): add g-crc32.o, a-tags.o, a-stream.o (GNATLS_RTL_OBJS): add g-crc32.o (GNATMAKE_RTL_OBJS): add g-crc32.o * ali-util.adb: (CRC_Match): new function. (Get_File_Checksum): renamed Get_File_CRC. Use the GNAT.CRC32 unit instead of the previous simple checksum algorithm. (Time_Stamp_Mismatch): use CRC_Match for comparison. (Set_Source_Table): idem. * ali-util.ads: (Get_File_Checksum): renamed Get_File_CRC as now we compute CRC instead of simple checksum. (CRC_Match): new function. (CRC_Error): new constant. * ali.adb (Scan_ALI): rename variable Chk to CRC as we are handling a CRC now and not a simple checksum. A CRC uses lower-case hex letters, fixes ambiguity in parsing. * ali.ads (Sdep_Record.Checksum): renamed Sdep_Record.CRC as this is what this variable will store. * bcheck.adb: Change reference to chechsum in comments by CRC. (Check_Consistency): Rename Get_File_Checksum to Get_File_CRC. rename All_Checksum_Match to All_CRC_Match. Change due to API renaming since now GNAT does not use a simple checksum but a CRC using GNAT.CRC32. * gnatls.adb: Rename Checksum to CRC in many places, we use a CRC now and not anymore a simple checksum. * lib-load.adb: Use Source_CRC instead of Source_Checksum in many places. * lib-writ.adb (Write_ALI): Use Source_CRC instead of Source_Checksum. * scans.adb: (Restore_Scan_State): rename Checksum to CRC. (Save_Scan_State): idem. * scans.ads: With GNAT.CRC32. (Checksum): rename to CRC. (Saved_Scan_State): Save_Checksum field renamed to Save_CRC * scn-nlit.adb: Rename many Accumulate_Checksum to Update (from GNAT.CRC32). Update copyright notice. * scn-slit.adb: Rename many Accumulate_Checksum to Update (from GNAT.CRC32). Update copyright notice. * scn.adb: (Accumulate_Checksum): removed. (Update): new procedure. Add a wide-character into the CRC. * sinput-l.adb: (Complete_Source_File_Entry): use CRC32 instead of simple checksum. (Load_File): fix initialization of S (change Source_Checksum to Source_CRC) * sinput-p.adb (Load_Project_File): rename Source_Checksum to Source_CRC in S initialization. * sinput.adb (Source_Checksum): renamed to Source_CRC. * sinput.ads (Source_Checksum): renamed to Source_CRC. Update comments for the CRC. * types.adb (Hex): Use lowercase for the letter part. * types.ads (Get_Hex_String): Returns the hexadecimal representation for a word. This is currently used only for CRC. In previous version, the checksum was using a representation with all letter being upper-case. With the new implementation (using CRC) we do not remove the 32th bit of the CRC, so we can have an upper-case starting letter in the CRC. This is not possible to parse in Scan_ALI (ali.adb). It is ambigous since the CRC was optional and could be followed by options like EB, EE. So now this routines uses lower-case letter for the hexadecimal representation. Strange enough only lower case letters where checked in Scan_ALI (even if this was not a possible case). * gnatvsn.ads (Library_Version): changed to 3.15a. * s-crc32.ads: Initial version from GNAT.CRC32. This is the version for the compiler. * s-crc32.adb: Initial version from GNAT.CRC32. This is the version for the compiler. * ali-util.adb: Redo previous change to avoid using word CRC everywhere Add 2001 to copyright notice (Accumulate_Checksum): Modify to use System.CRC32. * ali-util.ads: Redo changes of previous revision to continue to use the word Checksum. Add 2001 to copyright notice. * ali.adb: Undo some of previous changes, not needed. Keep the change for lower case letters in the checksum. * ali.ads: Undo previous change not needed. * bcheck.adb: Undo most of previous change, not needed. But do use Checksums_Match for checksum comparison. * gnatls.adb: Undo most of previous change, not needed. But do use Checksums_Match for comparing checksums. * lib-load.adb: Undo previous change, not needed. * lib-writ.adb: Undo previous change, not needed. * lib-writ.ads: Document that checksums use lower case, not upper case letters. * scans.adb: Undo previous change, not needed * scans.ads: Undo previous change, not needed. * scn-nlit.adb: Undo previous changes, not needed. * scn-slit.adb: Undo previous change, not needed. Fix header format. * scn.adb: (Accumulate_Checksum): Use System.CRC32. (Initialize_Checksum): New procedure. Remove other changes of previous revision. * sinput-p.adb: Undo previous change, not needed. * sinput.adb: Undo previous change, not needed. * sinput-l.adb: Undo previous change, not needed. * sinput.ads: Undo previous change, not needed. Keep only comment on new checksum algorithm * Makefile.in: Add s-crc32 as needed, remove g-crc32. Also remove a-tags and a-stream from GNAT sources. * ali.adb (Scan_ALI): fix typo introduce in latest check-in. * Makefile.in (GNATRTL_NONTASKING_OBJS): Add g-crc32.o. 2001-10-11 Geert Bosch <bosch@gnat.com> * einfo.h: Regenerate. * nmake.ads: Regenerate. * nmake.adb: Regenerate. * sinfo.h: Regenerate. * treeprs.adb: Regenerate. 2001-10-10 Geert Bosch <bosch@gnat.com> * gnat-style.texi: New file describing coding guidelines for Ada. 2001-10-10 Ed Schonberg <schonber@gnat.com> * einfo.adb (Write_Entity_Flags): Elaboration_Entity_Required is Flag174. 2001-10-10 Geert Bosch <bosch@gnat.com> * snames.ads: Add new names for project facility. * snames.adb: Update to reflect snames.ads changes. * snames.h: Update to reflect snames.ads changes. 2001-10-10 Vincent Celier <celier@gnat.com> * make.adb: (Add_Switches): reflect the changes for the switches attributes Default_Switches indexed by the programming language, Switches indexed by the file name. (Collect_Arguments_And_Compile): Idem. Reflect the attribute name changes. * prj-attr.adb: (Initialisation_Data): Change the names of some packages and attributes. (Initialize): process case insensitive associative arrays. * prj-attr.ads: (Attribute_Kind): Remove Both, add Case_Insensitive_Associative_Array. * prj-dect.adb: (Parse_Attribute_Declaration): For case insensitive associative arrays, set the index string to lower case. * prj-env.adb: Reflect the changes of the project attributes. * prj-nmsc.adb: Replace Check_Naming_Scheme by Ada_Check and Language_Independent_Check. * prj-nmsc.ads: Replaced Check_Naming_Scheme by 2 procedures: Ada_Check and Language_Independent_Check. * prj-proc.adb: (Process_Declarative_Items): For case-insensitive associative arrays, set the index string to lower case. (Recursive_Check): Call Prj.Nmsc.Ada_Check, instead of Prj.Nmsc.Check_Naming_Scheme. * prj-tree.adb: (Case_Insensitive): New function (Set_Case_Insensitive): New procedure * prj-tree.ads: (Case_Insensitive): New function (Set_Case_Insensitive): New procedure (Project_Node_Record): New flag Case_Insensitive. * prj-util.adb: (Value_Of): new function to get the string value of a single string variable or attribute. * prj-util.ads: (Value_Of): new function to get the string value of a single string variable or attribute. * prj.adb: (Ada_Default_Spec_Suffix): New function (Ada_Default_Impl_Suffix): New function Change definitions of several constants to reflect new components of record types. * prj.ads: (Naming_Data): Change several components to reflect new elements of naming schemes. (Project_Data): New flags Sources_Present and Language_Independent_Checked. (Ada_Default_Spec_Suffix): New function. (Ada_Default_Impl_Suffix): New function. * snames.ads: Modification of predefined names for project manager: added Implementation, Specification_Exceptions, Implementation_Exceptions, Specification_Suffix, Implementation_Suffix, Separate_Suffix, Default_Switches, _Languages, Builder, Cross_Reference, Finder. Removed Body_Part, Specification_Append, Body_Append, Separate_Append, Gnatmake, Gnatxref, Gnatfind, Gnatbind, Gnatlink. * prj.ads: (Ada_Default_Spec_Suffix, Ada_Default_Impl_Suffix): Add comments. * prj-nmsc.adb (Ada_Check): Test that Separate_Suffix is defaulted, not that it is Nil_Variable_Value. * prj.ads: Add ??? for uncommented declarations 2001-10-10 Ed Schonberg <schonber@gnat.com> * sem_prag.adb: (Analyze_Pragma, case External): If entity is a constant, do not indicate possible modification, so that gigi can treat it as a bona fide constant. 2001-10-10 Robert Dewar <dewar@gnat.com> * sem_prag.adb: Add processing for pragma External. * snames.ads: Add entry for pragma External. * par-prag.adb: Add pragma External. * snames.adb: Updated to match snames.ads. 2001-10-10 Ed Schonberg <schonber@gnat.com> * exp_ch4.adb (Expand_N_Allocator): Generate meaningful names for a dynamic task if the allocator appears in an indexed assignment or selected component assignment. * exp_util.adb (Build_Task_Array_Image, Build_Task_Record_Image): For a dynamic task in an assignment statement, use target of assignment to generate meaningful name. 2001-10-10 Ed Schonberg <schonber@gnat.com> * einfo.adb (Write_Field19_Name): Body_Entity is also defined for a generic package. * einfo.ads: Body_Entity is also defined for generic package. Documentation change only * exp_aggr.adb (Build_Array_Aggr_Code): When expanding an others_choice for a discriminated component initialization, convert discriminant references into the corresponding discriminals. * exp_ch3.adb (Get_Simple_Init_Val): Add qualification to aggregate only if original type is private and expression has to be wrapped in a conversion. * checks.adb: (Apply_Constraint_Check): Do not perform length check if expression is an aggregate with only an others_choice. (Length_N_Cond): two references to the same in_parameter (typically the discriminal in an init_proc) denote the same value. Two useful optimization uncovered by bugfixes above. 2001-10-10 Robert Dewar <dewar@gnat.com> * xeinfo.adb: Change int to char in translation of enumeration types. This fixes a problem in the C representation of component alignment. Add 2001 to copyright notice 2001-10-10 Richard Kenner <kenner@gnat.com> * decl.c: (validate_size): Do check size of object of integral type if it is a packed array type. 2001-10-10 Richard Kenner <kenner@gnat.com> * decl.c: (gnat_to_gnu_entity, case object): Also materialize VAR_DECL for constant if not Is_Public but -O0. 2001-10-10 Richard Kenner <kenner@gnat.com> * misc.c (struct lang_hooks): Add new initializer to match GCC change. 2001-10-10 Geert Bosch <bosch@gnat.com> * xnmake.adb (XNmake): Fix handling of -s/-b options. No longer use '/' as switch character, allowing for absolute file names. 2001-10-09 Joseph S. Myers <jsm28@cam.ac.uk> * 4gintnam.ads, Make-lang.in, Makefile.in, config-lang.in: Update FSF address. 2001-10-08 Geert Bosch <bosch@gnat.com> * Makefile.in (treeprs.ads, einfo.h, sinfo.h, nmake.adb, nmake.ads): Automatically build utilities when files need to be regenerated. 2001-10-08 Geert Bosch <bosch@gnat.com> * xsnames.adb: New utility for updating snames.ads and snames.adb 2001-10-08 Zack Weinberg <zack@codesourcery.com> * Make-lang.in (ADAFLAGS): Add -W -Wall. (ADA_FLAGS_TO_PASS): Set ADA_CFLAGS=$(CFLAGS) also. (gnat1): Also depend on attribs.o. (gnatlib, gnatlib-shared): Set CC and ADAC in recursive make. * Makefile.in (X_ADAFLAGS, T_ADAFLAGS): New. (ADAC): Set to @ADAC@ in stage1, $(CC) later. (ADAFLAGS): Add -W -Wall. (ALL_ADAFLAGS, MOST_ADAFLAGS): Add X_ADAFLAGS and T_ADAFLAGS; take out CFLAGS. (.adb.o, .ads.o, a-numaux.o, a-teioed.o, s-interr.o, s-taskin.o, sdefault.o, s-tasdeb.o, s-vaflop.o, a-except.o, s-assert.o, s-stalib.o, s-memory.o, memtrack.o, mlib-tgt.o): Use $(ADAC), not $(CC), as compilation command. (gnattools): Depend directly on tools to build, don't use recursive make. (gnatlib): Set ADA_CFLAGS=$(GNATLIBCFLAGS) in recursive make. * einfo.h, sinfo.h: New files (autogenerated). 2001-10-08 Richard Henderson <rth@redhat.com> * comperr.adb (Abort_In_Progress): New. (Compiler_Abort): Use it to prevent recursion. 2001-10-08 Robert Dewar <dewar@gnat.com> * atree.adb: Set Error_Posted in Error node, helps error recovery. * par-endh.adb (Output_End_Expected): We should also not test Error_Posted on the Error node, since now it is always set. * cstand.adb (Create_Standard): Set Etype of Error to Any_Type to help error recovery. Part of general work on 9407-004. * par.adb: Add ??? for misuse of error * sem_res.adb: (Resolve): Defend against Error, fixes 9407-003. (Resolve_Discrete_Subtype_Indication): Defend against Error. * sinfo.ads (N_Error): Now has Etype field (which will be set to Any_Type to help error recovery). 2001-10-08 Richard Kenner (kenner@gnat.com) * misc.c (gnat_expand_expr, case UNCHECKED_CONVERT_EXPR): Consistently set MEM attributes from expression; fixes bootstrap failure on x86. 2001-10-08 Geert Bosch (bosch@gnat.com) * 5oosinte.adb: Add 2001 to copyright notice. 2001-10-08 Geert Bosch (bosch@gnat.com) * ceinfo.adb: Add utility for consistency checking of einfo.ad[bs]. * csinfo.adb: Add utility for consistency checking of sinfo.ad[bs]. 2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk> * 5oosinte.adb: Fix spelling error of "separate" as "seperate". 2001-10-05 Geert Bosch (bosch@gnat.com) * adaint.h: Small formatting fix. 2001-10-04 Geert Bosch <bosch@gnat.com> * sysdep.c (__gnat_set_binary_mode, __gnat_set_text_mode): Arg is int, not FILE *, in dummy version of functions. * adaint.h (__gnat_set_binary_mode, __gnat_set_text_mode): Arg is int, not FILE *. 2001-10-04 Geert Bosch <bosch@gnat.com> * 3lsoccon.ads: Added file, missed with initial check ins. * 4lintnam.ads: Fix header format. Change Linux to GNU/Linux. * 5iosinte.adb: Change Linux to GNU/Linux. * 5iosinte.ads: Change Linux to GNU/Linux. * 5itaprop.adb: Change Linux to GNU/Linux. * 5itaspri.ads: Change Linux to GNU/Linux. Update copyright notice. * 5lintman.adb: Change Linux to GNU/Linux. * 5lml-tgt.adb: Change Linux to GNU/Linux. * 5losinte.ads: Change Linux to GNU/Linux. * 5lsystem.ads: Change Linux to GNU/Linux. * 5qosinte.adb: Change Linux to GNU/Linux. * 5qosinte.ads: Change Linux to GNU/Linux. * 5qparame.ads: Change Linux to GNU/Linux. * 5qtaprop.adb: Change Linux to GNU/Linux. * 5qtaspri.ads: Change Linux to GNU/Linux. Add 2001 to copyright notice. * 5vintman.ads: Change Linux to GNU/Linux. Fix header format. Add 2001 to copyright notice. * g-soccon.ads: Change Linux to GNU/Linux. * g-trasym.ads: Change Linux to GNU/Linux. Add 2001 to copyright notice. * memtrack.adb: Change Linux to GNU/Linux. * s-intman.ads: Change Linux to GNU/Linux. Add 2001 to copyright notice. Fix header format. * s-stache.adb: Change Linux to GNU/Linux. * adaint.c: Change Linux to GNU/Linux. * cio.c: Change Linux to GNU/Linux. * cstreams.c: Change Linux to GNU/Linux. * init.c: Change Linux to GNU/Linux. * gmem.c: Change Linux to GNU/Linux. * tracebak.c: Change Linux to GNU/Linux. 2001-10-02 Geert Bosch <bosch@gnat.com> * misc.c (insert_default_attributes): Add dummy version. From-SVN: r47950
2001-12-12 22:26:45 +01:00
-- If we have semicolon, skip it to avoid cascaded errors
elsif Token = Tok_Semicolon then
Scan; -- past semicolon
end if;
end if;
2001-10-02 16:23:52 +02:00
return Decl_Node;
end P_Formal_Type_Declaration;
----------------------------------
-- 12.5 Formal Type Definition --
----------------------------------
-- FORMAL_TYPE_DEFINITION ::=
-- FORMAL_PRIVATE_TYPE_DEFINITION
[multiple changes] 2011-08-29 Matthew Heaney <heaney@adacore.com> * a-comutr.adb, a-cimutr.adb, a-cbmutr.adb (Splice_Subtree): Only check for sibling when common parent. 2011-08-29 Thomas Quinot <quinot@adacore.com> * get_scos.adb: Literals of Pragma_Id are pragma names prefixed with "pragma_". 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Enable freeze actions for the return type when in ASIS mode. 2011-08-29 Vincent Celier <celier@adacore.com> * make.adb (Gnatmake): Get the default search dirs, then the target parameters after getting the Builder switches, as the Builder switches may include --RTS= and that could change the default search dirs. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Make_Adjust_Call): Rewrite to mimic the structure of Make_Final_Call. Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. (Make_Final_Call): Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. * s-stposu.adb (Allocate_Any_Controlled): Correct the membership check. Add code to account for alignments larger than the list header. Add a comment illustrating the structure of the allocated object + padding + header. (Deallocate_Any_Controlled): Add code to account for alignments larger than the list header. 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New node kind N_Formal_Incomplete_Type_Definition, related flags. par-ch12.adb (P_Formal_Type_Declaration, G_Formal_Type_Definition): Parse formal incomplete types. * sem.adb (Analyze): Formal_Incomplete_Type_Definitions are handled in sem_ch12. * sem_ch7.adb (Analyze_Package_Specification, Unit_Requires_Body): Formal incomplete types do not need completion. * sem_ch12.adb (Analyze_Formal_Incomplete_Type, Validate_Incomplete_Type_Instance): New procedures to handle formal incomplete types. * freeze.adb (Freeze_Entity): Do not freeze the subtype of an actual that corresponds to a formal incomplete type. * sprint.adb: Handle formal incomplete type declarations. * exp_util.adb (Insert_Actions): An incomplete_type_definition is not an insertion point. From-SVN: r178184
2011-08-29 12:02:08 +02:00
-- | FORMAL_INCOMPLETE_TYPE_DEFINITION
2001-10-02 16:23:52 +02:00
-- | FORMAL_DERIVED_TYPE_DEFINITION
-- | FORMAL_DISCRETE_TYPE_DEFINITION
-- | FORMAL_SIGNED_INTEGER_TYPE_DEFINITION
-- | FORMAL_MODULAR_TYPE_DEFINITION
-- | FORMAL_FLOATING_POINT_DEFINITION
-- | FORMAL_ORDINARY_FIXED_POINT_DEFINITION
-- | FORMAL_DECIMAL_FIXED_POINT_DEFINITION
-- | FORMAL_ARRAY_TYPE_DEFINITION
-- | FORMAL_ACCESS_TYPE_DEFINITION
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
-- | FORMAL_INTERFACE_TYPE_DEFINITION
2001-10-02 16:23:52 +02:00
-- FORMAL_ARRAY_TYPE_DEFINITION ::= ARRAY_TYPE_DEFINITION
-- FORMAL_ACCESS_TYPE_DEFINITION ::= ACCESS_TYPE_DEFINITION
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
-- FORMAL_INTERFACE_TYPE_DEFINITION ::= INTERFACE_TYPE_DEFINITION
2001-10-02 16:23:52 +02:00
function P_Formal_Type_Definition return Node_Id is
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
Scan_State : Saved_Scan_State;
Typedef_Node : Node_Id;
2001-10-02 16:23:52 +02:00
begin
if Token_Name = Name_Abstract then
Check_95_Keyword (Tok_Abstract, Tok_Tagged);
end if;
if Token_Name = Name_Tagged then
Check_95_Keyword (Tok_Tagged, Tok_Private);
Check_95_Keyword (Tok_Tagged, Tok_Limited);
end if;
case Token is
-- Mostly we can tell what we have from the initial token. The one
-- exception is ABSTRACT, where we have to scan ahead to see if we
-- have a formal derived type or a formal private type definition.
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
-- In addition, in Ada 2005 LIMITED may appear after abstract, so
-- that the lookahead must be extended by one more token.
2001-10-02 16:23:52 +02:00
when Tok_Abstract =>
Save_Scan_State (Scan_State);
Scan; -- past ABSTRACT
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
elsif Token = Tok_Limited then
Scan; -- past LIMITED
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Private_Type_Definition;
end if;
-- Ada 2005 (AI-443): Abstract synchronized formal derived type
elsif Token = Tok_Synchronized then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
2001-10-02 16:23:52 +02:00
else
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Private_Type_Definition;
end if;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
when Tok_Access =>
return P_Access_Type_Definition;
2001-10-02 16:23:52 +02:00
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
when Tok_Array =>
return P_Array_Type_Definition;
when Tok_Delta =>
return P_Formal_Fixed_Point_Definition;
when Tok_Digits =>
return P_Formal_Floating_Point_Definition;
when Tok_Interface => -- Ada 2005 (AI-251)
exp_ch13.adb (Expand_External_Tag_Definition): Replace call to the run-time subprogram Set_External_Tag by call to... 2007-04-06 Javier Miranda <miranda@adacore.com> Gary Dismukes <dismukes@adacore.com> Ed Schonberg <schonberg@adacore.com> * exp_ch13.adb (Expand_External_Tag_Definition): Replace call to the run-time subprogram Set_External_Tag by call to Build_Set_External_Tag. * exp_ch4.adb (Expand_Allocator_Expression): Don't perform a run-time accessibility on class-wide allocators if the allocator occurs at the same scope level as the allocator's type. The check is guaranteed to succeed in that case, even when the expression originates from a parameter of the containing subprogram. (Expand_N_Op_Eq): Do nothing in case of dispatching call if compiling under No_Dispatching_Calls restriction. During the semantic analysis we already notified such violation. (Tagged_Membership): Constant folding. There is no need to check the tag at run-time if the type of the right operand is non class-wide abstract. Replace call to Is_Ancestor by call to Is_Parent to support concurrent types with interface types. (Expand_N_Allocator): Add an assertion associated with the generation of the master_id. (Expand_N_Slice): Do not enable range check to nodes associated with the frontend expansion of the dispatch table. (Is_Local_Access_Discriminant): Subsidiary function to Expand_N_Allocator. (Tagged_Membership): Replace generation of call to the run-time subprogram CW_Membership by call to Build_CW_Membership. (Expand_Allocator_Expression): Replace generation of call to the run-time subprogram Get_Access_Level by call to Build_Get_Access_Level. * exp_disp.ads, exp_disp.adb (Make_DT): Code reorganization to initialize most the TSD components by means of an aggregate. Modify the declaration of the object containing the TSD because we now expand code that has a higher level of abstraction. The TSD has a discriminant containing the Inheritance Depth Level, value that is used in the membership test but also to fix the size of the table of ancestors. (Expand_Interface_Conversion): Insert function body at the closest place to the conversion expression, to prevent access-before-elaboration errors in the backend. Code improved to reduce the size of the dispatch table if compiling under restriction No_Dispatching_Calls plus code cleanup. Code reorganization plus removal of calls to Set_Num_Prim_Ops (Make_Secondary_DT): Remove call to Set_Num_Prim_Ops. (Expand_Dispatching_Call): Minor code reorganization plus addition of code to return immediately if compiling under No_Dispatching_Calls restriction. (Set_All_DT_Position): Remove code associated with the old CPP pragmas. CPP_Virtual and CPP_Vtable are no longer supported. (Expand_Interface_Conversion): Add missing support for interface type derivations. (Expand_Interface_Actuals): Replace calls to Is_Ancestor by calls to Is_Parent to support concurrent types with interfaces. (Init_Predefined_Interface_Primitives): Removed. (Make_Secondary_DT): Modified to support concurrent record types. (Set_All_DT_Position): Modified to support concurrent record types. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entries associated with Get_External_Tag, Inherit_TSD, Set_External_Tag. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entry associated with CW_Membership. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entries associated with Get_Access_Level, Get_Predefined_Prim_Op_Address, Get_Prim_Op_Address Get_RC_Offset, Get_Remotely_Callable, Inherit_DT, Set_Access_Level, Set_Expanded_Name, Set_Predefined_Prim_Op_Address, Set_Prim_Op_Address, Set_RC_Offset, Set_Remotely_Callable, Set_TSD. (Expand_Dispatching_Call): Replace generation of call to the run-time subprograms Get_Predefined_Prim_Op_Address and Get_Prim_Op_Address by calls to Build_Get_Predefined_Prim_Op_Address, and Build_Get_Prim_Op_ Address. (Fill_DT_Entry, Fill_Secondary_DT_Entry): Replace generation of call to the run-time subprograms Set_Predefined_Prim_Op_Address and Set_Prim_ Op_Address by calls to Build_Set_Predefined_Prim_Op_Address, and Build_Set_Prim_Op_Address. (Get_Remotely_Callable): Subprogram removed. (Init_Predefined_Interface_Primitives): Replace generation of call to the run-time subprograms Inherit_DT by call to Build_Inherit_Predefined_ Prims. * sem_elab.adb (Set_Elaboration_Constraint): Replace the call to First (Parameter_Associations ()) with the call to First_Actual that returns an actual parameter expression for both named and positional associations. * sem_disp.adb (Check_Dispatching_Call): In case of dispatching call check violation of restriction No_Dispatching_Calls. (Check_Controlling_Type): A formal of a tagged incomplete type is a controlling argument. * exp_util.ads, exp_util.adb (Type_May_Have_Bit_Aligned_Components): Use First/Next_Component_Or_Discriminant (Insert_Actions): Add entries for new N_Push and N_Pop nodes (Find_Implemented_Interface): Removed. All the calls to this subprogram specify Any_Limited_Interface, and this functionality is already provided by the function Has_Abstract_Interfaces. (Find_Interface, Find_Interface_Tag, Find_Interface_ADT): Modified to support concurrent types implementing interfaces. (Find_Implemented_Interface): Removed. All the calls to this subprogram specify kind Any_Limited_Interface, and this functionality is already provided by the function Has_Abstract_Interfaces. (Remove_Side_Effects): replace Controlled_Type by CW_Or_Controlled_Type whenever the issue is related to using or not the secondary stack. * par-ch12.adb (P_Formal_Type_Definition): Update calls to P_Interface_Type_Definition to fulfill the new interface (the formal Is_Synchronized is no longer required). * Make-lang.in (GNAT_ADA_OBJS): Addition of exp_atag.o Update dependencies. * exp_atag.ads, exp_atag.adb: New file From-SVN: r123562
2007-04-06 11:20:11 +02:00
return P_Interface_Type_Definition (Abstract_Present => False);
2001-10-02 16:23:52 +02:00
when Tok_Left_Paren =>
return P_Formal_Discrete_Type_Definition;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
when Tok_Limited =>
Save_Scan_State (Scan_State);
Scan; -- past LIMITED
if Token = Tok_Interface then
exp_ch13.adb (Expand_External_Tag_Definition): Replace call to the run-time subprogram Set_External_Tag by call to... 2007-04-06 Javier Miranda <miranda@adacore.com> Gary Dismukes <dismukes@adacore.com> Ed Schonberg <schonberg@adacore.com> * exp_ch13.adb (Expand_External_Tag_Definition): Replace call to the run-time subprogram Set_External_Tag by call to Build_Set_External_Tag. * exp_ch4.adb (Expand_Allocator_Expression): Don't perform a run-time accessibility on class-wide allocators if the allocator occurs at the same scope level as the allocator's type. The check is guaranteed to succeed in that case, even when the expression originates from a parameter of the containing subprogram. (Expand_N_Op_Eq): Do nothing in case of dispatching call if compiling under No_Dispatching_Calls restriction. During the semantic analysis we already notified such violation. (Tagged_Membership): Constant folding. There is no need to check the tag at run-time if the type of the right operand is non class-wide abstract. Replace call to Is_Ancestor by call to Is_Parent to support concurrent types with interface types. (Expand_N_Allocator): Add an assertion associated with the generation of the master_id. (Expand_N_Slice): Do not enable range check to nodes associated with the frontend expansion of the dispatch table. (Is_Local_Access_Discriminant): Subsidiary function to Expand_N_Allocator. (Tagged_Membership): Replace generation of call to the run-time subprogram CW_Membership by call to Build_CW_Membership. (Expand_Allocator_Expression): Replace generation of call to the run-time subprogram Get_Access_Level by call to Build_Get_Access_Level. * exp_disp.ads, exp_disp.adb (Make_DT): Code reorganization to initialize most the TSD components by means of an aggregate. Modify the declaration of the object containing the TSD because we now expand code that has a higher level of abstraction. The TSD has a discriminant containing the Inheritance Depth Level, value that is used in the membership test but also to fix the size of the table of ancestors. (Expand_Interface_Conversion): Insert function body at the closest place to the conversion expression, to prevent access-before-elaboration errors in the backend. Code improved to reduce the size of the dispatch table if compiling under restriction No_Dispatching_Calls plus code cleanup. Code reorganization plus removal of calls to Set_Num_Prim_Ops (Make_Secondary_DT): Remove call to Set_Num_Prim_Ops. (Expand_Dispatching_Call): Minor code reorganization plus addition of code to return immediately if compiling under No_Dispatching_Calls restriction. (Set_All_DT_Position): Remove code associated with the old CPP pragmas. CPP_Virtual and CPP_Vtable are no longer supported. (Expand_Interface_Conversion): Add missing support for interface type derivations. (Expand_Interface_Actuals): Replace calls to Is_Ancestor by calls to Is_Parent to support concurrent types with interfaces. (Init_Predefined_Interface_Primitives): Removed. (Make_Secondary_DT): Modified to support concurrent record types. (Set_All_DT_Position): Modified to support concurrent record types. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entries associated with Get_External_Tag, Inherit_TSD, Set_External_Tag. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entry associated with CW_Membership. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entries associated with Get_Access_Level, Get_Predefined_Prim_Op_Address, Get_Prim_Op_Address Get_RC_Offset, Get_Remotely_Callable, Inherit_DT, Set_Access_Level, Set_Expanded_Name, Set_Predefined_Prim_Op_Address, Set_Prim_Op_Address, Set_RC_Offset, Set_Remotely_Callable, Set_TSD. (Expand_Dispatching_Call): Replace generation of call to the run-time subprograms Get_Predefined_Prim_Op_Address and Get_Prim_Op_Address by calls to Build_Get_Predefined_Prim_Op_Address, and Build_Get_Prim_Op_ Address. (Fill_DT_Entry, Fill_Secondary_DT_Entry): Replace generation of call to the run-time subprograms Set_Predefined_Prim_Op_Address and Set_Prim_ Op_Address by calls to Build_Set_Predefined_Prim_Op_Address, and Build_Set_Prim_Op_Address. (Get_Remotely_Callable): Subprogram removed. (Init_Predefined_Interface_Primitives): Replace generation of call to the run-time subprograms Inherit_DT by call to Build_Inherit_Predefined_ Prims. * sem_elab.adb (Set_Elaboration_Constraint): Replace the call to First (Parameter_Associations ()) with the call to First_Actual that returns an actual parameter expression for both named and positional associations. * sem_disp.adb (Check_Dispatching_Call): In case of dispatching call check violation of restriction No_Dispatching_Calls. (Check_Controlling_Type): A formal of a tagged incomplete type is a controlling argument. * exp_util.ads, exp_util.adb (Type_May_Have_Bit_Aligned_Components): Use First/Next_Component_Or_Discriminant (Insert_Actions): Add entries for new N_Push and N_Pop nodes (Find_Implemented_Interface): Removed. All the calls to this subprogram specify Any_Limited_Interface, and this functionality is already provided by the function Has_Abstract_Interfaces. (Find_Interface, Find_Interface_Tag, Find_Interface_ADT): Modified to support concurrent types implementing interfaces. (Find_Implemented_Interface): Removed. All the calls to this subprogram specify kind Any_Limited_Interface, and this functionality is already provided by the function Has_Abstract_Interfaces. (Remove_Side_Effects): replace Controlled_Type by CW_Or_Controlled_Type whenever the issue is related to using or not the secondary stack. * par-ch12.adb (P_Formal_Type_Definition): Update calls to P_Interface_Type_Definition to fulfill the new interface (the formal Is_Synchronized is no longer required). * Make-lang.in (GNAT_ADA_OBJS): Addition of exp_atag.o Update dependencies. * exp_atag.ads, exp_atag.adb: New file From-SVN: r123562
2007-04-06 11:20:11 +02:00
Typedef_Node :=
P_Interface_Type_Definition (Abstract_Present => False);
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
Set_Limited_Present (Typedef_Node);
return Typedef_Node;
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
elsif Token = Tok_New then
Restore_Scan_State (Scan_State); -- to LIMITED
return P_Formal_Derived_Type_Definition;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
else
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
if Token = Tok_Abstract then
Error_Msg_SC -- CODEFIX
("ABSTRACT must come before LIMITED");
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
Scan; -- past improper ABSTRACT
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to LIMITED
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State);
return P_Formal_Private_Type_Definition;
end if;
end if;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
Restore_Scan_State (Scan_State);
return P_Formal_Private_Type_Definition;
end if;
2001-10-02 16:23:52 +02:00
when Tok_Mod =>
return P_Formal_Modular_Type_Definition;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
when Tok_New =>
return P_Formal_Derived_Type_Definition;
2001-10-02 16:23:52 +02:00
when Tok_Not =>
if P_Null_Exclusion then
Typedef_Node := P_Access_Type_Definition;
Set_Null_Exclusion_Present (Typedef_Node);
return Typedef_Node;
else
Error_Msg_SC ("expect valid formal access definition!");
Resync_Past_Semicolon;
return Error;
end if;
when Tok_Private =>
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
return P_Formal_Private_Type_Definition;
2001-10-02 16:23:52 +02:00
when Tok_Tagged =>
[multiple changes] 2011-08-29 Matthew Heaney <heaney@adacore.com> * a-comutr.adb, a-cimutr.adb, a-cbmutr.adb (Splice_Subtree): Only check for sibling when common parent. 2011-08-29 Thomas Quinot <quinot@adacore.com> * get_scos.adb: Literals of Pragma_Id are pragma names prefixed with "pragma_". 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Enable freeze actions for the return type when in ASIS mode. 2011-08-29 Vincent Celier <celier@adacore.com> * make.adb (Gnatmake): Get the default search dirs, then the target parameters after getting the Builder switches, as the Builder switches may include --RTS= and that could change the default search dirs. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Make_Adjust_Call): Rewrite to mimic the structure of Make_Final_Call. Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. (Make_Final_Call): Move the processing for class-wide types before the processing for derivations from [Limited_]Controlled. * s-stposu.adb (Allocate_Any_Controlled): Correct the membership check. Add code to account for alignments larger than the list header. Add a comment illustrating the structure of the allocated object + padding + header. (Deallocate_Any_Controlled): Add code to account for alignments larger than the list header. 2011-08-29 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb: New node kind N_Formal_Incomplete_Type_Definition, related flags. par-ch12.adb (P_Formal_Type_Declaration, G_Formal_Type_Definition): Parse formal incomplete types. * sem.adb (Analyze): Formal_Incomplete_Type_Definitions are handled in sem_ch12. * sem_ch7.adb (Analyze_Package_Specification, Unit_Requires_Body): Formal incomplete types do not need completion. * sem_ch12.adb (Analyze_Formal_Incomplete_Type, Validate_Incomplete_Type_Instance): New procedures to handle formal incomplete types. * freeze.adb (Freeze_Entity): Do not freeze the subtype of an actual that corresponds to a formal incomplete type. * sprint.adb: Handle formal incomplete type declarations. * exp_util.adb (Insert_Actions): An incomplete_type_definition is not an insertion point. From-SVN: r178184
2011-08-29 12:02:08 +02:00
if Next_Token_Is (Tok_Semicolon) then
Typedef_Node :=
New_Node (N_Formal_Incomplete_Type_Definition, Token_Ptr);
Set_Tagged_Present (Typedef_Node);
Scan; -- past tagged
return Typedef_Node;
else
return P_Formal_Private_Type_Definition;
end if;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
when Tok_Range =>
return P_Formal_Signed_Integer_Type_Definition;
2001-10-02 16:23:52 +02:00
when Tok_Record =>
Error_Msg_SC ("record not allowed in generic type definition!");
Discard_Junk_Node (P_Record_Definition);
return Error;
-- Ada 2005 (AI-345): Task, Protected or Synchronized interface or
-- (AI-443): Synchronized formal derived type declaration.
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
when Tok_Protected |
Tok_Synchronized |
Tok_Task =>
declare
Saved_Token : constant Token_Type := Token;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
begin
Scan; -- past TASK, PROTECTED or SYNCHRONIZED
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
-- Synchronized derived type
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
if Token = Tok_New then
Typedef_Node := P_Formal_Derived_Type_Definition;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
if Saved_Token = Tok_Synchronized then
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
Set_Synchronized_Present (Typedef_Node);
else
Error_Msg_SC ("invalid kind of formal derived type");
end if;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
-- Interface
else
exp_ch13.adb (Expand_External_Tag_Definition): Replace call to the run-time subprogram Set_External_Tag by call to... 2007-04-06 Javier Miranda <miranda@adacore.com> Gary Dismukes <dismukes@adacore.com> Ed Schonberg <schonberg@adacore.com> * exp_ch13.adb (Expand_External_Tag_Definition): Replace call to the run-time subprogram Set_External_Tag by call to Build_Set_External_Tag. * exp_ch4.adb (Expand_Allocator_Expression): Don't perform a run-time accessibility on class-wide allocators if the allocator occurs at the same scope level as the allocator's type. The check is guaranteed to succeed in that case, even when the expression originates from a parameter of the containing subprogram. (Expand_N_Op_Eq): Do nothing in case of dispatching call if compiling under No_Dispatching_Calls restriction. During the semantic analysis we already notified such violation. (Tagged_Membership): Constant folding. There is no need to check the tag at run-time if the type of the right operand is non class-wide abstract. Replace call to Is_Ancestor by call to Is_Parent to support concurrent types with interface types. (Expand_N_Allocator): Add an assertion associated with the generation of the master_id. (Expand_N_Slice): Do not enable range check to nodes associated with the frontend expansion of the dispatch table. (Is_Local_Access_Discriminant): Subsidiary function to Expand_N_Allocator. (Tagged_Membership): Replace generation of call to the run-time subprogram CW_Membership by call to Build_CW_Membership. (Expand_Allocator_Expression): Replace generation of call to the run-time subprogram Get_Access_Level by call to Build_Get_Access_Level. * exp_disp.ads, exp_disp.adb (Make_DT): Code reorganization to initialize most the TSD components by means of an aggregate. Modify the declaration of the object containing the TSD because we now expand code that has a higher level of abstraction. The TSD has a discriminant containing the Inheritance Depth Level, value that is used in the membership test but also to fix the size of the table of ancestors. (Expand_Interface_Conversion): Insert function body at the closest place to the conversion expression, to prevent access-before-elaboration errors in the backend. Code improved to reduce the size of the dispatch table if compiling under restriction No_Dispatching_Calls plus code cleanup. Code reorganization plus removal of calls to Set_Num_Prim_Ops (Make_Secondary_DT): Remove call to Set_Num_Prim_Ops. (Expand_Dispatching_Call): Minor code reorganization plus addition of code to return immediately if compiling under No_Dispatching_Calls restriction. (Set_All_DT_Position): Remove code associated with the old CPP pragmas. CPP_Virtual and CPP_Vtable are no longer supported. (Expand_Interface_Conversion): Add missing support for interface type derivations. (Expand_Interface_Actuals): Replace calls to Is_Ancestor by calls to Is_Parent to support concurrent types with interfaces. (Init_Predefined_Interface_Primitives): Removed. (Make_Secondary_DT): Modified to support concurrent record types. (Set_All_DT_Position): Modified to support concurrent record types. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entries associated with Get_External_Tag, Inherit_TSD, Set_External_Tag. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entry associated with CW_Membership. (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Remove entries associated with Get_Access_Level, Get_Predefined_Prim_Op_Address, Get_Prim_Op_Address Get_RC_Offset, Get_Remotely_Callable, Inherit_DT, Set_Access_Level, Set_Expanded_Name, Set_Predefined_Prim_Op_Address, Set_Prim_Op_Address, Set_RC_Offset, Set_Remotely_Callable, Set_TSD. (Expand_Dispatching_Call): Replace generation of call to the run-time subprograms Get_Predefined_Prim_Op_Address and Get_Prim_Op_Address by calls to Build_Get_Predefined_Prim_Op_Address, and Build_Get_Prim_Op_ Address. (Fill_DT_Entry, Fill_Secondary_DT_Entry): Replace generation of call to the run-time subprograms Set_Predefined_Prim_Op_Address and Set_Prim_ Op_Address by calls to Build_Set_Predefined_Prim_Op_Address, and Build_Set_Prim_Op_Address. (Get_Remotely_Callable): Subprogram removed. (Init_Predefined_Interface_Primitives): Replace generation of call to the run-time subprograms Inherit_DT by call to Build_Inherit_Predefined_ Prims. * sem_elab.adb (Set_Elaboration_Constraint): Replace the call to First (Parameter_Associations ()) with the call to First_Actual that returns an actual parameter expression for both named and positional associations. * sem_disp.adb (Check_Dispatching_Call): In case of dispatching call check violation of restriction No_Dispatching_Calls. (Check_Controlling_Type): A formal of a tagged incomplete type is a controlling argument. * exp_util.ads, exp_util.adb (Type_May_Have_Bit_Aligned_Components): Use First/Next_Component_Or_Discriminant (Insert_Actions): Add entries for new N_Push and N_Pop nodes (Find_Implemented_Interface): Removed. All the calls to this subprogram specify Any_Limited_Interface, and this functionality is already provided by the function Has_Abstract_Interfaces. (Find_Interface, Find_Interface_Tag, Find_Interface_ADT): Modified to support concurrent types implementing interfaces. (Find_Implemented_Interface): Removed. All the calls to this subprogram specify kind Any_Limited_Interface, and this functionality is already provided by the function Has_Abstract_Interfaces. (Remove_Side_Effects): replace Controlled_Type by CW_Or_Controlled_Type whenever the issue is related to using or not the secondary stack. * par-ch12.adb (P_Formal_Type_Definition): Update calls to P_Interface_Type_Definition to fulfill the new interface (the formal Is_Synchronized is no longer required). * Make-lang.in (GNAT_ADA_OBJS): Addition of exp_atag.o Update dependencies. * exp_atag.ads, exp_atag.adb: New file From-SVN: r123562
2007-04-06 11:20:11 +02:00
Typedef_Node :=
P_Interface_Type_Definition (Abstract_Present => False);
case Saved_Token is
when Tok_Task =>
Set_Task_Present (Typedef_Node);
when Tok_Protected =>
Set_Protected_Present (Typedef_Node);
when Tok_Synchronized =>
Set_Synchronized_Present (Typedef_Node);
when others =>
null;
end case;
end if;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
return Typedef_Node;
end;
2001-10-02 16:23:52 +02:00
when others =>
Error_Msg_BC ("expecting generic type definition here");
Resync_Past_Semicolon;
return Error;
end case;
end P_Formal_Type_Definition;
--------------------------------------------
-- 12.5.1 Formal Private Type Definition --
--------------------------------------------
-- FORMAL_PRIVATE_TYPE_DEFINITION ::=
-- [[abstract] tagged] [limited] private
-- The caller has checked the initial token is PRIVATE, ABSTRACT,
-- TAGGED or LIMITED
-- Error recovery: cannot raise Error_Resync
function P_Formal_Private_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Private_Type_Definition, Token_Ptr);
if Token = Tok_Abstract then
Scan; -- past ABSTRACT
if Token_Name = Name_Tagged then
Check_95_Keyword (Tok_Tagged, Tok_Private);
Check_95_Keyword (Tok_Tagged, Tok_Limited);
end if;
if Token /= Tok_Tagged then
Error_Msg_SP ("ABSTRACT must be followed by TAGGED");
else
Set_Abstract_Present (Def_Node, True);
end if;
end if;
if Token = Tok_Tagged then
Set_Tagged_Present (Def_Node, True);
Scan; -- past TAGGED
end if;
if Token = Tok_Limited then
Set_Limited_Present (Def_Node, True);
Scan; -- past LIMITED
end if;
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
if Token = Tok_Abstract then
if Prev_Token = Tok_Tagged then
Error_Msg_SC -- CODEFIX
("ABSTRACT must come before TAGGED");
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
elsif Prev_Token = Tok_Limited then
Error_Msg_SC -- CODEFIX
("ABSTRACT must come before LIMITED");
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
end if;
Resync_Past_Semicolon;
elsif Token = Tok_Tagged then
Error_Msg_SC -- CODEFIX
("TAGGED must come before LIMITED");
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
Resync_Past_Semicolon;
end if;
2001-10-02 16:23:52 +02:00
Set_Sloc (Def_Node, Token_Ptr);
T_Private;
if Token = Tok_Tagged then -- CODEFIX
Error_Msg_SC ("TAGGED must come before PRIVATE");
Scan; -- past TAGGED
elsif Token = Tok_Abstract then -- CODEFIX
Error_Msg_SC ("`ABSTRACT TAGGED` must come before PRIVATE");
Scan; -- past ABSTRACT
if Token = Tok_Tagged then
Scan; -- past TAGGED
end if;
end if;
2001-10-02 16:23:52 +02:00
return Def_Node;
end P_Formal_Private_Type_Definition;
--------------------------------------------
-- 12.5.1 Formal Derived Type Definition --
--------------------------------------------
-- FORMAL_DERIVED_TYPE_DEFINITION ::=
-- [abstract] [limited | synchronized]
-- new SUBTYPE_MARK [[and INTERFACE_LIST] with private]
2001-10-02 16:23:52 +02:00
-- The caller has checked the initial token(s) is/are NEW, ABSTRACT NEW,
-- or LIMITED NEW, ABSTRACT LIMITED NEW, SYNCHRONIZED NEW or ABSTRACT
-- SYNCHRONIZED NEW.
2001-10-02 16:23:52 +02:00
-- Error recovery: cannot raise Error_Resync
function P_Formal_Derived_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Derived_Type_Definition, Token_Ptr);
if Token = Tok_Abstract then
Set_Abstract_Present (Def_Node);
Scan; -- past ABSTRACT
end if;
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
if Token = Tok_Limited then
Set_Limited_Present (Def_Node);
Scan; -- past LIMITED
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
if Ada_Version < Ada_2005 then
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
Error_Msg_SP
("LIMITED in derived type is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
end if;
elsif Token = Tok_Synchronized then
Set_Synchronized_Present (Def_Node);
Scan; -- past SYNCHRONIZED
if Ada_Version < Ada_2005 then
Error_Msg_SP
("SYNCHRONIZED in derived type is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
einfo.adb (Itype_Printed): New flag 2005-12-05 Robert Dewar <dewar@adacore.com> Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. From-SVN: r108295
2005-12-09 18:19:49 +01:00
end if;
end if;
if Token = Tok_Abstract then
Scan; -- past ABSTRACT, diagnosed already in caller.
end if;
2001-10-02 16:23:52 +02:00
Scan; -- past NEW;
Set_Subtype_Mark (Def_Node, P_Subtype_Mark);
No_Constraint;
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
-- Ada 2005 (AI-251): Deal with interfaces
if Token = Tok_And then
Scan; -- past AND
if Ada_Version < Ada_2005 then
atree.ads, atree.adb: Add support for Elist24 field 2005-03-08 Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * atree.ads, atree.adb: Add support for Elist24 field * atree.h: Fix wrong definition of Field27 Add support for Elist16 field Add support for Elist24 field * einfo.ads, einfo.adb (Abstract_Interfaces, Set_Abstract_Interfaces): New subprograms. (Abstract_Interface_Alias, Set_Abstract_Interface_Alias): New subprograms. (Access_Disp_Table, Set_Access_Disp_Table): Modified to handle a list of entities rather than a single node. (Is_Interface, Set_Is_Interface): New subprogram (First_Tag_Component): New syntesized attribute (Next_Tag_Component): New synthesized attribute (Write_Entity_Flags): Upgraded to write Is_Interface (Write_Field24_Name): Upgraded to write Abstract_Interfaces (Write_Field25_Name): Upgraded to write Abstract_Interface_Alias (Task_Body_Procedure): New subprogram to read this attribute. (Set_Task_Body_Procedure): New subprogram to set this attribute. (Has_Controlled_Component): Now applies to all entities. This is only a documentation change, since it always worked to apply this to other than composite types (yielding false), but now this is official. Update documentation on Must_Be_Byte_Aligned for new spec * tbuild.adb, exp_dist.adb, exp_disp.adb, exp_ch3.ads, exp_ch3.adb, exp_attr.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb: Upgrade all the uses of the Access_Disp_Table attribute to reference the first dispatch table associated with a tagged type. As part of the implementation of abstract interface types, Access_Disp_Table has been redefined to contain a list of dispatch tables (rather than a single dispatch table). Similarly, upgrade all the references to Tag_Component by the new attribute First_Tag_Component. (Find_Inherited_TSS): Moved to exp_tss. Clean up test in Expand_N_Object_Declaration for cases where we need to do a separate assignment of the initial value. (Expand_N_Object_Declaration): If the expression in the declaration of a tagged type is an aggregate, no need to generate an additional tag assignment. (Freeze_Type): Now a function that returns True if the N_Freeze_Entity is to be deleted. Bit packed array ops are only called if operands are known to be aligned. (Component_Equality): When returning an N_Raise_Program_Error statement, ensure that its Etype is set to Empty to avoid confusing GIGI (which expects that only expressions have a bona fide type). (Make_Tag_Ctrl_Assignment): Use Build_Actual_Subtype to correctly determine the amount of data to be copied. * par.adb (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (for AI-251 and AI-345): INTERFACE_TYPE_DEFINITION ::= [limited | task | protected | synchronized] interface [AND interface_list] * par-ch3.adb (P_Type_Declaration): Modified to give support to interfaces. (P_Derived_Type_Def_Or_Private_Ext_Decl): Modified to give support to interfaces. (P_Interface_Type_Definition): New subprogram that parses the new syntax rule of Ada 2005 interfaces (P_Identifier_Declarations): fix two occurrences of 'RENAMES' in error messages by the correct RENAMES (quotes removed). * sem_prag.adb: Upgrade all the references to Tag_Component by the new attribute First_Tag_Component. * sinfo.ads, sinfo.adb: Remove OK_For_Stream flag, not used, not needed (Interface_List, Set_Interface_List): New subprograms. (Interface_Present, Set_Interface_Present): New subprograms. (Limited_Present, Set_Limited_Present): Available also in derived type definition nodes. (Protected_Present, Set_Protected_Present): Available also in record type definition and derived type definition nodes. (Synchronized_Present, Set_Synchronized_Present): New subprograms. (Task_Present, Set_Task_Present): New subprogram. (Task_Body_Procedure): Removed. (Set_Task_Body_Procedure): Removed. These subprogram have been removed because the attribute Task_Body_Procedure has been moved to the corresponding task type or task subtype entity to leave a field free to store the list of interfaces implemented by a task (for AI-345) Add Expression field to N_Raise_Statement node for Ada 2005 AI-361 (Null_Exclusion_Present): Change to Flag11, to avoid conflict with expression flag Do_Range_Check (Exception_Junk): Change to Flag7 to accomodate above change (Box_Present, Default_Name, Specification, Set_Box_Present, Set_Default_Name, Set_Specification): Expand the expression "X in N_Formal_Subprogram_Declaration" into the corresponding two comparisons. Required to use the csinfo tool. * exp_ch11.adb (Expand_N_Raise_Statement): Deal with case where "with string" given. * sem_ch11.adb (Analyze_Raise_Statement): Handle case where string expression given. * par-ch11.adb (P_Raise_Statement): Recognize with string expression in 2005 mode * exp_ch9.adb (Build_Task_Proc_Specification): Modified to use entity attribute Task_Body_Procedure rather than the old semantic field that was available in the task_type_declaration node. * par-ch12.adb (P_Formal_Type_Definition): Modified to handle formal interface type definitions. (P_Formal_Derived_Type_Definition): Modified to handle the list of interfaces. * par-ch9.adb (P_Task): Modified to handle the list of interfaces in a task type declaration. (P_Protected): Modified to handle the list of interfaces in a protected type declaration. From-SVN: r96489
2005-03-15 16:54:14 +01:00
Error_Msg_SP
("abstract interface is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
Set_Interface_List (Def_Node, New_List);
loop
Append (P_Qualified_Simple_Name, Interface_List (Def_Node));
exit when Token /= Tok_And;
Scan; -- past AND
end loop;
end if;
2001-10-02 16:23:52 +02:00
if Token = Tok_With then
Scan; -- past WITH
Set_Private_Present (Def_Node, True);
T_Private;
elsif Token = Tok_Tagged then
Scan;
if Token = Tok_Private then
Error_Msg_SC -- CODEFIX
("TAGGED should be WITH");
Set_Private_Present (Def_Node, True);
T_Private;
else
Ignore (Tok_Tagged);
end if;
2001-10-02 16:23:52 +02:00
end if;
return Def_Node;
end P_Formal_Derived_Type_Definition;
---------------------------------------------
-- 12.5.2 Formal Discrete Type Definition --
---------------------------------------------
-- FORMAL_DISCRETE_TYPE_DEFINITION ::= (<>)
-- The caller has checked the initial token is left paren
-- Error recovery: cannot raise Error_Resync
function P_Formal_Discrete_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Discrete_Type_Definition, Token_Ptr);
Scan; -- past left paren
T_Box;
T_Right_Paren;
return Def_Node;
end P_Formal_Discrete_Type_Definition;
---------------------------------------------------
-- 12.5.2 Formal Signed Integer Type Definition --
---------------------------------------------------
-- FORMAL_SIGNED_INTEGER_TYPE_DEFINITION ::= range <>
-- The caller has checked the initial token is RANGE
-- Error recovery: cannot raise Error_Resync
function P_Formal_Signed_Integer_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Signed_Integer_Type_Definition, Token_Ptr);
Scan; -- past RANGE
T_Box;
return Def_Node;
end P_Formal_Signed_Integer_Type_Definition;
--------------------------------------------
-- 12.5.2 Formal Modular Type Definition --
--------------------------------------------
-- FORMAL_MODULAR_TYPE_DEFINITION ::= mod <>
-- The caller has checked the initial token is MOD
-- Error recovery: cannot raise Error_Resync
function P_Formal_Modular_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Modular_Type_Definition, Token_Ptr);
Scan; -- past MOD
T_Box;
return Def_Node;
end P_Formal_Modular_Type_Definition;
----------------------------------------------
-- 12.5.2 Formal Floating Point Definition --
----------------------------------------------
-- FORMAL_FLOATING_POINT_DEFINITION ::= digits <>
-- The caller has checked the initial token is DIGITS
-- Error recovery: cannot raise Error_Resync
function P_Formal_Floating_Point_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Floating_Point_Definition, Token_Ptr);
Scan; -- past DIGITS
T_Box;
return Def_Node;
end P_Formal_Floating_Point_Definition;
-------------------------------------------
-- 12.5.2 Formal Fixed Point Definition --
-------------------------------------------
-- This routine parses either a formal ordinary fixed point definition
-- or a formal decimal fixed point definition:
-- FORMAL_ORDINARY_FIXED_POINT_DEFINITION ::= delta <>
-- FORMAL_DECIMAL_FIXED_POINT_DEFINITION ::= delta <> digits <>
-- The caller has checked the initial token is DELTA
-- Error recovery: cannot raise Error_Resync
function P_Formal_Fixed_Point_Definition return Node_Id is
Def_Node : Node_Id;
Delta_Sloc : Source_Ptr;
begin
Delta_Sloc := Token_Ptr;
Scan; -- past DELTA
T_Box;
if Token = Tok_Digits then
Def_Node :=
New_Node (N_Formal_Decimal_Fixed_Point_Definition, Delta_Sloc);
Scan; -- past DIGITS
T_Box;
else
Def_Node :=
New_Node (N_Formal_Ordinary_Fixed_Point_Definition, Delta_Sloc);
end if;
return Def_Node;
end P_Formal_Fixed_Point_Definition;
----------------------------------------------------
-- 12.5.2 Formal Ordinary Fixed Point Definition --
----------------------------------------------------
-- Parsed by P_Formal_Fixed_Point_Definition (12.5.2)
---------------------------------------------------
-- 12.5.2 Formal Decimal Fixed Point Definition --
---------------------------------------------------
-- Parsed by P_Formal_Fixed_Point_Definition (12.5.2)
------------------------------------------
-- 12.5.3 Formal Array Type Definition --
------------------------------------------
-- Parsed by P_Formal_Type_Definition (12.5)
-------------------------------------------
-- 12.5.4 Formal Access Type Definition --
-------------------------------------------
-- Parsed by P_Formal_Type_Definition (12.5)
-----------------------------------------
-- 12.6 Formal Subprogram Declaration --
-----------------------------------------
-- FORMAL_SUBPROGRAM_DECLARATION ::=
g-zstspl.ads: New file. 2005-02-09 Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Javier Miranda <miranda@adacore.com> Pascal Obry <obry@adacore.com> Ed Schonberg <schonberg@adacore.com> Doug Rupp <rupp@adacore.com> Gary Dismukes <dismukes@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * g-zstspl.ads: New file. * a-chahan.ads, a-chahan.adb: Add declarations from AI-285 * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in Ada 95 mode Add definition of Wide_Wide_Space for AI-285 * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new interface (to support Ada 95 and Ada 2005 units). Add Unbounded_IO files Add entries for Wide_Wide packages for AI-285 Add list of containers packages to Ada 2005 unit list * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to support new Unbounded_IO package cleanly. * g-utf_32.ads, g-utf_32.adb: New files. * Makefile.rtl: Add entry for g-utf_32 Add new files for Unbounded_IO Adjust make file for new AI-285 wide wide packages Add AI-302 containers to the run time. * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads, a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New subprograms for AI-301. * a-stwiun.adb, a-stwiun.ads: Minor reformatting. * a-stunau.ads: Minor comment correction * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes etc. Also extend Text_IO_Kludge to support Wide_Wide_Text_IO (Check_RPC): Update to match changes in expanded code. Clean up unused entity. * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String was not taken into account. This includes proper initialization with Normalize_Scalars. (Get_Simple_Init_Val): Major rewrite for initialize scalars and normalize scalars cases (particularly the latter) to do a better job of finding invalid representations. * s-scaval.ads, s-scaval.adb: Add values for zero invalid values * s-strops.ads, s-strops.adb: Remove string normalize routines, never used * exp_dist.adb: Add support for wide wide character type (Expand_Receiving_Stubs_Bodies): For a package declaration that has a private part, generate stub bodies at the end of the private part, not the visible part. (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for PolyORB support. (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and generic wrapper to execute final processing after completing the expansion of the RPC receiver for an RACW. * snames.h, snames.ads, snames.adb: Add definitions for wide_wide packages and attributes. (Preset_Names): Addition of the new reserved words of Ada 2005, that is interface, overriding and synchronized. (Get_Pragma_Id): Give support to the use of the new reserved word "interface" as a pragma name. (Is_Pragma_Name): Give support to the use of the new reserved word "interface" as a pragma name. (Preset_Names): Add stream_size string for the Stream_Size Ada2005 attribute implementation. * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity checks to entities that are output parameters of Asm operations. Handle the Stream_Size attribute. Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error for second parameter being 0.0. Add support for wide wide character type. (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute. * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb, s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support for wide wide character cases. * cstand.adb: Create entities for Wide_Wide_Character and Wide_Wide_String. * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in accordance with AI-258. Add new declarations for 16/32 bit C character types (Part of AI285) * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag (Obsolescent_Warning): New field (Rep_Clause): New local subprogram used to share code. Returns the rep clause for which the name is given in parameter. (Has_Stream_Size_Clause): New routine. (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause. (Address_Clause): Implementation is now using Rep_Clause. (Alignment_Clause): Idem. (Size_Clause): Idem. * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005 entity in non-Ada 2005 mode and generate warning. * par-prag.adb: Add handling of one argument form for pragma Ada_05. (Prag): Code cleanup. Remove old gnat pragma "overriding" * sem_prag.adb: Add handling of one argument form for pragma Ada_05 (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings on the named unit if the pragma is not in the current compilation unit, so that elaboration calls in the current unit can set up an elaboration dependency on the named unit, as needed. (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library subprogram as well as for subprograms declared within a package. (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT pragma overriding. * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched to z) to avoid some instances of duplication for Wide_Wide packages. * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide characters. * scn.adb: Char_Literal_Value field is now a Uint * scng.adb: Significant rewrite to handle new Ada 2005 features allowing wide and wide wide characters in program text, e.g. for identifiers, as described in AI-285. (Set_Reserved): New procedure, makes setting up keywords cleaner. (Initialize_Scanner): Register the new reserved words of Ada 2005. (Scan): Give support to the new reserved words. * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. (P_Pragma): Allow the use of the new reserved word "interface" as a pragma name. * gnatls.adb, gnatbind.adb, ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename identifiers named "interface" to "SAL_Interface". * bindgen.adb (Gen_Main_Ada): Add support for the new SEH (Structured Exception handling). (Gen_Main_C): Idem. * bindgen.adb: (Gen_Main_Ada): Set the default exit code if specified. (Gen_Main_C): Likewise. Part of *DC20-006. (Gen_Output_File_C): Remove redundant output of gnat_exit_status. Code cleanup. Rename identifiers named "interface" to "SAL_Interface" * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of new -Xnnn switch. * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that has a collision with the new Ada 2005 "interface" reserved word. * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. * scans.ads (Token_Type): Addition of the tokens corresponding to the new reserved words of Ada 2005: Tok_Interface, Tok_Overriding and Tok_Synchronized. * sem_res.adb (Resolve_Actuals): Change error messages to refer to "dispatching" rather than "primitive" operations, since dispatching calls are now allowed to abstract formal subprograms (which are not primitive). Char_Literal_Value field is now a Uint (Resolve_Slice): If the prefix is an access to an unconstrained array, compute the actual subtype of the designated object to impose the proper index constraints. (Resolve_Selected_Component): Do not insert an access check if the prefix is an access type: such a node is expanded into an explicit dereference, on which the access check is performed anyway. Removes expensive duplicate checks. (Resolve_Call): Use new flag Is_Obsolescent and field Obsolescent_Warning so that pragma Obsolescent works on library subprograms. Add support for wide wide character type (Resolve_Allocator): Replace the error message on wrong null-exclusion value by a warning message. (Resolve_Type_Conversion): If the mixed-mode expression is interpreted as fixed-point, and one of the operands is non-static and universal, it can only be an illegal exponentiation operation, in which case there is no real value to retrieve. * exp_strm.adb: Add support for wide wide character type (Build_Elementary_Input_Call): Compute the size of the stream element by querying the rep chain to find the Stream_Attribute attribute value. (Build_Elementary_Write_Call): Ditto. * sem_aggr.adb: Char_Literal_Value field is now a Uint Add support for wide wide character type Replace the error messages on wrong null-exclusion value by warnings as described in Ada 2005. (Resolve_Extension_Aggregate): Document the fact that the error message on class-wide expressions in extensions aggregates. * sem_case.adb: Add support for wide wide character type * sem_ch13.adb: Add support for wide wide character type (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute. * sem_ch3.adb: Add support for wide wide character type (Process_Subtype): If constraint is illegal for the type, set Ekind of now-useless Itype, to prevent cascaded errors on a compiler built without -gnatp. * sem_ch8.adb: Add with and use of Sem_Disp. (Analyze_Subprogram_Renaming): Replace unclean uses of Corresponding_Spec with Corresponding_Formal_Spec (and delete setting of Corresponding_Spec to Empty). (Attribute_Renaming): Replace use of Corresponding_Spec with Corresponding_ Formal_Spec and simplify condition. (Use_One_Package): Check that scope of homonym of identifier is defined, before checking whether it is a wrapper package. Add support for wide wide character type * sem_eval.adb: Add support for wide wide character type. (Eval_Arithmetic_Op): Check for compile time known signed integer overflow in the non-static case. (Subtypes_Statically_Match): A formal scalar type and its base type do not statically match. * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to "not in" for test of N_Formal_Subprogram_Declaration (which is now a subtype). (Unit_Declaration_Node): Ditto. (Is_Variable_Prefix): For the case of an indexed component whose prefix has a packed array type, the prefix has been rewritten into a type conversion. Determine variable-ness from the converted expression. Handle wide wide character cases. * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String * stringt.ads, stringt.adb: Handle full UTF-32 range. Remove ["0A"] from comment, since it can look like a line terminator. Currently we don't permit this, but this is under discussion by the ARG, and it is easy enough to use a different example. * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for handling UTF-32 encoding for wide wide character. Implement new brackets coding ["hhhhhhhh"] Add UTF-8 encodings for full UTF-32 range * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31 bit range Add full UTF-32 support. (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to notify that constraint error will be raised at run-time because a null value is assigned to a null-excluding object. Remove some obsolete declarations and make Char_Code unsigned. * a-except.adb (Rcheck_30): New subprogram. Addition of the message corresponding to CE_Null_Not_Allowed, and adjust the output of all the Rcheck subprograms. * checks.adb (Check_Null_Not_Allowed): Replace the error message on wrong null-exclusion value by a warning message. (Enable_Range_Check): Do range check if the prefix is an explicit dereference whose designated object is an unconstrained array. Current algorithm for removing duplicate checks is over-eager in this case. * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong null-exclusion value by a warning message * atree.h, atree.ads, atree.adb: Remove Char_Code field support completely. Add support for Uint2 field sem_ch2.adb, exp_ch11.adb, exp_dbug.adb, exp_prag.adb: Char_Literal_Value field is now a Uint. * exp_util.adb (Insert_Actions): Replace N_Formal_Subprogram_Declaration by N_Formal_{Abstract|Concrete}_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function defined for subprogram renaming declarations. When set, the field indicates the defining entity of a corresponding formal subprogram when the renaming corresponds to a formal subprogram association in an instantiation. (Set_Corresponding_Formal_Spec): New procedure to return Corresponding_Formal_Spec field. Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration (which is now a subtype). Char_Literal_Value field is now a Uint * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the pointer to the base of the dispatch table. Minor changes to comments. (Controlling_Type): New function for determining the tagged type associated with a tagged primitive subprogram. (Expand_Dispatching_Call): Add support for a controlling actual that is directly a value of type Ada.Tag rather than a tagged object. * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation describing the new layout. (Dispatch_Table): The expander computes the actual array size, allocates the Dispatch_Table record accordingly, and generates code that displaces the base of the record after the Typeinfo_Ptr component. The access to these components is done by means of local functions. (Offset_To_Top): New function. (Typeinfo_Ptr): New function. (Get_TSD): Modified to access the new position of the TSD. (Set_TSD): Modified to save the TSD in its new position. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the case of formal abstract subprograms. Add check and message for -gnat05. Update comments. * sem_ch12.adb: Add with and use for Sem_Disp. (Analyze_Associations): Minor change from "=" to "in" for use of N_Formal_Subtype_Declaration (which is now a subtype). (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of N_Formal_Subtype_Declaration (which is now a subtype). (Analyze_Formal_Subprogram): Add handling for N_Formal_Abstract_Subprogram, marking the formal as abstract and dispatching, setting the controlling status of the formal parameters and result, and issuing an error if there is no controlling type for the formal subprogram. (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec, which is an unclean use of that field, we set the new field Corresponding_Formal_Spec to make the formal subprogram available to processing in Analyze_Subprogram_Declaration. (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point, Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type Constrained, so that it is is does not statically match its anonymous base type. * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for abstract formal subprograms in error check for functions returning abstract types. Set scope of new designator for a parameterless subprogram, so that it is available when checking the body for nested subprograms, before full analysis of said body. (Analyze_Subprogram_Body): Warn on inlining bodies with nested subprogram only if inner one comes from source. (Analyze_Function_Call): If the call is given in object notation, the analysis of the name rewrites the node and analyzes it with the proper argument list. After analyzing the name, if the call has been rewritten and the result type is set, no further analysis is needed. (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype mark in function specification, in a context where the formals are visible and hide outer homographs. * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope as the tagged type for the cases of abstract formal subprograms and renamings of those. Clean up spec comments. (Check_Dispatching_Context): Add error message to indicate "abstract procedure", covering the case of a call to a formal abstract procedure that has statically tagged operands. (Check_Dispatching_Call): Check for the case of an actual given by a tag-indeterminate function call whose type is an ancestor of the containing call's associated tagged type. This situation can occur for inherited primitives with function defaults. In this case we use the tagged type's tag directly as the controlling argument for the calls. (Expand_Call): Name change on call to Expand_Dispatch_Call. * sprint.adb (Sprint_Node_Actual): Split N_Formal_Subprogram_Declaration into two alternatives for the new cases N_Formal_Abstract_Subprogram_Declaration and N_Formal_Concrete_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * trans.c: Get rid of junk Uint2 reference. Char_Literal_Value field is now a Uint. (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P. (gigi): Correct third arg to gimplify_body. * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag. (TYPE_LANG_FLAG_0): Check for record or union. * treepr.adb: Char_Literal_Value field is now a Uint * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and UI_From_CC. * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function Add full UTF-32 support Char_Code is now 32 bits * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with wide character UTF_32 line terminators. Initialize Main_Source_File to avoid error when no main source is loaded. * errout.adb (Finalize): Do not check Num_SRef_Pragmas (Main_Source_File) when no main source has been loaded, to avoid potential crash. From-SVN: r94809
2005-02-10 14:50:48 +01:00
-- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION
-- | FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION
-- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT]
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
g-zstspl.ads: New file. 2005-02-09 Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Javier Miranda <miranda@adacore.com> Pascal Obry <obry@adacore.com> Ed Schonberg <schonberg@adacore.com> Doug Rupp <rupp@adacore.com> Gary Dismukes <dismukes@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * g-zstspl.ads: New file. * a-chahan.ads, a-chahan.adb: Add declarations from AI-285 * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in Ada 95 mode Add definition of Wide_Wide_Space for AI-285 * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new interface (to support Ada 95 and Ada 2005 units). Add Unbounded_IO files Add entries for Wide_Wide packages for AI-285 Add list of containers packages to Ada 2005 unit list * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to support new Unbounded_IO package cleanly. * g-utf_32.ads, g-utf_32.adb: New files. * Makefile.rtl: Add entry for g-utf_32 Add new files for Unbounded_IO Adjust make file for new AI-285 wide wide packages Add AI-302 containers to the run time. * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads, a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New subprograms for AI-301. * a-stwiun.adb, a-stwiun.ads: Minor reformatting. * a-stunau.ads: Minor comment correction * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes etc. Also extend Text_IO_Kludge to support Wide_Wide_Text_IO (Check_RPC): Update to match changes in expanded code. Clean up unused entity. * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String was not taken into account. This includes proper initialization with Normalize_Scalars. (Get_Simple_Init_Val): Major rewrite for initialize scalars and normalize scalars cases (particularly the latter) to do a better job of finding invalid representations. * s-scaval.ads, s-scaval.adb: Add values for zero invalid values * s-strops.ads, s-strops.adb: Remove string normalize routines, never used * exp_dist.adb: Add support for wide wide character type (Expand_Receiving_Stubs_Bodies): For a package declaration that has a private part, generate stub bodies at the end of the private part, not the visible part. (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for PolyORB support. (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and generic wrapper to execute final processing after completing the expansion of the RPC receiver for an RACW. * snames.h, snames.ads, snames.adb: Add definitions for wide_wide packages and attributes. (Preset_Names): Addition of the new reserved words of Ada 2005, that is interface, overriding and synchronized. (Get_Pragma_Id): Give support to the use of the new reserved word "interface" as a pragma name. (Is_Pragma_Name): Give support to the use of the new reserved word "interface" as a pragma name. (Preset_Names): Add stream_size string for the Stream_Size Ada2005 attribute implementation. * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity checks to entities that are output parameters of Asm operations. Handle the Stream_Size attribute. Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error for second parameter being 0.0. Add support for wide wide character type. (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute. * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb, s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support for wide wide character cases. * cstand.adb: Create entities for Wide_Wide_Character and Wide_Wide_String. * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in accordance with AI-258. Add new declarations for 16/32 bit C character types (Part of AI285) * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag (Obsolescent_Warning): New field (Rep_Clause): New local subprogram used to share code. Returns the rep clause for which the name is given in parameter. (Has_Stream_Size_Clause): New routine. (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause. (Address_Clause): Implementation is now using Rep_Clause. (Alignment_Clause): Idem. (Size_Clause): Idem. * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005 entity in non-Ada 2005 mode and generate warning. * par-prag.adb: Add handling of one argument form for pragma Ada_05. (Prag): Code cleanup. Remove old gnat pragma "overriding" * sem_prag.adb: Add handling of one argument form for pragma Ada_05 (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings on the named unit if the pragma is not in the current compilation unit, so that elaboration calls in the current unit can set up an elaboration dependency on the named unit, as needed. (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library subprogram as well as for subprograms declared within a package. (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT pragma overriding. * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched to z) to avoid some instances of duplication for Wide_Wide packages. * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide characters. * scn.adb: Char_Literal_Value field is now a Uint * scng.adb: Significant rewrite to handle new Ada 2005 features allowing wide and wide wide characters in program text, e.g. for identifiers, as described in AI-285. (Set_Reserved): New procedure, makes setting up keywords cleaner. (Initialize_Scanner): Register the new reserved words of Ada 2005. (Scan): Give support to the new reserved words. * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. (P_Pragma): Allow the use of the new reserved word "interface" as a pragma name. * gnatls.adb, gnatbind.adb, ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename identifiers named "interface" to "SAL_Interface". * bindgen.adb (Gen_Main_Ada): Add support for the new SEH (Structured Exception handling). (Gen_Main_C): Idem. * bindgen.adb: (Gen_Main_Ada): Set the default exit code if specified. (Gen_Main_C): Likewise. Part of *DC20-006. (Gen_Output_File_C): Remove redundant output of gnat_exit_status. Code cleanup. Rename identifiers named "interface" to "SAL_Interface" * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of new -Xnnn switch. * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that has a collision with the new Ada 2005 "interface" reserved word. * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. * scans.ads (Token_Type): Addition of the tokens corresponding to the new reserved words of Ada 2005: Tok_Interface, Tok_Overriding and Tok_Synchronized. * sem_res.adb (Resolve_Actuals): Change error messages to refer to "dispatching" rather than "primitive" operations, since dispatching calls are now allowed to abstract formal subprograms (which are not primitive). Char_Literal_Value field is now a Uint (Resolve_Slice): If the prefix is an access to an unconstrained array, compute the actual subtype of the designated object to impose the proper index constraints. (Resolve_Selected_Component): Do not insert an access check if the prefix is an access type: such a node is expanded into an explicit dereference, on which the access check is performed anyway. Removes expensive duplicate checks. (Resolve_Call): Use new flag Is_Obsolescent and field Obsolescent_Warning so that pragma Obsolescent works on library subprograms. Add support for wide wide character type (Resolve_Allocator): Replace the error message on wrong null-exclusion value by a warning message. (Resolve_Type_Conversion): If the mixed-mode expression is interpreted as fixed-point, and one of the operands is non-static and universal, it can only be an illegal exponentiation operation, in which case there is no real value to retrieve. * exp_strm.adb: Add support for wide wide character type (Build_Elementary_Input_Call): Compute the size of the stream element by querying the rep chain to find the Stream_Attribute attribute value. (Build_Elementary_Write_Call): Ditto. * sem_aggr.adb: Char_Literal_Value field is now a Uint Add support for wide wide character type Replace the error messages on wrong null-exclusion value by warnings as described in Ada 2005. (Resolve_Extension_Aggregate): Document the fact that the error message on class-wide expressions in extensions aggregates. * sem_case.adb: Add support for wide wide character type * sem_ch13.adb: Add support for wide wide character type (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute. * sem_ch3.adb: Add support for wide wide character type (Process_Subtype): If constraint is illegal for the type, set Ekind of now-useless Itype, to prevent cascaded errors on a compiler built without -gnatp. * sem_ch8.adb: Add with and use of Sem_Disp. (Analyze_Subprogram_Renaming): Replace unclean uses of Corresponding_Spec with Corresponding_Formal_Spec (and delete setting of Corresponding_Spec to Empty). (Attribute_Renaming): Replace use of Corresponding_Spec with Corresponding_ Formal_Spec and simplify condition. (Use_One_Package): Check that scope of homonym of identifier is defined, before checking whether it is a wrapper package. Add support for wide wide character type * sem_eval.adb: Add support for wide wide character type. (Eval_Arithmetic_Op): Check for compile time known signed integer overflow in the non-static case. (Subtypes_Statically_Match): A formal scalar type and its base type do not statically match. * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to "not in" for test of N_Formal_Subprogram_Declaration (which is now a subtype). (Unit_Declaration_Node): Ditto. (Is_Variable_Prefix): For the case of an indexed component whose prefix has a packed array type, the prefix has been rewritten into a type conversion. Determine variable-ness from the converted expression. Handle wide wide character cases. * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String * stringt.ads, stringt.adb: Handle full UTF-32 range. Remove ["0A"] from comment, since it can look like a line terminator. Currently we don't permit this, but this is under discussion by the ARG, and it is easy enough to use a different example. * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for handling UTF-32 encoding for wide wide character. Implement new brackets coding ["hhhhhhhh"] Add UTF-8 encodings for full UTF-32 range * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31 bit range Add full UTF-32 support. (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to notify that constraint error will be raised at run-time because a null value is assigned to a null-excluding object. Remove some obsolete declarations and make Char_Code unsigned. * a-except.adb (Rcheck_30): New subprogram. Addition of the message corresponding to CE_Null_Not_Allowed, and adjust the output of all the Rcheck subprograms. * checks.adb (Check_Null_Not_Allowed): Replace the error message on wrong null-exclusion value by a warning message. (Enable_Range_Check): Do range check if the prefix is an explicit dereference whose designated object is an unconstrained array. Current algorithm for removing duplicate checks is over-eager in this case. * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong null-exclusion value by a warning message * atree.h, atree.ads, atree.adb: Remove Char_Code field support completely. Add support for Uint2 field sem_ch2.adb, exp_ch11.adb, exp_dbug.adb, exp_prag.adb: Char_Literal_Value field is now a Uint. * exp_util.adb (Insert_Actions): Replace N_Formal_Subprogram_Declaration by N_Formal_{Abstract|Concrete}_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function defined for subprogram renaming declarations. When set, the field indicates the defining entity of a corresponding formal subprogram when the renaming corresponds to a formal subprogram association in an instantiation. (Set_Corresponding_Formal_Spec): New procedure to return Corresponding_Formal_Spec field. Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration (which is now a subtype). Char_Literal_Value field is now a Uint * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the pointer to the base of the dispatch table. Minor changes to comments. (Controlling_Type): New function for determining the tagged type associated with a tagged primitive subprogram. (Expand_Dispatching_Call): Add support for a controlling actual that is directly a value of type Ada.Tag rather than a tagged object. * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation describing the new layout. (Dispatch_Table): The expander computes the actual array size, allocates the Dispatch_Table record accordingly, and generates code that displaces the base of the record after the Typeinfo_Ptr component. The access to these components is done by means of local functions. (Offset_To_Top): New function. (Typeinfo_Ptr): New function. (Get_TSD): Modified to access the new position of the TSD. (Set_TSD): Modified to save the TSD in its new position. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the case of formal abstract subprograms. Add check and message for -gnat05. Update comments. * sem_ch12.adb: Add with and use for Sem_Disp. (Analyze_Associations): Minor change from "=" to "in" for use of N_Formal_Subtype_Declaration (which is now a subtype). (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of N_Formal_Subtype_Declaration (which is now a subtype). (Analyze_Formal_Subprogram): Add handling for N_Formal_Abstract_Subprogram, marking the formal as abstract and dispatching, setting the controlling status of the formal parameters and result, and issuing an error if there is no controlling type for the formal subprogram. (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec, which is an unclean use of that field, we set the new field Corresponding_Formal_Spec to make the formal subprogram available to processing in Analyze_Subprogram_Declaration. (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point, Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type Constrained, so that it is is does not statically match its anonymous base type. * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for abstract formal subprograms in error check for functions returning abstract types. Set scope of new designator for a parameterless subprogram, so that it is available when checking the body for nested subprograms, before full analysis of said body. (Analyze_Subprogram_Body): Warn on inlining bodies with nested subprogram only if inner one comes from source. (Analyze_Function_Call): If the call is given in object notation, the analysis of the name rewrites the node and analyzes it with the proper argument list. After analyzing the name, if the call has been rewritten and the result type is set, no further analysis is needed. (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype mark in function specification, in a context where the formals are visible and hide outer homographs. * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope as the tagged type for the cases of abstract formal subprograms and renamings of those. Clean up spec comments. (Check_Dispatching_Context): Add error message to indicate "abstract procedure", covering the case of a call to a formal abstract procedure that has statically tagged operands. (Check_Dispatching_Call): Check for the case of an actual given by a tag-indeterminate function call whose type is an ancestor of the containing call's associated tagged type. This situation can occur for inherited primitives with function defaults. In this case we use the tagged type's tag directly as the controlling argument for the calls. (Expand_Call): Name change on call to Expand_Dispatch_Call. * sprint.adb (Sprint_Node_Actual): Split N_Formal_Subprogram_Declaration into two alternatives for the new cases N_Formal_Abstract_Subprogram_Declaration and N_Formal_Concrete_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * trans.c: Get rid of junk Uint2 reference. Char_Literal_Value field is now a Uint. (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P. (gigi): Correct third arg to gimplify_body. * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag. (TYPE_LANG_FLAG_0): Check for record or union. * treepr.adb: Char_Literal_Value field is now a Uint * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and UI_From_CC. * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function Add full UTF-32 support Char_Code is now 32 bits * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with wide character UTF_32 line terminators. Initialize Main_Source_File to avoid error when no main source is loaded. * errout.adb (Finalize): Do not check Num_SRef_Pragmas (Main_Source_File) when no main source has been loaded, to avoid potential crash. From-SVN: r94809
2005-02-10 14:50:48 +01:00
-- FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION is abstract [SUBPROGRAM_DEFAULT]
-- [ASPECT_SPECIFICATIONS];
g-zstspl.ads: New file. 2005-02-09 Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Javier Miranda <miranda@adacore.com> Pascal Obry <obry@adacore.com> Ed Schonberg <schonberg@adacore.com> Doug Rupp <rupp@adacore.com> Gary Dismukes <dismukes@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * g-zstspl.ads: New file. * a-chahan.ads, a-chahan.adb: Add declarations from AI-285 * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in Ada 95 mode Add definition of Wide_Wide_Space for AI-285 * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new interface (to support Ada 95 and Ada 2005 units). Add Unbounded_IO files Add entries for Wide_Wide packages for AI-285 Add list of containers packages to Ada 2005 unit list * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to support new Unbounded_IO package cleanly. * g-utf_32.ads, g-utf_32.adb: New files. * Makefile.rtl: Add entry for g-utf_32 Add new files for Unbounded_IO Adjust make file for new AI-285 wide wide packages Add AI-302 containers to the run time. * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads, a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New subprograms for AI-301. * a-stwiun.adb, a-stwiun.ads: Minor reformatting. * a-stunau.ads: Minor comment correction * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes etc. Also extend Text_IO_Kludge to support Wide_Wide_Text_IO (Check_RPC): Update to match changes in expanded code. Clean up unused entity. * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String was not taken into account. This includes proper initialization with Normalize_Scalars. (Get_Simple_Init_Val): Major rewrite for initialize scalars and normalize scalars cases (particularly the latter) to do a better job of finding invalid representations. * s-scaval.ads, s-scaval.adb: Add values for zero invalid values * s-strops.ads, s-strops.adb: Remove string normalize routines, never used * exp_dist.adb: Add support for wide wide character type (Expand_Receiving_Stubs_Bodies): For a package declaration that has a private part, generate stub bodies at the end of the private part, not the visible part. (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for PolyORB support. (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and generic wrapper to execute final processing after completing the expansion of the RPC receiver for an RACW. * snames.h, snames.ads, snames.adb: Add definitions for wide_wide packages and attributes. (Preset_Names): Addition of the new reserved words of Ada 2005, that is interface, overriding and synchronized. (Get_Pragma_Id): Give support to the use of the new reserved word "interface" as a pragma name. (Is_Pragma_Name): Give support to the use of the new reserved word "interface" as a pragma name. (Preset_Names): Add stream_size string for the Stream_Size Ada2005 attribute implementation. * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity checks to entities that are output parameters of Asm operations. Handle the Stream_Size attribute. Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error for second parameter being 0.0. Add support for wide wide character type. (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute. * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb, s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support for wide wide character cases. * cstand.adb: Create entities for Wide_Wide_Character and Wide_Wide_String. * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in accordance with AI-258. Add new declarations for 16/32 bit C character types (Part of AI285) * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag (Obsolescent_Warning): New field (Rep_Clause): New local subprogram used to share code. Returns the rep clause for which the name is given in parameter. (Has_Stream_Size_Clause): New routine. (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause. (Address_Clause): Implementation is now using Rep_Clause. (Alignment_Clause): Idem. (Size_Clause): Idem. * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005 entity in non-Ada 2005 mode and generate warning. * par-prag.adb: Add handling of one argument form for pragma Ada_05. (Prag): Code cleanup. Remove old gnat pragma "overriding" * sem_prag.adb: Add handling of one argument form for pragma Ada_05 (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings on the named unit if the pragma is not in the current compilation unit, so that elaboration calls in the current unit can set up an elaboration dependency on the named unit, as needed. (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library subprogram as well as for subprograms declared within a package. (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT pragma overriding. * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched to z) to avoid some instances of duplication for Wide_Wide packages. * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide characters. * scn.adb: Char_Literal_Value field is now a Uint * scng.adb: Significant rewrite to handle new Ada 2005 features allowing wide and wide wide characters in program text, e.g. for identifiers, as described in AI-285. (Set_Reserved): New procedure, makes setting up keywords cleaner. (Initialize_Scanner): Register the new reserved words of Ada 2005. (Scan): Give support to the new reserved words. * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. (P_Pragma): Allow the use of the new reserved word "interface" as a pragma name. * gnatls.adb, gnatbind.adb, ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename identifiers named "interface" to "SAL_Interface". * bindgen.adb (Gen_Main_Ada): Add support for the new SEH (Structured Exception handling). (Gen_Main_C): Idem. * bindgen.adb: (Gen_Main_Ada): Set the default exit code if specified. (Gen_Main_C): Likewise. Part of *DC20-006. (Gen_Output_File_C): Remove redundant output of gnat_exit_status. Code cleanup. Rename identifiers named "interface" to "SAL_Interface" * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of new -Xnnn switch. * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that has a collision with the new Ada 2005 "interface" reserved word. * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. * scans.ads (Token_Type): Addition of the tokens corresponding to the new reserved words of Ada 2005: Tok_Interface, Tok_Overriding and Tok_Synchronized. * sem_res.adb (Resolve_Actuals): Change error messages to refer to "dispatching" rather than "primitive" operations, since dispatching calls are now allowed to abstract formal subprograms (which are not primitive). Char_Literal_Value field is now a Uint (Resolve_Slice): If the prefix is an access to an unconstrained array, compute the actual subtype of the designated object to impose the proper index constraints. (Resolve_Selected_Component): Do not insert an access check if the prefix is an access type: such a node is expanded into an explicit dereference, on which the access check is performed anyway. Removes expensive duplicate checks. (Resolve_Call): Use new flag Is_Obsolescent and field Obsolescent_Warning so that pragma Obsolescent works on library subprograms. Add support for wide wide character type (Resolve_Allocator): Replace the error message on wrong null-exclusion value by a warning message. (Resolve_Type_Conversion): If the mixed-mode expression is interpreted as fixed-point, and one of the operands is non-static and universal, it can only be an illegal exponentiation operation, in which case there is no real value to retrieve. * exp_strm.adb: Add support for wide wide character type (Build_Elementary_Input_Call): Compute the size of the stream element by querying the rep chain to find the Stream_Attribute attribute value. (Build_Elementary_Write_Call): Ditto. * sem_aggr.adb: Char_Literal_Value field is now a Uint Add support for wide wide character type Replace the error messages on wrong null-exclusion value by warnings as described in Ada 2005. (Resolve_Extension_Aggregate): Document the fact that the error message on class-wide expressions in extensions aggregates. * sem_case.adb: Add support for wide wide character type * sem_ch13.adb: Add support for wide wide character type (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute. * sem_ch3.adb: Add support for wide wide character type (Process_Subtype): If constraint is illegal for the type, set Ekind of now-useless Itype, to prevent cascaded errors on a compiler built without -gnatp. * sem_ch8.adb: Add with and use of Sem_Disp. (Analyze_Subprogram_Renaming): Replace unclean uses of Corresponding_Spec with Corresponding_Formal_Spec (and delete setting of Corresponding_Spec to Empty). (Attribute_Renaming): Replace use of Corresponding_Spec with Corresponding_ Formal_Spec and simplify condition. (Use_One_Package): Check that scope of homonym of identifier is defined, before checking whether it is a wrapper package. Add support for wide wide character type * sem_eval.adb: Add support for wide wide character type. (Eval_Arithmetic_Op): Check for compile time known signed integer overflow in the non-static case. (Subtypes_Statically_Match): A formal scalar type and its base type do not statically match. * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to "not in" for test of N_Formal_Subprogram_Declaration (which is now a subtype). (Unit_Declaration_Node): Ditto. (Is_Variable_Prefix): For the case of an indexed component whose prefix has a packed array type, the prefix has been rewritten into a type conversion. Determine variable-ness from the converted expression. Handle wide wide character cases. * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String * stringt.ads, stringt.adb: Handle full UTF-32 range. Remove ["0A"] from comment, since it can look like a line terminator. Currently we don't permit this, but this is under discussion by the ARG, and it is easy enough to use a different example. * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for handling UTF-32 encoding for wide wide character. Implement new brackets coding ["hhhhhhhh"] Add UTF-8 encodings for full UTF-32 range * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31 bit range Add full UTF-32 support. (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to notify that constraint error will be raised at run-time because a null value is assigned to a null-excluding object. Remove some obsolete declarations and make Char_Code unsigned. * a-except.adb (Rcheck_30): New subprogram. Addition of the message corresponding to CE_Null_Not_Allowed, and adjust the output of all the Rcheck subprograms. * checks.adb (Check_Null_Not_Allowed): Replace the error message on wrong null-exclusion value by a warning message. (Enable_Range_Check): Do range check if the prefix is an explicit dereference whose designated object is an unconstrained array. Current algorithm for removing duplicate checks is over-eager in this case. * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong null-exclusion value by a warning message * atree.h, atree.ads, atree.adb: Remove Char_Code field support completely. Add support for Uint2 field sem_ch2.adb, exp_ch11.adb, exp_dbug.adb, exp_prag.adb: Char_Literal_Value field is now a Uint. * exp_util.adb (Insert_Actions): Replace N_Formal_Subprogram_Declaration by N_Formal_{Abstract|Concrete}_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function defined for subprogram renaming declarations. When set, the field indicates the defining entity of a corresponding formal subprogram when the renaming corresponds to a formal subprogram association in an instantiation. (Set_Corresponding_Formal_Spec): New procedure to return Corresponding_Formal_Spec field. Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration (which is now a subtype). Char_Literal_Value field is now a Uint * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the pointer to the base of the dispatch table. Minor changes to comments. (Controlling_Type): New function for determining the tagged type associated with a tagged primitive subprogram. (Expand_Dispatching_Call): Add support for a controlling actual that is directly a value of type Ada.Tag rather than a tagged object. * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation describing the new layout. (Dispatch_Table): The expander computes the actual array size, allocates the Dispatch_Table record accordingly, and generates code that displaces the base of the record after the Typeinfo_Ptr component. The access to these components is done by means of local functions. (Offset_To_Top): New function. (Typeinfo_Ptr): New function. (Get_TSD): Modified to access the new position of the TSD. (Set_TSD): Modified to save the TSD in its new position. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the case of formal abstract subprograms. Add check and message for -gnat05. Update comments. * sem_ch12.adb: Add with and use for Sem_Disp. (Analyze_Associations): Minor change from "=" to "in" for use of N_Formal_Subtype_Declaration (which is now a subtype). (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of N_Formal_Subtype_Declaration (which is now a subtype). (Analyze_Formal_Subprogram): Add handling for N_Formal_Abstract_Subprogram, marking the formal as abstract and dispatching, setting the controlling status of the formal parameters and result, and issuing an error if there is no controlling type for the formal subprogram. (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec, which is an unclean use of that field, we set the new field Corresponding_Formal_Spec to make the formal subprogram available to processing in Analyze_Subprogram_Declaration. (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point, Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type Constrained, so that it is is does not statically match its anonymous base type. * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for abstract formal subprograms in error check for functions returning abstract types. Set scope of new designator for a parameterless subprogram, so that it is available when checking the body for nested subprograms, before full analysis of said body. (Analyze_Subprogram_Body): Warn on inlining bodies with nested subprogram only if inner one comes from source. (Analyze_Function_Call): If the call is given in object notation, the analysis of the name rewrites the node and analyzes it with the proper argument list. After analyzing the name, if the call has been rewritten and the result type is set, no further analysis is needed. (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype mark in function specification, in a context where the formals are visible and hide outer homographs. * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope as the tagged type for the cases of abstract formal subprograms and renamings of those. Clean up spec comments. (Check_Dispatching_Context): Add error message to indicate "abstract procedure", covering the case of a call to a formal abstract procedure that has statically tagged operands. (Check_Dispatching_Call): Check for the case of an actual given by a tag-indeterminate function call whose type is an ancestor of the containing call's associated tagged type. This situation can occur for inherited primitives with function defaults. In this case we use the tagged type's tag directly as the controlling argument for the calls. (Expand_Call): Name change on call to Expand_Dispatch_Call. * sprint.adb (Sprint_Node_Actual): Split N_Formal_Subprogram_Declaration into two alternatives for the new cases N_Formal_Abstract_Subprogram_Declaration and N_Formal_Concrete_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * trans.c: Get rid of junk Uint2 reference. Char_Literal_Value field is now a Uint. (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P. (gigi): Correct third arg to gimplify_body. * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag. (TYPE_LANG_FLAG_0): Check for record or union. * treepr.adb: Char_Literal_Value field is now a Uint * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and UI_From_CC. * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function Add full UTF-32 support Char_Code is now 32 bits * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with wide character UTF_32 line terminators. Initialize Main_Source_File to avoid error when no main source is loaded. * errout.adb (Finalize): Do not check Num_SRef_Pragmas (Main_Source_File) when no main source has been loaded, to avoid potential crash. From-SVN: r94809
2005-02-10 14:50:48 +01:00
2001-10-02 16:23:52 +02:00
-- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <>
einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on anonymous access types... 2005-06-14 Ed Schonberg <schonberg@adacore.com> Javier Miranda <miranda@adacore.com> Thomas Quinot <quinot@adacore.com> Robert Dewar <dewar@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> Gary Dismukes <dismukes@adacore.com> * einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on anonymous access types, to indicate that the accessibility level of the type is determined by that of the enclosing declaration. (Has_Persistent_BSS): New flag (Set_Is_Primitive_Wrapper): Upgrade the barrier to allow the usage of this attribute with functions. (Is_Primitive_Wrapper): Remove the barrier. (Has_Specified_Stream_Input, Has_Specified_Stream_Output, Has_Specified_Stream_Read, Has_Specified_Stream_Write): New subprograms. (Set_Has_Specified_Stream_Input, Set_Has_Specified_Stream_Output, Set_Has_Specified_Stream_Read, Set_Has_Specified_Stream_Write): New subprograms. (Is_Pure_Unit_Access_Type): New flag (Abstract_Interfaces): Complete the assertion to cover all usages. (Set_Is_Interface): Complete the assertion to cover all usages. (Is_Primitive_Wrapper): New attribute. (Is_Obsolescent): Now applies to all entities (though it is only set for subprograms currently) New flag: Has_Constrained_Partial_View, to implemente Ada 2005 AI-363, which solves various problems concerning access subtypes. (Has_Persistent_BSS): New flag (Is_Primitive_Wrapper, Set_Primitive_Wrapper): Code cleanup. Remove these subprograms because this attribute is currently not used. New entity flags: Has_Specified_Stream_Input (Flag190) Has_Specified_Stream_Output (Flag191) Has_Specified_Stream_Read (Flag192) Has_Specified_Stream_Write (Flag193) Present in all type and subtype entities. Set for a given view if the corresponding stream-oriented attribute has been defined by an attribute definition clause. When such a clause occurs, a TSS is set on the underlying full view; the flags are used to track visibility of the attribute definition clause for partial or incomplete views. (Is_Pure_Unit_Access_Type): New flag Clarify use of Is_Internal. (Is_Primitive_Wrapper): New attribute present in primitive subprograms internally generated to wrap the invocation of tasks and protected types that implement interfaces. (Implementation_Base_Type): Documentation correction (Is_Obsolescent): Now applies to all entities (though it is only set for subprograms currently) New flag: Has_Constrained_Partial_View, to implement Ada 2005 AI-363, which solves various problems concerning access subtypes. * exp_ch9.adb (Type_Conformant_Parameters): Introduce mode conformance for examined parameters. Identify unequal parameter list lengths as non-conformant parameters. (Overriding_Possible): Do not check for "All" qualifier in declaration of controlling access parameter, following prescription of AI-404. (Build_Entry_Wrapper_Spec, Build_Entry_Wrapper_Body): New subprograms that build the procedure body that wraps an entry invocation (Build_Corresponding_Record, Build_Protected_Sub_Specification, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Expand_N_Task_Body, Expand_N_Task_Type_Declaration): Modified to give support to abstract interface types * freeze.adb (Freeze_Entity): Issue error message if Is_Pure_Unit_Access_Type set, unless we are in Ada 2005 mode and the type has no storage pool (Ada 2005) AI-366. Also modified to give support to abstract interface types (Freeze_Subprogram): Issue an error for a dispatching subprogram with an Inline_Always pragma. * par-ch9.adb (P_Task_Items): Reserved words "not" or "overriding" may now begin an entry declaration. (P_Entry_Or_Subprogram_With_Indicator): New procedure in P_Protected_Operation_Declaration_Opt. Parse an entry declaration or a subprogram declaration preceded by an overriding indicator. (P_Protected_Operation_Declaration_Opt): Add case for parsing entry declarations or subprogram declarations preceded by reserved words "not" or "overriding". (P_Entry_Declaration): Update comment. Parse and check overriding indicator, set semantic flags of entry declarations. (P_Task): New error message in case of private applied to a task type declaration. (P_Protected): New error message in case of private applied to a task type declaration. * sem_ch7.adb (Preserve_Full_Attributes): Modified to handle the case in which the full view of a type implementing an interface is a concurrent type. (Has_Overriding_Pragma): Remove obsolete implementation of AI-218. Declare_Inherited_Private_Subprograms): If an explicit operation overrides an operation that is inherited in the private part, mark the explicit one as overriding, to enable overriding indicator checks. (Preserve_Full_Attributes): Propagate Is_Unchecked_Union attribute from full view to partial view, to simplify handling in back-end. * sprint.adb: Print interface lists where needed: derived types, protected types, task types. output "is null" for null procedures. Part of implementation of * sem_cat.adb (Validate_Access_Type_Declaration): Implement AI-366 relaxation of rules for access types in pure, shared passive partitions. * exp_strm.adb (Build_Mutable_Record_Read_Procedure): Reorganize to first read discriminants into temporary objects, performing checks on the read values, then possibly performing discriminant checks on the actual (if it is constrained), and only finally reading the components into a constrained temporary object. (Build_Elementary_Input_Call): Adjust the specific circuitry for the case of reading discriminants of a mutable record type to recognize the new form of the code generated by Build_Mutable_Record_Read_Procedure. * exp_tss.ads, exp_tss.adb (Make_Init_Proc_Name): Reimplement in terms of a simple call to Make_TSS_Name. (Make_TSS_Name_Local): Add the TSS name as the last thing in the name buffer, in order for Is_TSS to work correctly on local TSS names. * sem_attr.ads, sem_attr.adb (Resolve_Attribute, case 'Access): Use flag Is_Local_Anonymous_Access to check legaliy of attributes in the context of access components and stand-alone access objects. (Stream_Attribute_Available): In Ada 95 mode, a stream attribute is treated as available for a limited private type if there is an attribute_definition_clause that applies to its full view, but not in other cases where the attribute is available for the full view (specifically, the sole fact that the full view is non-limited does not make the attribute available for the partial view). (Build_Access_Subprogram_Type): Diagnose attempt to apply 'access to a non-overloaded intrinsic subprogram. (Check_Stream_Attribute): Reject an attribute reference for an unavailable stream attribute even if the prefix is not a limited type (case of a 'Input attribute reference for an abstract, non-classwide type) (Stream_Attribute_Available): New function to determine whether a stream attribute is available at a place. (Check_Attribute): Use Stream_Attribute_Available instead of just testing for TSS presence on the implementation base type. (Analyze_Attribute): Modified to give support to task interfaces. (Analyze_Access_Attribute): Add error check for use of an Access (or Unrestricted_Access) attribute with a subprogram marked as Inline_Always. (Analyze_Attribute, case Attribute_Address): Add error check for use of an Address attribute with a subprogram marked as Inline_Always. Update Eval_Attribute to handle new value of Width from AI-395 * sem_ch13.adb (Analyze_Stream_TSS_Definition): New subprogram. (Analyze_Attribute_Definition_Clause, cases Input, Output, Read, Write): Factor common code across the stream-oriented attribute circcuits into a new subprogram, Analyze_Stream_TSS_Definition. The new uniform processing is functionally identical to the previous duplicated one, except that an expression that denotes an abstract subprogram will now be rejected, as mandated by AI-195 item 5. * sem_util.ads, sem_util.adb (Type_Access_Level): Use flag Is_Local_Anonymous_Access to apply accessibility checks to access components and stand-alone access objects. (Has_Discriminant_Dependent_Constraint): Moved to spec for use elsewhere. (Is_Potentially_Persistent_Type): New function (Is_Dependent_Component_Of_Mutable_Object): If the enclosing object is a heap-object whose type has a constrained partial view, the object is unconstrained and the component may depend on a discriminant, making its renaming illegal. * sinfo.ads, sinfo.adb (Must_Not_Override): Flag applicable to N_Entry_Declaration. (Must_Override): Flag applicable to N_Entry_Declaration. Indicate that interface_list can appear in single task and single protected declarations. Replace Is_Overriding and Not_Overriding with Must_Override and Must_Not_Override, to better express intent of AI. Is_Overriding, Not_Overriding: Ada2005 flags that indicate the presence of an overriding indicator in a subprogram or instance. Ada 2005 (AI-248) Null_Present can appear in a procedure specification. Add the overriding indicator [[not] overriding] construct to the following grammar productions: ENTRY_DECLARATION GENERIC_INSTANTIATION SUBPROGRAM_SPECIFICATION * par-ch10.adb (P_Compilation_Unit): Subprogram declaration or body can start with an overriding indicator. * par-ch6.adb (P_Subprogram): Recognize overriding indicator, and set flags accordingly on subrogram specifications or instances. * sem_ch8.adb: (Analyze_Subprogram_Renaming): For a renaming_as_body, verify that the overriding_indicator, if present, is consistent with status of spec. Improve error message for null-excluding checks on controlling access parameters. (Check_In_Previous_With_Clause): Protect the frontend against previously reported critical errors in the context clauses. Save and restore Ada_Version_Explicit, for implementation of AI-362 (Analyze_Subprogram_Renaming): If the new entity is a dispatching operation verify that controlling formals of the renamed entity that are access parameters are explicitly non-null. (Find_Expanded_Name): Improve error message when prefix is an illegal reference to a private child unit. * exp_imgv.adb, s-imgwch.ads, s-imgwch.adb, s-valwch.adb, s-valwch.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdwch.adb: Rewrite to correspond to new wide character names in AI-395 * par-ch12.adb (P_Formal_Subprogram_Declaration): Recognize null default procedures. From-SVN: r101029
2005-06-16 10:35:26 +02:00
-- DEFAULT_NAME ::= NAME | null
2001-10-02 16:23:52 +02:00
-- The caller has checked that the initial tokens are WITH FUNCTION or
-- WITH PROCEDURE, and the initial WITH has been scanned out.
a-secain.adb, [...]: Minor reformatting 2005-11-14 Robert Dewar <dewar@adacore.com> * a-secain.adb, a-slcain.adb, a-shcain.adb, a-chtgke.ads, a-chtgke.adb, a-stwiha.adb, a-strhas.adb, a-chzla1.ads, a-chzla9.ads, a-stzbou.adb, a-stzbou.ads, a-stzfix.adb, a-stzhas.adb, a-stzmap.adb, a-stzmap.ads, a-stzsea.adb, a-stzsea.ads, a-stzsup.adb, a-stzsup.ads, a-stzunb.adb, a-stzunb.ads, a-szuzha.adb, a-szuzha.ads, a-szuzti.adb, a-szuzti.ads, a-ztcoau.adb, a-ztcoau.ads, a-ztcoio.adb, a-ztcstr.adb, a-ztcstr.ads, a-ztdeau.adb, a-ztdeau.ads, a-ztdeio.adb, a-ztdeio.ads, a-ztedit.adb, a-ztedit.ads, a-ztenau.ads, a-ztenio.adb, a-ztenio.ads, a-ztexio.adb, a-ztexio.ads, a-ztfiio.adb, a-ztfiio.ads, a-ztflau.adb, a-ztflau.ads, a-ztflio.adb, a-ztflio.ads, a-ztgeau.adb, a-ztgeau.ads, a-ztinau.adb, a-ztinau.ads, a-ztinio.adb, a-ztmoau.ads, a-ztmoio.adb, a-ztmoio.ads, a-zttest.adb, g-enblsp-vms-alpha.adb, g-enblsp-vms-alpha.adb, g-enblsp-vms-ia64.adb, g-enblsp-vms-ia64.adb, system-linux-hppa.ads, a-chacon.adb, a-chacon.ads, a-wichun.adb, a-wichun.ads, a-zchuni.adb, a-zchuni.ads, g-trasym-vms-alpha.adb, g-trasym-vms-ia64.adb, system-hpux-ia64.ads, g-soccon-unixware.ads, g-soliop-unixware.ads, g-soccon-interix.ads, g-soliop-solaris.ads, g-eacodu-vms.adb, g-expect-vms.adb, g-socthi-vms.adb, g-soliop-mingw.ads, a-intnam-unixware.ads, a-intnam-lynxos.ads, a-intnam-tru64.ads, a-intnam-aix.ads, a-intnam-linux.ads, a-intnam-linux.ads, a-intnam-dummy.ads, a-numaux-libc-x86.ads, a-intnam-interix.ads, a-intnam-solaris.ads, a-calend-vms.adb, a-calend-vms.ads, a-intnam-vms.ads, a-calend-mingw.adb, a-intnam-mingw.ads, a-intnam-vxworks.ads, a-numaux-vxworks.ads, system-unixware.ads, system-linux-ia64.ads, a-intnam-freebsd.ads, system-freebsd-x86.ads, system-lynxos-ppc.ads, system-linux-x86_64.ads, a-stunha.adb, a-cgaaso.ads, a-cgaaso.adb, a-chtgop.adb, a-cgcaso.adb, a-cgarso.adb, a-cohata.ads, a-crbtgk.adb, a-crbltr.ads, a-coprnu.adb, a-rbtgso.adb, a-intnam-darwin.ads, system-darwin-ppc.ads, gprmake.adb, makegpr.ads, system-tru64.ads, system-aix.ads, system-solaris-x86.ads, system-irix-o32.ads, s-interr-sigaction.adb, system-irix-n32.ads, s-parame-mingw.adb, system-hpux.ads, s-traceb-hpux.adb, system-linux-x86.ads, s-inmaop-dummy.adb, system-os2.ads, system-interix.ads, system-solaris-sparc.ads, system-solaris-sparcv9.ads, s-inmaop-vms.adb, s-mastop-vms.adb, expander.adb, expander.ads, s-gloloc-mingw.adb, system-mingw.ads, system-vms-zcx.ads, s-osinte-fsu.adb, s-traceb-mastop.adb, a-exextr.adb, a-exstat.adb, a-filico.ads, a-finali.ads, a-interr.ads, a-intsig.adb, a-intsig.ads, a-except.ads, a-numaux-x86.ads, a-astaco.adb, a-calend.adb, a-calend.ads, a-chahan.adb, a-chahan.ads, a-chlat9.ads, a-colien.adb, a-colien.ads, a-colire.adb, a-colire.ads, a-comlin.adb, a-comlin.ads, a-cwila1.ads, a-cwila9.ads, a-elchha.adb, a-decima.adb, a-decima.ads, a-diocst.ads, a-direio.adb, a-direio.ads, a-excach.adb, a-excach.adb, a-exctra.ads, ali-util.adb, a-ngcefu.adb, a-ngcoty.adb, a-ngcoty.ads, a-nudira.adb, a-nudira.ads, a-nuflra.adb, a-numaux.ads, a-reatim.ads, a-sequio.adb, a-sequio.ads, a-siocst.ads, a-ssicst.ads, a-stmaco.ads, a-storio.adb, a-strbou.adb, a-strbou.ads, a-stream.ads, a-strfix.adb, a-strmap.adb, a-strmap.ads, a-strsea.adb, a-strsea.ads, a-strsup.adb, a-strsup.ads, a-strunb.adb, a-strunb.ads, a-stwibo.adb, a-stwibo.ads, a-stwifi.adb, a-stwima.adb, a-stwima.ads, a-stwise.adb, a-stwise.ads, a-stwisu.adb, a-stwisu.ads, a-stwiun.adb, a-stwiun.ads, a-suteio.adb, a-suteio.ads, a-swmwco.ads, a-swuwti.adb, a-swuwti.ads, a-sytaco.adb, a-sytaco.ads, a-tasatt.adb, a-taside.adb, a-taside.ads, a-teioed.adb, a-textio.adb, a-textio.ads, a-ticoau.adb, a-ticoau.ads, a-ticoio.adb, a-tideau.adb, a-tideio.adb, a-tienau.adb, a-tienio.adb, a-tifiio.adb, a-tiflio.adb, a-tigeau.adb, a-tigeau.ads, a-tiinau.adb, a-tiinio.adb, a-timoau.adb, a-timoio.adb, a-timoio.ads, a-tiocst.ads, a-titest.adb, atree.adb, a-witeio.adb, a-witeio.ads, a-wtcoau.adb, a-wtcoau.ads, a-wtcoio.adb, a-wtcstr.ads, a-wtdeau.adb, a-wtdeio.adb, a-wtedit.adb, a-wtedit.ads, a-wtenau.adb, a-wtenio.adb, a-wtfiio.adb, a-wtflio.adb, a-wtgeau.adb, a-wtinau.adb, a-wtinio.adb, a-wtmoau.adb, a-wtmoio.adb, a-wttest.adb, back_end.adb, bindgen.adb, butil.adb, butil.ads, checks.ads, cio.c, comperr.adb, csets.ads, cstand.adb, debug.ads, elists.ads, errno.c, errout.adb, errout.ads, erroutc.adb, erroutc.ads, errutil.adb, errutil.ads, errutil.ads, err_vars.ads, eval_fat.adb, exp_ch11.adb, exp_ch11.ads, exp_ch2.adb, exp_ch7.ads, exp_imgv.ads, exp_pakd.adb, exp_prag.adb, exp_prag.ads, exp_tss.adb, exp_tss.ads, exp_vfpt.ads, fe.h, fmap.adb, freeze.ads, frontend.adb, frontend.ads, g-arrspl.adb, g-arrspl.ads, g-awk.adb, g-awk.ads, g-boumai.ads, g-calend.adb, g-calend.ads, g-catiio.adb, g-comlin.adb, g-comlin.ads, g-comlin.ads, g-comlin.ads, g-comver.adb, g-crc32.adb, g-crc32.ads, g-ctrl_c.ads, g-curexc.ads, g-debpoo.ads, g-debuti.adb, g-diopit.adb, g-diopit.ads, g-dirope.adb, g-dirope.ads, g-dyntab.adb, g-dyntab.ads, g-excact.adb, g-excact.ads, g-except.ads, g-exctra.adb, g-exctra.ads, g-expect.ads, g-flocon.ads, g-hesorg.ads, g-io.adb, g-locfil.ads, g-md5.adb, g-md5.ads, g-md5.ads, g-moreex.adb, g-signal.ads, g-signal.adb, gnatbind.ads, gnatchop.adb, gnatcmd.adb, gnatfind.adb, gnatlbr.adb, gnatmake.ads, gnatmem.adb, gnatprep.adb, gnatprep.ads, gnatsym.adb, gnatxref.adb, g-os_lib.adb, g-os_lib.ads, g-pehage.adb, g-pehage.ads, gprep.ads, g-regexp.adb, g-regexp.ads, g-regist.adb, g-regist.ads, g-regpat.ads, g-semaph.adb, g-socthi.adb, g-soliop.ads, g-spipat.adb, g-spipat.ads, g-sptabo.ads, g-sptain.ads, g-sptavs.ads, g-string.ads, g-tasloc.adb, g-tasloc.ads, g-trasym.adb, g-trasym.ads, i-fortra.adb, i-fortra.ads, inline.adb, layout.adb, live.adb, make.ads, makeutl.ads, makeutl.adb, mdll-fil.adb, mdll-fil.ads, mdll-utl.ads, memroot.ads, memtrack.adb, mlib.ads, mlib-fil.adb, mlib-fil.ads, mlib-prj.ads, mlib-utl.adb, mlib-utl.ads, nlists.adb, nlists.ads, osint.adb, osint.ads, osint-c.adb, osint-l.adb, osint-l.ads, osint-m.ads, output.adb, par.adb, par.adb, par.ads, par-ch11.adb, par-ch12.adb, par-ch2.adb, par-ch4.adb, par-ch5.adb, par-ch6.adb, par-ch9.adb, par-endh.adb, par-labl.adb, par-load.adb, par-tchk.adb, prep.adb, prepcomp.adb, prepcomp.ads, prj-attr.ads, prj-com.ads, prj-dect.adb, prj-dect.ads, prj-env.ads, prj-err.ads, prj-ext.ads, prj-makr.adb, prj-makr.ads, prj-nmsc.ads, prj-pars.adb, prj-pars.ads, prj-part.ads, prj-pp.ads, prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-util.adb, prj-util.ads, rtsfind.adb, sem.adb, sem.ads, sem_case.adb, sem_case.ads, sem_ch11.adb, sem_ch4.adb, sem_ch6.ads, sem_ch7.ads, sem_dist.ads, sem_elab.ads, sem_elim.ads, sem_eval.ads, sem_intr.ads, sem_maps.adb, sem_maps.ads, sem_maps.ads, sem_res.ads, sem_type.ads, sfn_scan.adb, sfn_scan.ads, s-imgwch.ads, s-imgwiu.adb, s-imgwiu.ads, s-inmaop.ads, sinput.adb, sinput.ads, s-pack03.adb, s-pack03.ads, s-pack05.adb, s-pack05.ads, s-pack06.adb, s-pack06.ads, s-pack07.adb, s-pack07.ads, s-pack09.adb, s-pack09.ads, s-pack10.adb, s-pack10.ads, s-pack11.adb, s-pack11.ads, s-pack12.adb, s-pack12.ads, s-pack13.adb, s-pack13.ads, s-pack14.adb, s-pack14.ads, s-pack15.adb, s-pack15.ads, s-pack17.adb, s-pack17.ads, s-pack18.adb, s-pack18.ads, s-pack19.adb, s-pack19.ads, s-pack20.adb, s-pack20.ads, s-pack21.adb, s-pack21.ads, s-pack22.adb, s-pack22.ads, s-pack23.adb, s-pack23.ads, s-pack24.adb, s-pack24.ads, s-pack25.adb, s-pack25.ads, s-pack26.adb, s-pack26.ads, s-pack27.adb, s-pack27.ads, s-pack28.adb, s-pack28.ads, s-pack29.adb, s-pack29.ads, s-pack30.adb, s-pack30.ads, s-pack31.adb, s-pack31.ads, s-pack33.adb, s-pack33.ads, s-pack34.adb, s-pack34.ads, s-pack35.adb, s-pack35.ads, s-pack36.adb, s-pack36.ads, s-pack37.adb, s-pack37.ads, s-pack38.adb, s-pack38.ads, s-pack39.adb, s-pack39.ads, s-pack40.adb, s-pack40.ads, s-pack41.adb, s-pack41.ads, s-pack42.adb, s-pack42.ads, s-pack43.adb, s-pack43.ads, s-pack44.adb, s-pack44.ads, s-pack45.adb, s-pack45.ads, s-pack46.adb, s-pack46.ads, s-pack47.adb, s-pack47.ads, s-pack48.adb, s-pack48.ads, s-pack49.adb, s-pack49.ads, s-pack50.adb, s-pack50.ads, s-pack51.adb, s-pack51.ads, s-pack52.adb, s-pack52.ads, s-pack53.adb, s-pack53.ads, s-pack54.adb, s-pack54.ads, s-pack55.adb, s-pack55.ads, s-pack56.adb, s-pack56.ads, s-pack57.adb, s-pack57.ads, s-pack58.adb, s-pack58.ads, s-pack59.adb, s-pack59.ads, s-pack60.adb, s-pack60.adb, s-pack60.ads, s-pack61.adb, s-pack61.ads, s-pack62.adb, s-pack62.ads, s-pack63.adb, s-pack63.ads, s-parint.adb, s-parint.adb, s-parint.ads, sprint.ads, s-purexc.ads, s-restri.ads, s-restri.adb, s-scaval.adb, s-scaval.ads, s-secsta.adb, s-secsta.ads, s-sequio.adb, s-sequio.ads, stand.ads, s-tasuti.adb, s-traceb.adb, s-traceb.ads, stringt.adb, stringt.ads, styleg.ads, s-valboo.adb, s-valboo.ads, s-valcha.adb, s-valcha.ads, s-valdec.adb, s-valdec.ads, s-valint.adb, s-valint.ads, s-valint.ads, s-vallld.adb, s-vallld.ads, s-vallli.adb, s-vallli.ads, s-valllu.adb, s-valllu.ads, s-valrea.adb, s-valrea.ads, s-valuns.adb, s-valuns.ads, s-valuti.adb, s-valuti.ads, s-valwch.ads, s-veboop.adb, s-veboop.ads, s-vercon.adb, s-vercon.ads, s-wchcnv.adb, s-wchcnv.ads, s-wchcon.ads, s-wchjis.adb, s-wchjis.ads, s-wchstw.adb, s-wchstw.adb, s-wchstw.ads, s-wchwts.adb, s-wchwts.ads, s-widboo.adb, s-widboo.ads, s-widcha.adb, s-widcha.ads, s-widenu.adb, s-widenu.ads, s-widlli.adb, s-widlli.ads, s-widllu.adb, s-widllu.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, symbols.adb, symbols.ads, table.ads, targparm.adb, targparm.ads, tb-alvms.c, tb-alvxw.c, tbuild.adb, tree_io.ads, treepr.adb, treeprs.adt, ttypef.ads, ttypes.ads, types.adb, uintp.adb, uintp.ads, uname.ads, urealp.ads, usage.ads, validsw.ads, vxaddr2line.adb, widechar.adb, widechar.ads, xeinfo.adb, xnmake.adb, xref_lib.ads, xr_tabls.adb, xr_tabls.ads, xsinfo.adb, xtreeprs.adb, xsnames.adb, vms_conv.ads, vms_conv.adb, a-dirval.ads, a-dirval.adb, a-dirval-mingw.adb, a-direct.ads, a-direct.adb, indepsw.ads, prj-attr-pm.ads, system-linux-ppc.ads, a-numaux-darwin.ads, a-numaux-darwin.adb, a-swuwha.ads, a-stunha.ads: Minor reformatting From-SVN: r107016
2005-11-15 15:06:45 +01:00
-- A null default is an Ada 2005 feature
einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on anonymous access types... 2005-06-14 Ed Schonberg <schonberg@adacore.com> Javier Miranda <miranda@adacore.com> Thomas Quinot <quinot@adacore.com> Robert Dewar <dewar@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> Gary Dismukes <dismukes@adacore.com> * einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on anonymous access types, to indicate that the accessibility level of the type is determined by that of the enclosing declaration. (Has_Persistent_BSS): New flag (Set_Is_Primitive_Wrapper): Upgrade the barrier to allow the usage of this attribute with functions. (Is_Primitive_Wrapper): Remove the barrier. (Has_Specified_Stream_Input, Has_Specified_Stream_Output, Has_Specified_Stream_Read, Has_Specified_Stream_Write): New subprograms. (Set_Has_Specified_Stream_Input, Set_Has_Specified_Stream_Output, Set_Has_Specified_Stream_Read, Set_Has_Specified_Stream_Write): New subprograms. (Is_Pure_Unit_Access_Type): New flag (Abstract_Interfaces): Complete the assertion to cover all usages. (Set_Is_Interface): Complete the assertion to cover all usages. (Is_Primitive_Wrapper): New attribute. (Is_Obsolescent): Now applies to all entities (though it is only set for subprograms currently) New flag: Has_Constrained_Partial_View, to implemente Ada 2005 AI-363, which solves various problems concerning access subtypes. (Has_Persistent_BSS): New flag (Is_Primitive_Wrapper, Set_Primitive_Wrapper): Code cleanup. Remove these subprograms because this attribute is currently not used. New entity flags: Has_Specified_Stream_Input (Flag190) Has_Specified_Stream_Output (Flag191) Has_Specified_Stream_Read (Flag192) Has_Specified_Stream_Write (Flag193) Present in all type and subtype entities. Set for a given view if the corresponding stream-oriented attribute has been defined by an attribute definition clause. When such a clause occurs, a TSS is set on the underlying full view; the flags are used to track visibility of the attribute definition clause for partial or incomplete views. (Is_Pure_Unit_Access_Type): New flag Clarify use of Is_Internal. (Is_Primitive_Wrapper): New attribute present in primitive subprograms internally generated to wrap the invocation of tasks and protected types that implement interfaces. (Implementation_Base_Type): Documentation correction (Is_Obsolescent): Now applies to all entities (though it is only set for subprograms currently) New flag: Has_Constrained_Partial_View, to implement Ada 2005 AI-363, which solves various problems concerning access subtypes. * exp_ch9.adb (Type_Conformant_Parameters): Introduce mode conformance for examined parameters. Identify unequal parameter list lengths as non-conformant parameters. (Overriding_Possible): Do not check for "All" qualifier in declaration of controlling access parameter, following prescription of AI-404. (Build_Entry_Wrapper_Spec, Build_Entry_Wrapper_Body): New subprograms that build the procedure body that wraps an entry invocation (Build_Corresponding_Record, Build_Protected_Sub_Specification, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Expand_N_Task_Body, Expand_N_Task_Type_Declaration): Modified to give support to abstract interface types * freeze.adb (Freeze_Entity): Issue error message if Is_Pure_Unit_Access_Type set, unless we are in Ada 2005 mode and the type has no storage pool (Ada 2005) AI-366. Also modified to give support to abstract interface types (Freeze_Subprogram): Issue an error for a dispatching subprogram with an Inline_Always pragma. * par-ch9.adb (P_Task_Items): Reserved words "not" or "overriding" may now begin an entry declaration. (P_Entry_Or_Subprogram_With_Indicator): New procedure in P_Protected_Operation_Declaration_Opt. Parse an entry declaration or a subprogram declaration preceded by an overriding indicator. (P_Protected_Operation_Declaration_Opt): Add case for parsing entry declarations or subprogram declarations preceded by reserved words "not" or "overriding". (P_Entry_Declaration): Update comment. Parse and check overriding indicator, set semantic flags of entry declarations. (P_Task): New error message in case of private applied to a task type declaration. (P_Protected): New error message in case of private applied to a task type declaration. * sem_ch7.adb (Preserve_Full_Attributes): Modified to handle the case in which the full view of a type implementing an interface is a concurrent type. (Has_Overriding_Pragma): Remove obsolete implementation of AI-218. Declare_Inherited_Private_Subprograms): If an explicit operation overrides an operation that is inherited in the private part, mark the explicit one as overriding, to enable overriding indicator checks. (Preserve_Full_Attributes): Propagate Is_Unchecked_Union attribute from full view to partial view, to simplify handling in back-end. * sprint.adb: Print interface lists where needed: derived types, protected types, task types. output "is null" for null procedures. Part of implementation of * sem_cat.adb (Validate_Access_Type_Declaration): Implement AI-366 relaxation of rules for access types in pure, shared passive partitions. * exp_strm.adb (Build_Mutable_Record_Read_Procedure): Reorganize to first read discriminants into temporary objects, performing checks on the read values, then possibly performing discriminant checks on the actual (if it is constrained), and only finally reading the components into a constrained temporary object. (Build_Elementary_Input_Call): Adjust the specific circuitry for the case of reading discriminants of a mutable record type to recognize the new form of the code generated by Build_Mutable_Record_Read_Procedure. * exp_tss.ads, exp_tss.adb (Make_Init_Proc_Name): Reimplement in terms of a simple call to Make_TSS_Name. (Make_TSS_Name_Local): Add the TSS name as the last thing in the name buffer, in order for Is_TSS to work correctly on local TSS names. * sem_attr.ads, sem_attr.adb (Resolve_Attribute, case 'Access): Use flag Is_Local_Anonymous_Access to check legaliy of attributes in the context of access components and stand-alone access objects. (Stream_Attribute_Available): In Ada 95 mode, a stream attribute is treated as available for a limited private type if there is an attribute_definition_clause that applies to its full view, but not in other cases where the attribute is available for the full view (specifically, the sole fact that the full view is non-limited does not make the attribute available for the partial view). (Build_Access_Subprogram_Type): Diagnose attempt to apply 'access to a non-overloaded intrinsic subprogram. (Check_Stream_Attribute): Reject an attribute reference for an unavailable stream attribute even if the prefix is not a limited type (case of a 'Input attribute reference for an abstract, non-classwide type) (Stream_Attribute_Available): New function to determine whether a stream attribute is available at a place. (Check_Attribute): Use Stream_Attribute_Available instead of just testing for TSS presence on the implementation base type. (Analyze_Attribute): Modified to give support to task interfaces. (Analyze_Access_Attribute): Add error check for use of an Access (or Unrestricted_Access) attribute with a subprogram marked as Inline_Always. (Analyze_Attribute, case Attribute_Address): Add error check for use of an Address attribute with a subprogram marked as Inline_Always. Update Eval_Attribute to handle new value of Width from AI-395 * sem_ch13.adb (Analyze_Stream_TSS_Definition): New subprogram. (Analyze_Attribute_Definition_Clause, cases Input, Output, Read, Write): Factor common code across the stream-oriented attribute circcuits into a new subprogram, Analyze_Stream_TSS_Definition. The new uniform processing is functionally identical to the previous duplicated one, except that an expression that denotes an abstract subprogram will now be rejected, as mandated by AI-195 item 5. * sem_util.ads, sem_util.adb (Type_Access_Level): Use flag Is_Local_Anonymous_Access to apply accessibility checks to access components and stand-alone access objects. (Has_Discriminant_Dependent_Constraint): Moved to spec for use elsewhere. (Is_Potentially_Persistent_Type): New function (Is_Dependent_Component_Of_Mutable_Object): If the enclosing object is a heap-object whose type has a constrained partial view, the object is unconstrained and the component may depend on a discriminant, making its renaming illegal. * sinfo.ads, sinfo.adb (Must_Not_Override): Flag applicable to N_Entry_Declaration. (Must_Override): Flag applicable to N_Entry_Declaration. Indicate that interface_list can appear in single task and single protected declarations. Replace Is_Overriding and Not_Overriding with Must_Override and Must_Not_Override, to better express intent of AI. Is_Overriding, Not_Overriding: Ada2005 flags that indicate the presence of an overriding indicator in a subprogram or instance. Ada 2005 (AI-248) Null_Present can appear in a procedure specification. Add the overriding indicator [[not] overriding] construct to the following grammar productions: ENTRY_DECLARATION GENERIC_INSTANTIATION SUBPROGRAM_SPECIFICATION * par-ch10.adb (P_Compilation_Unit): Subprogram declaration or body can start with an overriding indicator. * par-ch6.adb (P_Subprogram): Recognize overriding indicator, and set flags accordingly on subrogram specifications or instances. * sem_ch8.adb: (Analyze_Subprogram_Renaming): For a renaming_as_body, verify that the overriding_indicator, if present, is consistent with status of spec. Improve error message for null-excluding checks on controlling access parameters. (Check_In_Previous_With_Clause): Protect the frontend against previously reported critical errors in the context clauses. Save and restore Ada_Version_Explicit, for implementation of AI-362 (Analyze_Subprogram_Renaming): If the new entity is a dispatching operation verify that controlling formals of the renamed entity that are access parameters are explicitly non-null. (Find_Expanded_Name): Improve error message when prefix is an illegal reference to a private child unit. * exp_imgv.adb, s-imgwch.ads, s-imgwch.adb, s-valwch.adb, s-valwch.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdwch.adb: Rewrite to correspond to new wide character names in AI-395 * par-ch12.adb (P_Formal_Subprogram_Declaration): Recognize null default procedures. From-SVN: r101029
2005-06-16 10:35:26 +02:00
2001-10-02 16:23:52 +02:00
-- Error recovery: cannot raise Error_Resync
function P_Formal_Subprogram_Declaration return Node_Id is
g-zstspl.ads: New file. 2005-02-09 Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Javier Miranda <miranda@adacore.com> Pascal Obry <obry@adacore.com> Ed Schonberg <schonberg@adacore.com> Doug Rupp <rupp@adacore.com> Gary Dismukes <dismukes@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * g-zstspl.ads: New file. * a-chahan.ads, a-chahan.adb: Add declarations from AI-285 * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in Ada 95 mode Add definition of Wide_Wide_Space for AI-285 * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new interface (to support Ada 95 and Ada 2005 units). Add Unbounded_IO files Add entries for Wide_Wide packages for AI-285 Add list of containers packages to Ada 2005 unit list * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to support new Unbounded_IO package cleanly. * g-utf_32.ads, g-utf_32.adb: New files. * Makefile.rtl: Add entry for g-utf_32 Add new files for Unbounded_IO Adjust make file for new AI-285 wide wide packages Add AI-302 containers to the run time. * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads, a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New subprograms for AI-301. * a-stwiun.adb, a-stwiun.ads: Minor reformatting. * a-stunau.ads: Minor comment correction * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes etc. Also extend Text_IO_Kludge to support Wide_Wide_Text_IO (Check_RPC): Update to match changes in expanded code. Clean up unused entity. * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String was not taken into account. This includes proper initialization with Normalize_Scalars. (Get_Simple_Init_Val): Major rewrite for initialize scalars and normalize scalars cases (particularly the latter) to do a better job of finding invalid representations. * s-scaval.ads, s-scaval.adb: Add values for zero invalid values * s-strops.ads, s-strops.adb: Remove string normalize routines, never used * exp_dist.adb: Add support for wide wide character type (Expand_Receiving_Stubs_Bodies): For a package declaration that has a private part, generate stub bodies at the end of the private part, not the visible part. (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for PolyORB support. (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and generic wrapper to execute final processing after completing the expansion of the RPC receiver for an RACW. * snames.h, snames.ads, snames.adb: Add definitions for wide_wide packages and attributes. (Preset_Names): Addition of the new reserved words of Ada 2005, that is interface, overriding and synchronized. (Get_Pragma_Id): Give support to the use of the new reserved word "interface" as a pragma name. (Is_Pragma_Name): Give support to the use of the new reserved word "interface" as a pragma name. (Preset_Names): Add stream_size string for the Stream_Size Ada2005 attribute implementation. * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity checks to entities that are output parameters of Asm operations. Handle the Stream_Size attribute. Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error for second parameter being 0.0. Add support for wide wide character type. (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute. * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb, s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support for wide wide character cases. * cstand.adb: Create entities for Wide_Wide_Character and Wide_Wide_String. * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in accordance with AI-258. Add new declarations for 16/32 bit C character types (Part of AI285) * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag (Obsolescent_Warning): New field (Rep_Clause): New local subprogram used to share code. Returns the rep clause for which the name is given in parameter. (Has_Stream_Size_Clause): New routine. (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause. (Address_Clause): Implementation is now using Rep_Clause. (Alignment_Clause): Idem. (Size_Clause): Idem. * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005 entity in non-Ada 2005 mode and generate warning. * par-prag.adb: Add handling of one argument form for pragma Ada_05. (Prag): Code cleanup. Remove old gnat pragma "overriding" * sem_prag.adb: Add handling of one argument form for pragma Ada_05 (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings on the named unit if the pragma is not in the current compilation unit, so that elaboration calls in the current unit can set up an elaboration dependency on the named unit, as needed. (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library subprogram as well as for subprograms declared within a package. (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT pragma overriding. * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched to z) to avoid some instances of duplication for Wide_Wide packages. * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide characters. * scn.adb: Char_Literal_Value field is now a Uint * scng.adb: Significant rewrite to handle new Ada 2005 features allowing wide and wide wide characters in program text, e.g. for identifiers, as described in AI-285. (Set_Reserved): New procedure, makes setting up keywords cleaner. (Initialize_Scanner): Register the new reserved words of Ada 2005. (Scan): Give support to the new reserved words. * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. (P_Pragma): Allow the use of the new reserved word "interface" as a pragma name. * gnatls.adb, gnatbind.adb, ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename identifiers named "interface" to "SAL_Interface". * bindgen.adb (Gen_Main_Ada): Add support for the new SEH (Structured Exception handling). (Gen_Main_C): Idem. * bindgen.adb: (Gen_Main_Ada): Set the default exit code if specified. (Gen_Main_C): Likewise. Part of *DC20-006. (Gen_Output_File_C): Remove redundant output of gnat_exit_status. Code cleanup. Rename identifiers named "interface" to "SAL_Interface" * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of new -Xnnn switch. * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that has a collision with the new Ada 2005 "interface" reserved word. * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. * scans.ads (Token_Type): Addition of the tokens corresponding to the new reserved words of Ada 2005: Tok_Interface, Tok_Overriding and Tok_Synchronized. * sem_res.adb (Resolve_Actuals): Change error messages to refer to "dispatching" rather than "primitive" operations, since dispatching calls are now allowed to abstract formal subprograms (which are not primitive). Char_Literal_Value field is now a Uint (Resolve_Slice): If the prefix is an access to an unconstrained array, compute the actual subtype of the designated object to impose the proper index constraints. (Resolve_Selected_Component): Do not insert an access check if the prefix is an access type: such a node is expanded into an explicit dereference, on which the access check is performed anyway. Removes expensive duplicate checks. (Resolve_Call): Use new flag Is_Obsolescent and field Obsolescent_Warning so that pragma Obsolescent works on library subprograms. Add support for wide wide character type (Resolve_Allocator): Replace the error message on wrong null-exclusion value by a warning message. (Resolve_Type_Conversion): If the mixed-mode expression is interpreted as fixed-point, and one of the operands is non-static and universal, it can only be an illegal exponentiation operation, in which case there is no real value to retrieve. * exp_strm.adb: Add support for wide wide character type (Build_Elementary_Input_Call): Compute the size of the stream element by querying the rep chain to find the Stream_Attribute attribute value. (Build_Elementary_Write_Call): Ditto. * sem_aggr.adb: Char_Literal_Value field is now a Uint Add support for wide wide character type Replace the error messages on wrong null-exclusion value by warnings as described in Ada 2005. (Resolve_Extension_Aggregate): Document the fact that the error message on class-wide expressions in extensions aggregates. * sem_case.adb: Add support for wide wide character type * sem_ch13.adb: Add support for wide wide character type (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute. * sem_ch3.adb: Add support for wide wide character type (Process_Subtype): If constraint is illegal for the type, set Ekind of now-useless Itype, to prevent cascaded errors on a compiler built without -gnatp. * sem_ch8.adb: Add with and use of Sem_Disp. (Analyze_Subprogram_Renaming): Replace unclean uses of Corresponding_Spec with Corresponding_Formal_Spec (and delete setting of Corresponding_Spec to Empty). (Attribute_Renaming): Replace use of Corresponding_Spec with Corresponding_ Formal_Spec and simplify condition. (Use_One_Package): Check that scope of homonym of identifier is defined, before checking whether it is a wrapper package. Add support for wide wide character type * sem_eval.adb: Add support for wide wide character type. (Eval_Arithmetic_Op): Check for compile time known signed integer overflow in the non-static case. (Subtypes_Statically_Match): A formal scalar type and its base type do not statically match. * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to "not in" for test of N_Formal_Subprogram_Declaration (which is now a subtype). (Unit_Declaration_Node): Ditto. (Is_Variable_Prefix): For the case of an indexed component whose prefix has a packed array type, the prefix has been rewritten into a type conversion. Determine variable-ness from the converted expression. Handle wide wide character cases. * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String * stringt.ads, stringt.adb: Handle full UTF-32 range. Remove ["0A"] from comment, since it can look like a line terminator. Currently we don't permit this, but this is under discussion by the ARG, and it is easy enough to use a different example. * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for handling UTF-32 encoding for wide wide character. Implement new brackets coding ["hhhhhhhh"] Add UTF-8 encodings for full UTF-32 range * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31 bit range Add full UTF-32 support. (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to notify that constraint error will be raised at run-time because a null value is assigned to a null-excluding object. Remove some obsolete declarations and make Char_Code unsigned. * a-except.adb (Rcheck_30): New subprogram. Addition of the message corresponding to CE_Null_Not_Allowed, and adjust the output of all the Rcheck subprograms. * checks.adb (Check_Null_Not_Allowed): Replace the error message on wrong null-exclusion value by a warning message. (Enable_Range_Check): Do range check if the prefix is an explicit dereference whose designated object is an unconstrained array. Current algorithm for removing duplicate checks is over-eager in this case. * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong null-exclusion value by a warning message * atree.h, atree.ads, atree.adb: Remove Char_Code field support completely. Add support for Uint2 field sem_ch2.adb, exp_ch11.adb, exp_dbug.adb, exp_prag.adb: Char_Literal_Value field is now a Uint. * exp_util.adb (Insert_Actions): Replace N_Formal_Subprogram_Declaration by N_Formal_{Abstract|Concrete}_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function defined for subprogram renaming declarations. When set, the field indicates the defining entity of a corresponding formal subprogram when the renaming corresponds to a formal subprogram association in an instantiation. (Set_Corresponding_Formal_Spec): New procedure to return Corresponding_Formal_Spec field. Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration (which is now a subtype). Char_Literal_Value field is now a Uint * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the pointer to the base of the dispatch table. Minor changes to comments. (Controlling_Type): New function for determining the tagged type associated with a tagged primitive subprogram. (Expand_Dispatching_Call): Add support for a controlling actual that is directly a value of type Ada.Tag rather than a tagged object. * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation describing the new layout. (Dispatch_Table): The expander computes the actual array size, allocates the Dispatch_Table record accordingly, and generates code that displaces the base of the record after the Typeinfo_Ptr component. The access to these components is done by means of local functions. (Offset_To_Top): New function. (Typeinfo_Ptr): New function. (Get_TSD): Modified to access the new position of the TSD. (Set_TSD): Modified to save the TSD in its new position. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the case of formal abstract subprograms. Add check and message for -gnat05. Update comments. * sem_ch12.adb: Add with and use for Sem_Disp. (Analyze_Associations): Minor change from "=" to "in" for use of N_Formal_Subtype_Declaration (which is now a subtype). (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of N_Formal_Subtype_Declaration (which is now a subtype). (Analyze_Formal_Subprogram): Add handling for N_Formal_Abstract_Subprogram, marking the formal as abstract and dispatching, setting the controlling status of the formal parameters and result, and issuing an error if there is no controlling type for the formal subprogram. (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec, which is an unclean use of that field, we set the new field Corresponding_Formal_Spec to make the formal subprogram available to processing in Analyze_Subprogram_Declaration. (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point, Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type Constrained, so that it is is does not statically match its anonymous base type. * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for abstract formal subprograms in error check for functions returning abstract types. Set scope of new designator for a parameterless subprogram, so that it is available when checking the body for nested subprograms, before full analysis of said body. (Analyze_Subprogram_Body): Warn on inlining bodies with nested subprogram only if inner one comes from source. (Analyze_Function_Call): If the call is given in object notation, the analysis of the name rewrites the node and analyzes it with the proper argument list. After analyzing the name, if the call has been rewritten and the result type is set, no further analysis is needed. (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype mark in function specification, in a context where the formals are visible and hide outer homographs. * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope as the tagged type for the cases of abstract formal subprograms and renamings of those. Clean up spec comments. (Check_Dispatching_Context): Add error message to indicate "abstract procedure", covering the case of a call to a formal abstract procedure that has statically tagged operands. (Check_Dispatching_Call): Check for the case of an actual given by a tag-indeterminate function call whose type is an ancestor of the containing call's associated tagged type. This situation can occur for inherited primitives with function defaults. In this case we use the tagged type's tag directly as the controlling argument for the calls. (Expand_Call): Name change on call to Expand_Dispatch_Call. * sprint.adb (Sprint_Node_Actual): Split N_Formal_Subprogram_Declaration into two alternatives for the new cases N_Formal_Abstract_Subprogram_Declaration and N_Formal_Concrete_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * trans.c: Get rid of junk Uint2 reference. Char_Literal_Value field is now a Uint. (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P. (gigi): Correct third arg to gimplify_body. * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag. (TYPE_LANG_FLAG_0): Check for record or union. * treepr.adb: Char_Literal_Value field is now a Uint * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and UI_From_CC. * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function Add full UTF-32 support Char_Code is now 32 bits * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with wide character UTF_32 line terminators. Initialize Main_Source_File to avoid error when no main source is loaded. * errout.adb (Finalize): Do not check Num_SRef_Pragmas (Main_Source_File) when no main source has been loaded, to avoid potential crash. From-SVN: r94809
2005-02-10 14:50:48 +01:00
Prev_Sloc : constant Source_Ptr := Prev_Token_Ptr;
Spec_Node : constant Node_Id := P_Subprogram_Specification;
Def_Node : Node_Id;
2001-10-02 16:23:52 +02:00
begin
if Token = Tok_Is then
T_Is; -- past IS, skip extra IS or ";"
g-zstspl.ads: New file. 2005-02-09 Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Javier Miranda <miranda@adacore.com> Pascal Obry <obry@adacore.com> Ed Schonberg <schonberg@adacore.com> Doug Rupp <rupp@adacore.com> Gary Dismukes <dismukes@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * g-zstspl.ads: New file. * a-chahan.ads, a-chahan.adb: Add declarations from AI-285 * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in Ada 95 mode Add definition of Wide_Wide_Space for AI-285 * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new interface (to support Ada 95 and Ada 2005 units). Add Unbounded_IO files Add entries for Wide_Wide packages for AI-285 Add list of containers packages to Ada 2005 unit list * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to support new Unbounded_IO package cleanly. * g-utf_32.ads, g-utf_32.adb: New files. * Makefile.rtl: Add entry for g-utf_32 Add new files for Unbounded_IO Adjust make file for new AI-285 wide wide packages Add AI-302 containers to the run time. * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads, a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New subprograms for AI-301. * a-stwiun.adb, a-stwiun.ads: Minor reformatting. * a-stunau.ads: Minor comment correction * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes etc. Also extend Text_IO_Kludge to support Wide_Wide_Text_IO (Check_RPC): Update to match changes in expanded code. Clean up unused entity. * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String was not taken into account. This includes proper initialization with Normalize_Scalars. (Get_Simple_Init_Val): Major rewrite for initialize scalars and normalize scalars cases (particularly the latter) to do a better job of finding invalid representations. * s-scaval.ads, s-scaval.adb: Add values for zero invalid values * s-strops.ads, s-strops.adb: Remove string normalize routines, never used * exp_dist.adb: Add support for wide wide character type (Expand_Receiving_Stubs_Bodies): For a package declaration that has a private part, generate stub bodies at the end of the private part, not the visible part. (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for PolyORB support. (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and generic wrapper to execute final processing after completing the expansion of the RPC receiver for an RACW. * snames.h, snames.ads, snames.adb: Add definitions for wide_wide packages and attributes. (Preset_Names): Addition of the new reserved words of Ada 2005, that is interface, overriding and synchronized. (Get_Pragma_Id): Give support to the use of the new reserved word "interface" as a pragma name. (Is_Pragma_Name): Give support to the use of the new reserved word "interface" as a pragma name. (Preset_Names): Add stream_size string for the Stream_Size Ada2005 attribute implementation. * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity checks to entities that are output parameters of Asm operations. Handle the Stream_Size attribute. Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error for second parameter being 0.0. Add support for wide wide character type. (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute. * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb, s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support for wide wide character cases. * cstand.adb: Create entities for Wide_Wide_Character and Wide_Wide_String. * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in accordance with AI-258. Add new declarations for 16/32 bit C character types (Part of AI285) * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag (Obsolescent_Warning): New field (Rep_Clause): New local subprogram used to share code. Returns the rep clause for which the name is given in parameter. (Has_Stream_Size_Clause): New routine. (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause. (Address_Clause): Implementation is now using Rep_Clause. (Alignment_Clause): Idem. (Size_Clause): Idem. * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005 entity in non-Ada 2005 mode and generate warning. * par-prag.adb: Add handling of one argument form for pragma Ada_05. (Prag): Code cleanup. Remove old gnat pragma "overriding" * sem_prag.adb: Add handling of one argument form for pragma Ada_05 (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings on the named unit if the pragma is not in the current compilation unit, so that elaboration calls in the current unit can set up an elaboration dependency on the named unit, as needed. (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library subprogram as well as for subprograms declared within a package. (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT pragma overriding. * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched to z) to avoid some instances of duplication for Wide_Wide packages. * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide characters. * scn.adb: Char_Literal_Value field is now a Uint * scng.adb: Significant rewrite to handle new Ada 2005 features allowing wide and wide wide characters in program text, e.g. for identifiers, as described in AI-285. (Set_Reserved): New procedure, makes setting up keywords cleaner. (Initialize_Scanner): Register the new reserved words of Ada 2005. (Scan): Give support to the new reserved words. * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. (P_Pragma): Allow the use of the new reserved word "interface" as a pragma name. * gnatls.adb, gnatbind.adb, ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename identifiers named "interface" to "SAL_Interface". * bindgen.adb (Gen_Main_Ada): Add support for the new SEH (Structured Exception handling). (Gen_Main_C): Idem. * bindgen.adb: (Gen_Main_Ada): Set the default exit code if specified. (Gen_Main_C): Likewise. Part of *DC20-006. (Gen_Output_File_C): Remove redundant output of gnat_exit_status. Code cleanup. Rename identifiers named "interface" to "SAL_Interface" * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of new -Xnnn switch. * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that has a collision with the new Ada 2005 "interface" reserved word. * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. * scans.ads (Token_Type): Addition of the tokens corresponding to the new reserved words of Ada 2005: Tok_Interface, Tok_Overriding and Tok_Synchronized. * sem_res.adb (Resolve_Actuals): Change error messages to refer to "dispatching" rather than "primitive" operations, since dispatching calls are now allowed to abstract formal subprograms (which are not primitive). Char_Literal_Value field is now a Uint (Resolve_Slice): If the prefix is an access to an unconstrained array, compute the actual subtype of the designated object to impose the proper index constraints. (Resolve_Selected_Component): Do not insert an access check if the prefix is an access type: such a node is expanded into an explicit dereference, on which the access check is performed anyway. Removes expensive duplicate checks. (Resolve_Call): Use new flag Is_Obsolescent and field Obsolescent_Warning so that pragma Obsolescent works on library subprograms. Add support for wide wide character type (Resolve_Allocator): Replace the error message on wrong null-exclusion value by a warning message. (Resolve_Type_Conversion): If the mixed-mode expression is interpreted as fixed-point, and one of the operands is non-static and universal, it can only be an illegal exponentiation operation, in which case there is no real value to retrieve. * exp_strm.adb: Add support for wide wide character type (Build_Elementary_Input_Call): Compute the size of the stream element by querying the rep chain to find the Stream_Attribute attribute value. (Build_Elementary_Write_Call): Ditto. * sem_aggr.adb: Char_Literal_Value field is now a Uint Add support for wide wide character type Replace the error messages on wrong null-exclusion value by warnings as described in Ada 2005. (Resolve_Extension_Aggregate): Document the fact that the error message on class-wide expressions in extensions aggregates. * sem_case.adb: Add support for wide wide character type * sem_ch13.adb: Add support for wide wide character type (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute. * sem_ch3.adb: Add support for wide wide character type (Process_Subtype): If constraint is illegal for the type, set Ekind of now-useless Itype, to prevent cascaded errors on a compiler built without -gnatp. * sem_ch8.adb: Add with and use of Sem_Disp. (Analyze_Subprogram_Renaming): Replace unclean uses of Corresponding_Spec with Corresponding_Formal_Spec (and delete setting of Corresponding_Spec to Empty). (Attribute_Renaming): Replace use of Corresponding_Spec with Corresponding_ Formal_Spec and simplify condition. (Use_One_Package): Check that scope of homonym of identifier is defined, before checking whether it is a wrapper package. Add support for wide wide character type * sem_eval.adb: Add support for wide wide character type. (Eval_Arithmetic_Op): Check for compile time known signed integer overflow in the non-static case. (Subtypes_Statically_Match): A formal scalar type and its base type do not statically match. * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to "not in" for test of N_Formal_Subprogram_Declaration (which is now a subtype). (Unit_Declaration_Node): Ditto. (Is_Variable_Prefix): For the case of an indexed component whose prefix has a packed array type, the prefix has been rewritten into a type conversion. Determine variable-ness from the converted expression. Handle wide wide character cases. * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String * stringt.ads, stringt.adb: Handle full UTF-32 range. Remove ["0A"] from comment, since it can look like a line terminator. Currently we don't permit this, but this is under discussion by the ARG, and it is easy enough to use a different example. * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for handling UTF-32 encoding for wide wide character. Implement new brackets coding ["hhhhhhhh"] Add UTF-8 encodings for full UTF-32 range * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31 bit range Add full UTF-32 support. (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to notify that constraint error will be raised at run-time because a null value is assigned to a null-excluding object. Remove some obsolete declarations and make Char_Code unsigned. * a-except.adb (Rcheck_30): New subprogram. Addition of the message corresponding to CE_Null_Not_Allowed, and adjust the output of all the Rcheck subprograms. * checks.adb (Check_Null_Not_Allowed): Replace the error message on wrong null-exclusion value by a warning message. (Enable_Range_Check): Do range check if the prefix is an explicit dereference whose designated object is an unconstrained array. Current algorithm for removing duplicate checks is over-eager in this case. * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong null-exclusion value by a warning message * atree.h, atree.ads, atree.adb: Remove Char_Code field support completely. Add support for Uint2 field sem_ch2.adb, exp_ch11.adb, exp_dbug.adb, exp_prag.adb: Char_Literal_Value field is now a Uint. * exp_util.adb (Insert_Actions): Replace N_Formal_Subprogram_Declaration by N_Formal_{Abstract|Concrete}_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function defined for subprogram renaming declarations. When set, the field indicates the defining entity of a corresponding formal subprogram when the renaming corresponds to a formal subprogram association in an instantiation. (Set_Corresponding_Formal_Spec): New procedure to return Corresponding_Formal_Spec field. Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration (which is now a subtype). Char_Literal_Value field is now a Uint * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the pointer to the base of the dispatch table. Minor changes to comments. (Controlling_Type): New function for determining the tagged type associated with a tagged primitive subprogram. (Expand_Dispatching_Call): Add support for a controlling actual that is directly a value of type Ada.Tag rather than a tagged object. * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation describing the new layout. (Dispatch_Table): The expander computes the actual array size, allocates the Dispatch_Table record accordingly, and generates code that displaces the base of the record after the Typeinfo_Ptr component. The access to these components is done by means of local functions. (Offset_To_Top): New function. (Typeinfo_Ptr): New function. (Get_TSD): Modified to access the new position of the TSD. (Set_TSD): Modified to save the TSD in its new position. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the case of formal abstract subprograms. Add check and message for -gnat05. Update comments. * sem_ch12.adb: Add with and use for Sem_Disp. (Analyze_Associations): Minor change from "=" to "in" for use of N_Formal_Subtype_Declaration (which is now a subtype). (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of N_Formal_Subtype_Declaration (which is now a subtype). (Analyze_Formal_Subprogram): Add handling for N_Formal_Abstract_Subprogram, marking the formal as abstract and dispatching, setting the controlling status of the formal parameters and result, and issuing an error if there is no controlling type for the formal subprogram. (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec, which is an unclean use of that field, we set the new field Corresponding_Formal_Spec to make the formal subprogram available to processing in Analyze_Subprogram_Declaration. (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point, Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type Constrained, so that it is is does not statically match its anonymous base type. * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for abstract formal subprograms in error check for functions returning abstract types. Set scope of new designator for a parameterless subprogram, so that it is available when checking the body for nested subprograms, before full analysis of said body. (Analyze_Subprogram_Body): Warn on inlining bodies with nested subprogram only if inner one comes from source. (Analyze_Function_Call): If the call is given in object notation, the analysis of the name rewrites the node and analyzes it with the proper argument list. After analyzing the name, if the call has been rewritten and the result type is set, no further analysis is needed. (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype mark in function specification, in a context where the formals are visible and hide outer homographs. * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope as the tagged type for the cases of abstract formal subprograms and renamings of those. Clean up spec comments. (Check_Dispatching_Context): Add error message to indicate "abstract procedure", covering the case of a call to a formal abstract procedure that has statically tagged operands. (Check_Dispatching_Call): Check for the case of an actual given by a tag-indeterminate function call whose type is an ancestor of the containing call's associated tagged type. This situation can occur for inherited primitives with function defaults. In this case we use the tagged type's tag directly as the controlling argument for the calls. (Expand_Call): Name change on call to Expand_Dispatch_Call. * sprint.adb (Sprint_Node_Actual): Split N_Formal_Subprogram_Declaration into two alternatives for the new cases N_Formal_Abstract_Subprogram_Declaration and N_Formal_Concrete_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * trans.c: Get rid of junk Uint2 reference. Char_Literal_Value field is now a Uint. (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P. (gigi): Correct third arg to gimplify_body. * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag. (TYPE_LANG_FLAG_0): Check for record or union. * treepr.adb: Char_Literal_Value field is now a Uint * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and UI_From_CC. * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function Add full UTF-32 support Char_Code is now 32 bits * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with wide character UTF_32 line terminators. Initialize Main_Source_File to avoid error when no main source is loaded. * errout.adb (Finalize): Do not check Num_SRef_Pragmas (Main_Source_File) when no main source has been loaded, to avoid potential crash. From-SVN: r94809
2005-02-10 14:50:48 +01:00
if Token = Tok_Abstract then
Def_Node :=
New_Node (N_Formal_Abstract_Subprogram_Declaration, Prev_Sloc);
Scan; -- past ABSTRACT
if Ada_Version < Ada_2005 then
g-zstspl.ads: New file. 2005-02-09 Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Javier Miranda <miranda@adacore.com> Pascal Obry <obry@adacore.com> Ed Schonberg <schonberg@adacore.com> Doug Rupp <rupp@adacore.com> Gary Dismukes <dismukes@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * g-zstspl.ads: New file. * a-chahan.ads, a-chahan.adb: Add declarations from AI-285 * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in Ada 95 mode Add definition of Wide_Wide_Space for AI-285 * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new interface (to support Ada 95 and Ada 2005 units). Add Unbounded_IO files Add entries for Wide_Wide packages for AI-285 Add list of containers packages to Ada 2005 unit list * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to support new Unbounded_IO package cleanly. * g-utf_32.ads, g-utf_32.adb: New files. * Makefile.rtl: Add entry for g-utf_32 Add new files for Unbounded_IO Adjust make file for new AI-285 wide wide packages Add AI-302 containers to the run time. * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads, a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New subprograms for AI-301. * a-stwiun.adb, a-stwiun.ads: Minor reformatting. * a-stunau.ads: Minor comment correction * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes etc. Also extend Text_IO_Kludge to support Wide_Wide_Text_IO (Check_RPC): Update to match changes in expanded code. Clean up unused entity. * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String was not taken into account. This includes proper initialization with Normalize_Scalars. (Get_Simple_Init_Val): Major rewrite for initialize scalars and normalize scalars cases (particularly the latter) to do a better job of finding invalid representations. * s-scaval.ads, s-scaval.adb: Add values for zero invalid values * s-strops.ads, s-strops.adb: Remove string normalize routines, never used * exp_dist.adb: Add support for wide wide character type (Expand_Receiving_Stubs_Bodies): For a package declaration that has a private part, generate stub bodies at the end of the private part, not the visible part. (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for PolyORB support. (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and generic wrapper to execute final processing after completing the expansion of the RPC receiver for an RACW. * snames.h, snames.ads, snames.adb: Add definitions for wide_wide packages and attributes. (Preset_Names): Addition of the new reserved words of Ada 2005, that is interface, overriding and synchronized. (Get_Pragma_Id): Give support to the use of the new reserved word "interface" as a pragma name. (Is_Pragma_Name): Give support to the use of the new reserved word "interface" as a pragma name. (Preset_Names): Add stream_size string for the Stream_Size Ada2005 attribute implementation. * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity checks to entities that are output parameters of Asm operations. Handle the Stream_Size attribute. Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error for second parameter being 0.0. Add support for wide wide character type. (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute. * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb, s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support for wide wide character cases. * cstand.adb: Create entities for Wide_Wide_Character and Wide_Wide_String. * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in accordance with AI-258. Add new declarations for 16/32 bit C character types (Part of AI285) * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag (Obsolescent_Warning): New field (Rep_Clause): New local subprogram used to share code. Returns the rep clause for which the name is given in parameter. (Has_Stream_Size_Clause): New routine. (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause. (Address_Clause): Implementation is now using Rep_Clause. (Alignment_Clause): Idem. (Size_Clause): Idem. * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005 entity in non-Ada 2005 mode and generate warning. * par-prag.adb: Add handling of one argument form for pragma Ada_05. (Prag): Code cleanup. Remove old gnat pragma "overriding" * sem_prag.adb: Add handling of one argument form for pragma Ada_05 (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings on the named unit if the pragma is not in the current compilation unit, so that elaboration calls in the current unit can set up an elaboration dependency on the named unit, as needed. (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library subprogram as well as for subprograms declared within a package. (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT pragma overriding. * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched to z) to avoid some instances of duplication for Wide_Wide packages. * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide characters. * scn.adb: Char_Literal_Value field is now a Uint * scng.adb: Significant rewrite to handle new Ada 2005 features allowing wide and wide wide characters in program text, e.g. for identifiers, as described in AI-285. (Set_Reserved): New procedure, makes setting up keywords cleaner. (Initialize_Scanner): Register the new reserved words of Ada 2005. (Scan): Give support to the new reserved words. * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. (P_Pragma): Allow the use of the new reserved word "interface" as a pragma name. * gnatls.adb, gnatbind.adb, ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename identifiers named "interface" to "SAL_Interface". * bindgen.adb (Gen_Main_Ada): Add support for the new SEH (Structured Exception handling). (Gen_Main_C): Idem. * bindgen.adb: (Gen_Main_Ada): Set the default exit code if specified. (Gen_Main_C): Likewise. Part of *DC20-006. (Gen_Output_File_C): Remove redundant output of gnat_exit_status. Code cleanup. Rename identifiers named "interface" to "SAL_Interface" * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of new -Xnnn switch. * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that has a collision with the new Ada 2005 "interface" reserved word. * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. * scans.ads (Token_Type): Addition of the tokens corresponding to the new reserved words of Ada 2005: Tok_Interface, Tok_Overriding and Tok_Synchronized. * sem_res.adb (Resolve_Actuals): Change error messages to refer to "dispatching" rather than "primitive" operations, since dispatching calls are now allowed to abstract formal subprograms (which are not primitive). Char_Literal_Value field is now a Uint (Resolve_Slice): If the prefix is an access to an unconstrained array, compute the actual subtype of the designated object to impose the proper index constraints. (Resolve_Selected_Component): Do not insert an access check if the prefix is an access type: such a node is expanded into an explicit dereference, on which the access check is performed anyway. Removes expensive duplicate checks. (Resolve_Call): Use new flag Is_Obsolescent and field Obsolescent_Warning so that pragma Obsolescent works on library subprograms. Add support for wide wide character type (Resolve_Allocator): Replace the error message on wrong null-exclusion value by a warning message. (Resolve_Type_Conversion): If the mixed-mode expression is interpreted as fixed-point, and one of the operands is non-static and universal, it can only be an illegal exponentiation operation, in which case there is no real value to retrieve. * exp_strm.adb: Add support for wide wide character type (Build_Elementary_Input_Call): Compute the size of the stream element by querying the rep chain to find the Stream_Attribute attribute value. (Build_Elementary_Write_Call): Ditto. * sem_aggr.adb: Char_Literal_Value field is now a Uint Add support for wide wide character type Replace the error messages on wrong null-exclusion value by warnings as described in Ada 2005. (Resolve_Extension_Aggregate): Document the fact that the error message on class-wide expressions in extensions aggregates. * sem_case.adb: Add support for wide wide character type * sem_ch13.adb: Add support for wide wide character type (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute. * sem_ch3.adb: Add support for wide wide character type (Process_Subtype): If constraint is illegal for the type, set Ekind of now-useless Itype, to prevent cascaded errors on a compiler built without -gnatp. * sem_ch8.adb: Add with and use of Sem_Disp. (Analyze_Subprogram_Renaming): Replace unclean uses of Corresponding_Spec with Corresponding_Formal_Spec (and delete setting of Corresponding_Spec to Empty). (Attribute_Renaming): Replace use of Corresponding_Spec with Corresponding_ Formal_Spec and simplify condition. (Use_One_Package): Check that scope of homonym of identifier is defined, before checking whether it is a wrapper package. Add support for wide wide character type * sem_eval.adb: Add support for wide wide character type. (Eval_Arithmetic_Op): Check for compile time known signed integer overflow in the non-static case. (Subtypes_Statically_Match): A formal scalar type and its base type do not statically match. * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to "not in" for test of N_Formal_Subprogram_Declaration (which is now a subtype). (Unit_Declaration_Node): Ditto. (Is_Variable_Prefix): For the case of an indexed component whose prefix has a packed array type, the prefix has been rewritten into a type conversion. Determine variable-ness from the converted expression. Handle wide wide character cases. * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String * stringt.ads, stringt.adb: Handle full UTF-32 range. Remove ["0A"] from comment, since it can look like a line terminator. Currently we don't permit this, but this is under discussion by the ARG, and it is easy enough to use a different example. * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for handling UTF-32 encoding for wide wide character. Implement new brackets coding ["hhhhhhhh"] Add UTF-8 encodings for full UTF-32 range * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31 bit range Add full UTF-32 support. (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to notify that constraint error will be raised at run-time because a null value is assigned to a null-excluding object. Remove some obsolete declarations and make Char_Code unsigned. * a-except.adb (Rcheck_30): New subprogram. Addition of the message corresponding to CE_Null_Not_Allowed, and adjust the output of all the Rcheck subprograms. * checks.adb (Check_Null_Not_Allowed): Replace the error message on wrong null-exclusion value by a warning message. (Enable_Range_Check): Do range check if the prefix is an explicit dereference whose designated object is an unconstrained array. Current algorithm for removing duplicate checks is over-eager in this case. * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong null-exclusion value by a warning message * atree.h, atree.ads, atree.adb: Remove Char_Code field support completely. Add support for Uint2 field sem_ch2.adb, exp_ch11.adb, exp_dbug.adb, exp_prag.adb: Char_Literal_Value field is now a Uint. * exp_util.adb (Insert_Actions): Replace N_Formal_Subprogram_Declaration by N_Formal_{Abstract|Concrete}_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function defined for subprogram renaming declarations. When set, the field indicates the defining entity of a corresponding formal subprogram when the renaming corresponds to a formal subprogram association in an instantiation. (Set_Corresponding_Formal_Spec): New procedure to return Corresponding_Formal_Spec field. Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration (which is now a subtype). Char_Literal_Value field is now a Uint * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the pointer to the base of the dispatch table. Minor changes to comments. (Controlling_Type): New function for determining the tagged type associated with a tagged primitive subprogram. (Expand_Dispatching_Call): Add support for a controlling actual that is directly a value of type Ada.Tag rather than a tagged object. * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation describing the new layout. (Dispatch_Table): The expander computes the actual array size, allocates the Dispatch_Table record accordingly, and generates code that displaces the base of the record after the Typeinfo_Ptr component. The access to these components is done by means of local functions. (Offset_To_Top): New function. (Typeinfo_Ptr): New function. (Get_TSD): Modified to access the new position of the TSD. (Set_TSD): Modified to save the TSD in its new position. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the case of formal abstract subprograms. Add check and message for -gnat05. Update comments. * sem_ch12.adb: Add with and use for Sem_Disp. (Analyze_Associations): Minor change from "=" to "in" for use of N_Formal_Subtype_Declaration (which is now a subtype). (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of N_Formal_Subtype_Declaration (which is now a subtype). (Analyze_Formal_Subprogram): Add handling for N_Formal_Abstract_Subprogram, marking the formal as abstract and dispatching, setting the controlling status of the formal parameters and result, and issuing an error if there is no controlling type for the formal subprogram. (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec, which is an unclean use of that field, we set the new field Corresponding_Formal_Spec to make the formal subprogram available to processing in Analyze_Subprogram_Declaration. (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point, Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type Constrained, so that it is is does not statically match its anonymous base type. * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for abstract formal subprograms in error check for functions returning abstract types. Set scope of new designator for a parameterless subprogram, so that it is available when checking the body for nested subprograms, before full analysis of said body. (Analyze_Subprogram_Body): Warn on inlining bodies with nested subprogram only if inner one comes from source. (Analyze_Function_Call): If the call is given in object notation, the analysis of the name rewrites the node and analyzes it with the proper argument list. After analyzing the name, if the call has been rewritten and the result type is set, no further analysis is needed. (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype mark in function specification, in a context where the formals are visible and hide outer homographs. * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope as the tagged type for the cases of abstract formal subprograms and renamings of those. Clean up spec comments. (Check_Dispatching_Context): Add error message to indicate "abstract procedure", covering the case of a call to a formal abstract procedure that has statically tagged operands. (Check_Dispatching_Call): Check for the case of an actual given by a tag-indeterminate function call whose type is an ancestor of the containing call's associated tagged type. This situation can occur for inherited primitives with function defaults. In this case we use the tagged type's tag directly as the controlling argument for the calls. (Expand_Call): Name change on call to Expand_Dispatch_Call. * sprint.adb (Sprint_Node_Actual): Split N_Formal_Subprogram_Declaration into two alternatives for the new cases N_Formal_Abstract_Subprogram_Declaration and N_Formal_Concrete_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * trans.c: Get rid of junk Uint2 reference. Char_Literal_Value field is now a Uint. (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P. (gigi): Correct third arg to gimplify_body. * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag. (TYPE_LANG_FLAG_0): Check for record or union. * treepr.adb: Char_Literal_Value field is now a Uint * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and UI_From_CC. * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function Add full UTF-32 support Char_Code is now 32 bits * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with wide character UTF_32 line terminators. Initialize Main_Source_File to avoid error when no main source is loaded. * errout.adb (Finalize): Do not check Num_SRef_Pragmas (Main_Source_File) when no main source has been loaded, to avoid potential crash. From-SVN: r94809
2005-02-10 14:50:48 +01:00
Error_Msg_SP
("formal abstract subprograms are an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
else
Def_Node :=
New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
end if;
Set_Specification (Def_Node, Spec_Node);
if Token = Tok_Semicolon then
null;
elsif Aspect_Specifications_Present then
null;
g-zstspl.ads: New file. 2005-02-09 Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Javier Miranda <miranda@adacore.com> Pascal Obry <obry@adacore.com> Ed Schonberg <schonberg@adacore.com> Doug Rupp <rupp@adacore.com> Gary Dismukes <dismukes@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * g-zstspl.ads: New file. * a-chahan.ads, a-chahan.adb: Add declarations from AI-285 * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in Ada 95 mode Add definition of Wide_Wide_Space for AI-285 * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new interface (to support Ada 95 and Ada 2005 units). Add Unbounded_IO files Add entries for Wide_Wide packages for AI-285 Add list of containers packages to Ada 2005 unit list * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to support new Unbounded_IO package cleanly. * g-utf_32.ads, g-utf_32.adb: New files. * Makefile.rtl: Add entry for g-utf_32 Add new files for Unbounded_IO Adjust make file for new AI-285 wide wide packages Add AI-302 containers to the run time. * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads, a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New subprograms for AI-301. * a-stwiun.adb, a-stwiun.ads: Minor reformatting. * a-stunau.ads: Minor comment correction * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes etc. Also extend Text_IO_Kludge to support Wide_Wide_Text_IO (Check_RPC): Update to match changes in expanded code. Clean up unused entity. * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String was not taken into account. This includes proper initialization with Normalize_Scalars. (Get_Simple_Init_Val): Major rewrite for initialize scalars and normalize scalars cases (particularly the latter) to do a better job of finding invalid representations. * s-scaval.ads, s-scaval.adb: Add values for zero invalid values * s-strops.ads, s-strops.adb: Remove string normalize routines, never used * exp_dist.adb: Add support for wide wide character type (Expand_Receiving_Stubs_Bodies): For a package declaration that has a private part, generate stub bodies at the end of the private part, not the visible part. (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for PolyORB support. (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and generic wrapper to execute final processing after completing the expansion of the RPC receiver for an RACW. * snames.h, snames.ads, snames.adb: Add definitions for wide_wide packages and attributes. (Preset_Names): Addition of the new reserved words of Ada 2005, that is interface, overriding and synchronized. (Get_Pragma_Id): Give support to the use of the new reserved word "interface" as a pragma name. (Is_Pragma_Name): Give support to the use of the new reserved word "interface" as a pragma name. (Preset_Names): Add stream_size string for the Stream_Size Ada2005 attribute implementation. * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity checks to entities that are output parameters of Asm operations. Handle the Stream_Size attribute. Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error for second parameter being 0.0. Add support for wide wide character type. (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute. * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb, s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support for wide wide character cases. * cstand.adb: Create entities for Wide_Wide_Character and Wide_Wide_String. * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in accordance with AI-258. Add new declarations for 16/32 bit C character types (Part of AI285) * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag (Obsolescent_Warning): New field (Rep_Clause): New local subprogram used to share code. Returns the rep clause for which the name is given in parameter. (Has_Stream_Size_Clause): New routine. (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause. (Address_Clause): Implementation is now using Rep_Clause. (Alignment_Clause): Idem. (Size_Clause): Idem. * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005 entity in non-Ada 2005 mode and generate warning. * par-prag.adb: Add handling of one argument form for pragma Ada_05. (Prag): Code cleanup. Remove old gnat pragma "overriding" * sem_prag.adb: Add handling of one argument form for pragma Ada_05 (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings on the named unit if the pragma is not in the current compilation unit, so that elaboration calls in the current unit can set up an elaboration dependency on the named unit, as needed. (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library subprogram as well as for subprograms declared within a package. (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT pragma overriding. * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched to z) to avoid some instances of duplication for Wide_Wide packages. * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide characters. * scn.adb: Char_Literal_Value field is now a Uint * scng.adb: Significant rewrite to handle new Ada 2005 features allowing wide and wide wide characters in program text, e.g. for identifiers, as described in AI-285. (Set_Reserved): New procedure, makes setting up keywords cleaner. (Initialize_Scanner): Register the new reserved words of Ada 2005. (Scan): Give support to the new reserved words. * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. (P_Pragma): Allow the use of the new reserved word "interface" as a pragma name. * gnatls.adb, gnatbind.adb, ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename identifiers named "interface" to "SAL_Interface". * bindgen.adb (Gen_Main_Ada): Add support for the new SEH (Structured Exception handling). (Gen_Main_C): Idem. * bindgen.adb: (Gen_Main_Ada): Set the default exit code if specified. (Gen_Main_C): Likewise. Part of *DC20-006. (Gen_Output_File_C): Remove redundant output of gnat_exit_status. Code cleanup. Rename identifiers named "interface" to "SAL_Interface" * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of new -Xnnn switch. * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that has a collision with the new Ada 2005 "interface" reserved word. * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. * scans.ads (Token_Type): Addition of the tokens corresponding to the new reserved words of Ada 2005: Tok_Interface, Tok_Overriding and Tok_Synchronized. * sem_res.adb (Resolve_Actuals): Change error messages to refer to "dispatching" rather than "primitive" operations, since dispatching calls are now allowed to abstract formal subprograms (which are not primitive). Char_Literal_Value field is now a Uint (Resolve_Slice): If the prefix is an access to an unconstrained array, compute the actual subtype of the designated object to impose the proper index constraints. (Resolve_Selected_Component): Do not insert an access check if the prefix is an access type: such a node is expanded into an explicit dereference, on which the access check is performed anyway. Removes expensive duplicate checks. (Resolve_Call): Use new flag Is_Obsolescent and field Obsolescent_Warning so that pragma Obsolescent works on library subprograms. Add support for wide wide character type (Resolve_Allocator): Replace the error message on wrong null-exclusion value by a warning message. (Resolve_Type_Conversion): If the mixed-mode expression is interpreted as fixed-point, and one of the operands is non-static and universal, it can only be an illegal exponentiation operation, in which case there is no real value to retrieve. * exp_strm.adb: Add support for wide wide character type (Build_Elementary_Input_Call): Compute the size of the stream element by querying the rep chain to find the Stream_Attribute attribute value. (Build_Elementary_Write_Call): Ditto. * sem_aggr.adb: Char_Literal_Value field is now a Uint Add support for wide wide character type Replace the error messages on wrong null-exclusion value by warnings as described in Ada 2005. (Resolve_Extension_Aggregate): Document the fact that the error message on class-wide expressions in extensions aggregates. * sem_case.adb: Add support for wide wide character type * sem_ch13.adb: Add support for wide wide character type (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute. * sem_ch3.adb: Add support for wide wide character type (Process_Subtype): If constraint is illegal for the type, set Ekind of now-useless Itype, to prevent cascaded errors on a compiler built without -gnatp. * sem_ch8.adb: Add with and use of Sem_Disp. (Analyze_Subprogram_Renaming): Replace unclean uses of Corresponding_Spec with Corresponding_Formal_Spec (and delete setting of Corresponding_Spec to Empty). (Attribute_Renaming): Replace use of Corresponding_Spec with Corresponding_ Formal_Spec and simplify condition. (Use_One_Package): Check that scope of homonym of identifier is defined, before checking whether it is a wrapper package. Add support for wide wide character type * sem_eval.adb: Add support for wide wide character type. (Eval_Arithmetic_Op): Check for compile time known signed integer overflow in the non-static case. (Subtypes_Statically_Match): A formal scalar type and its base type do not statically match. * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to "not in" for test of N_Formal_Subprogram_Declaration (which is now a subtype). (Unit_Declaration_Node): Ditto. (Is_Variable_Prefix): For the case of an indexed component whose prefix has a packed array type, the prefix has been rewritten into a type conversion. Determine variable-ness from the converted expression. Handle wide wide character cases. * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String * stringt.ads, stringt.adb: Handle full UTF-32 range. Remove ["0A"] from comment, since it can look like a line terminator. Currently we don't permit this, but this is under discussion by the ARG, and it is easy enough to use a different example. * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for handling UTF-32 encoding for wide wide character. Implement new brackets coding ["hhhhhhhh"] Add UTF-8 encodings for full UTF-32 range * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31 bit range Add full UTF-32 support. (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to notify that constraint error will be raised at run-time because a null value is assigned to a null-excluding object. Remove some obsolete declarations and make Char_Code unsigned. * a-except.adb (Rcheck_30): New subprogram. Addition of the message corresponding to CE_Null_Not_Allowed, and adjust the output of all the Rcheck subprograms. * checks.adb (Check_Null_Not_Allowed): Replace the error message on wrong null-exclusion value by a warning message. (Enable_Range_Check): Do range check if the prefix is an explicit dereference whose designated object is an unconstrained array. Current algorithm for removing duplicate checks is over-eager in this case. * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong null-exclusion value by a warning message * atree.h, atree.ads, atree.adb: Remove Char_Code field support completely. Add support for Uint2 field sem_ch2.adb, exp_ch11.adb, exp_dbug.adb, exp_prag.adb: Char_Literal_Value field is now a Uint. * exp_util.adb (Insert_Actions): Replace N_Formal_Subprogram_Declaration by N_Formal_{Abstract|Concrete}_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function defined for subprogram renaming declarations. When set, the field indicates the defining entity of a corresponding formal subprogram when the renaming corresponds to a formal subprogram association in an instantiation. (Set_Corresponding_Formal_Spec): New procedure to return Corresponding_Formal_Spec field. Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration (which is now a subtype). Char_Literal_Value field is now a Uint * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the pointer to the base of the dispatch table. Minor changes to comments. (Controlling_Type): New function for determining the tagged type associated with a tagged primitive subprogram. (Expand_Dispatching_Call): Add support for a controlling actual that is directly a value of type Ada.Tag rather than a tagged object. * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation describing the new layout. (Dispatch_Table): The expander computes the actual array size, allocates the Dispatch_Table record accordingly, and generates code that displaces the base of the record after the Typeinfo_Ptr component. The access to these components is done by means of local functions. (Offset_To_Top): New function. (Typeinfo_Ptr): New function. (Get_TSD): Modified to access the new position of the TSD. (Set_TSD): Modified to save the TSD in its new position. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the case of formal abstract subprograms. Add check and message for -gnat05. Update comments. * sem_ch12.adb: Add with and use for Sem_Disp. (Analyze_Associations): Minor change from "=" to "in" for use of N_Formal_Subtype_Declaration (which is now a subtype). (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of N_Formal_Subtype_Declaration (which is now a subtype). (Analyze_Formal_Subprogram): Add handling for N_Formal_Abstract_Subprogram, marking the formal as abstract and dispatching, setting the controlling status of the formal parameters and result, and issuing an error if there is no controlling type for the formal subprogram. (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec, which is an unclean use of that field, we set the new field Corresponding_Formal_Spec to make the formal subprogram available to processing in Analyze_Subprogram_Declaration. (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point, Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type Constrained, so that it is is does not statically match its anonymous base type. * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for abstract formal subprograms in error check for functions returning abstract types. Set scope of new designator for a parameterless subprogram, so that it is available when checking the body for nested subprograms, before full analysis of said body. (Analyze_Subprogram_Body): Warn on inlining bodies with nested subprogram only if inner one comes from source. (Analyze_Function_Call): If the call is given in object notation, the analysis of the name rewrites the node and analyzes it with the proper argument list. After analyzing the name, if the call has been rewritten and the result type is set, no further analysis is needed. (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype mark in function specification, in a context where the formals are visible and hide outer homographs. * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope as the tagged type for the cases of abstract formal subprograms and renamings of those. Clean up spec comments. (Check_Dispatching_Context): Add error message to indicate "abstract procedure", covering the case of a call to a formal abstract procedure that has statically tagged operands. (Check_Dispatching_Call): Check for the case of an actual given by a tag-indeterminate function call whose type is an ancestor of the containing call's associated tagged type. This situation can occur for inherited primitives with function defaults. In this case we use the tagged type's tag directly as the controlling argument for the calls. (Expand_Call): Name change on call to Expand_Dispatch_Call. * sprint.adb (Sprint_Node_Actual): Split N_Formal_Subprogram_Declaration into two alternatives for the new cases N_Formal_Abstract_Subprogram_Declaration and N_Formal_Concrete_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * trans.c: Get rid of junk Uint2 reference. Char_Literal_Value field is now a Uint. (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P. (gigi): Correct third arg to gimplify_body. * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag. (TYPE_LANG_FLAG_0): Check for record or union. * treepr.adb: Char_Literal_Value field is now a Uint * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and UI_From_CC. * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function Add full UTF-32 support Char_Code is now 32 bits * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with wide character UTF_32 line terminators. Initialize Main_Source_File to avoid error when no main source is loaded. * errout.adb (Finalize): Do not check Num_SRef_Pragmas (Main_Source_File) when no main source has been loaded, to avoid potential crash. From-SVN: r94809
2005-02-10 14:50:48 +01:00
elsif Token = Tok_Box then
2001-10-02 16:23:52 +02:00
Set_Box_Present (Def_Node, True);
Scan; -- past <>
einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on anonymous access types... 2005-06-14 Ed Schonberg <schonberg@adacore.com> Javier Miranda <miranda@adacore.com> Thomas Quinot <quinot@adacore.com> Robert Dewar <dewar@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> Gary Dismukes <dismukes@adacore.com> * einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on anonymous access types, to indicate that the accessibility level of the type is determined by that of the enclosing declaration. (Has_Persistent_BSS): New flag (Set_Is_Primitive_Wrapper): Upgrade the barrier to allow the usage of this attribute with functions. (Is_Primitive_Wrapper): Remove the barrier. (Has_Specified_Stream_Input, Has_Specified_Stream_Output, Has_Specified_Stream_Read, Has_Specified_Stream_Write): New subprograms. (Set_Has_Specified_Stream_Input, Set_Has_Specified_Stream_Output, Set_Has_Specified_Stream_Read, Set_Has_Specified_Stream_Write): New subprograms. (Is_Pure_Unit_Access_Type): New flag (Abstract_Interfaces): Complete the assertion to cover all usages. (Set_Is_Interface): Complete the assertion to cover all usages. (Is_Primitive_Wrapper): New attribute. (Is_Obsolescent): Now applies to all entities (though it is only set for subprograms currently) New flag: Has_Constrained_Partial_View, to implemente Ada 2005 AI-363, which solves various problems concerning access subtypes. (Has_Persistent_BSS): New flag (Is_Primitive_Wrapper, Set_Primitive_Wrapper): Code cleanup. Remove these subprograms because this attribute is currently not used. New entity flags: Has_Specified_Stream_Input (Flag190) Has_Specified_Stream_Output (Flag191) Has_Specified_Stream_Read (Flag192) Has_Specified_Stream_Write (Flag193) Present in all type and subtype entities. Set for a given view if the corresponding stream-oriented attribute has been defined by an attribute definition clause. When such a clause occurs, a TSS is set on the underlying full view; the flags are used to track visibility of the attribute definition clause for partial or incomplete views. (Is_Pure_Unit_Access_Type): New flag Clarify use of Is_Internal. (Is_Primitive_Wrapper): New attribute present in primitive subprograms internally generated to wrap the invocation of tasks and protected types that implement interfaces. (Implementation_Base_Type): Documentation correction (Is_Obsolescent): Now applies to all entities (though it is only set for subprograms currently) New flag: Has_Constrained_Partial_View, to implement Ada 2005 AI-363, which solves various problems concerning access subtypes. * exp_ch9.adb (Type_Conformant_Parameters): Introduce mode conformance for examined parameters. Identify unequal parameter list lengths as non-conformant parameters. (Overriding_Possible): Do not check for "All" qualifier in declaration of controlling access parameter, following prescription of AI-404. (Build_Entry_Wrapper_Spec, Build_Entry_Wrapper_Body): New subprograms that build the procedure body that wraps an entry invocation (Build_Corresponding_Record, Build_Protected_Sub_Specification, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Expand_N_Task_Body, Expand_N_Task_Type_Declaration): Modified to give support to abstract interface types * freeze.adb (Freeze_Entity): Issue error message if Is_Pure_Unit_Access_Type set, unless we are in Ada 2005 mode and the type has no storage pool (Ada 2005) AI-366. Also modified to give support to abstract interface types (Freeze_Subprogram): Issue an error for a dispatching subprogram with an Inline_Always pragma. * par-ch9.adb (P_Task_Items): Reserved words "not" or "overriding" may now begin an entry declaration. (P_Entry_Or_Subprogram_With_Indicator): New procedure in P_Protected_Operation_Declaration_Opt. Parse an entry declaration or a subprogram declaration preceded by an overriding indicator. (P_Protected_Operation_Declaration_Opt): Add case for parsing entry declarations or subprogram declarations preceded by reserved words "not" or "overriding". (P_Entry_Declaration): Update comment. Parse and check overriding indicator, set semantic flags of entry declarations. (P_Task): New error message in case of private applied to a task type declaration. (P_Protected): New error message in case of private applied to a task type declaration. * sem_ch7.adb (Preserve_Full_Attributes): Modified to handle the case in which the full view of a type implementing an interface is a concurrent type. (Has_Overriding_Pragma): Remove obsolete implementation of AI-218. Declare_Inherited_Private_Subprograms): If an explicit operation overrides an operation that is inherited in the private part, mark the explicit one as overriding, to enable overriding indicator checks. (Preserve_Full_Attributes): Propagate Is_Unchecked_Union attribute from full view to partial view, to simplify handling in back-end. * sprint.adb: Print interface lists where needed: derived types, protected types, task types. output "is null" for null procedures. Part of implementation of * sem_cat.adb (Validate_Access_Type_Declaration): Implement AI-366 relaxation of rules for access types in pure, shared passive partitions. * exp_strm.adb (Build_Mutable_Record_Read_Procedure): Reorganize to first read discriminants into temporary objects, performing checks on the read values, then possibly performing discriminant checks on the actual (if it is constrained), and only finally reading the components into a constrained temporary object. (Build_Elementary_Input_Call): Adjust the specific circuitry for the case of reading discriminants of a mutable record type to recognize the new form of the code generated by Build_Mutable_Record_Read_Procedure. * exp_tss.ads, exp_tss.adb (Make_Init_Proc_Name): Reimplement in terms of a simple call to Make_TSS_Name. (Make_TSS_Name_Local): Add the TSS name as the last thing in the name buffer, in order for Is_TSS to work correctly on local TSS names. * sem_attr.ads, sem_attr.adb (Resolve_Attribute, case 'Access): Use flag Is_Local_Anonymous_Access to check legaliy of attributes in the context of access components and stand-alone access objects. (Stream_Attribute_Available): In Ada 95 mode, a stream attribute is treated as available for a limited private type if there is an attribute_definition_clause that applies to its full view, but not in other cases where the attribute is available for the full view (specifically, the sole fact that the full view is non-limited does not make the attribute available for the partial view). (Build_Access_Subprogram_Type): Diagnose attempt to apply 'access to a non-overloaded intrinsic subprogram. (Check_Stream_Attribute): Reject an attribute reference for an unavailable stream attribute even if the prefix is not a limited type (case of a 'Input attribute reference for an abstract, non-classwide type) (Stream_Attribute_Available): New function to determine whether a stream attribute is available at a place. (Check_Attribute): Use Stream_Attribute_Available instead of just testing for TSS presence on the implementation base type. (Analyze_Attribute): Modified to give support to task interfaces. (Analyze_Access_Attribute): Add error check for use of an Access (or Unrestricted_Access) attribute with a subprogram marked as Inline_Always. (Analyze_Attribute, case Attribute_Address): Add error check for use of an Address attribute with a subprogram marked as Inline_Always. Update Eval_Attribute to handle new value of Width from AI-395 * sem_ch13.adb (Analyze_Stream_TSS_Definition): New subprogram. (Analyze_Attribute_Definition_Clause, cases Input, Output, Read, Write): Factor common code across the stream-oriented attribute circcuits into a new subprogram, Analyze_Stream_TSS_Definition. The new uniform processing is functionally identical to the previous duplicated one, except that an expression that denotes an abstract subprogram will now be rejected, as mandated by AI-195 item 5. * sem_util.ads, sem_util.adb (Type_Access_Level): Use flag Is_Local_Anonymous_Access to apply accessibility checks to access components and stand-alone access objects. (Has_Discriminant_Dependent_Constraint): Moved to spec for use elsewhere. (Is_Potentially_Persistent_Type): New function (Is_Dependent_Component_Of_Mutable_Object): If the enclosing object is a heap-object whose type has a constrained partial view, the object is unconstrained and the component may depend on a discriminant, making its renaming illegal. * sinfo.ads, sinfo.adb (Must_Not_Override): Flag applicable to N_Entry_Declaration. (Must_Override): Flag applicable to N_Entry_Declaration. Indicate that interface_list can appear in single task and single protected declarations. Replace Is_Overriding and Not_Overriding with Must_Override and Must_Not_Override, to better express intent of AI. Is_Overriding, Not_Overriding: Ada2005 flags that indicate the presence of an overriding indicator in a subprogram or instance. Ada 2005 (AI-248) Null_Present can appear in a procedure specification. Add the overriding indicator [[not] overriding] construct to the following grammar productions: ENTRY_DECLARATION GENERIC_INSTANTIATION SUBPROGRAM_SPECIFICATION * par-ch10.adb (P_Compilation_Unit): Subprogram declaration or body can start with an overriding indicator. * par-ch6.adb (P_Subprogram): Recognize overriding indicator, and set flags accordingly on subrogram specifications or instances. * sem_ch8.adb: (Analyze_Subprogram_Renaming): For a renaming_as_body, verify that the overriding_indicator, if present, is consistent with status of spec. Improve error message for null-excluding checks on controlling access parameters. (Check_In_Previous_With_Clause): Protect the frontend against previously reported critical errors in the context clauses. Save and restore Ada_Version_Explicit, for implementation of AI-362 (Analyze_Subprogram_Renaming): If the new entity is a dispatching operation verify that controlling formals of the renamed entity that are access parameters are explicitly non-null. (Find_Expanded_Name): Improve error message when prefix is an illegal reference to a private child unit. * exp_imgv.adb, s-imgwch.ads, s-imgwch.adb, s-valwch.adb, s-valwch.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdwch.adb: Rewrite to correspond to new wide character names in AI-395 * par-ch12.adb (P_Formal_Subprogram_Declaration): Recognize null default procedures. From-SVN: r101029
2005-06-16 10:35:26 +02:00
elsif Token = Tok_Null then
if Ada_Version < Ada_2005 then
einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on anonymous access types... 2005-06-14 Ed Schonberg <schonberg@adacore.com> Javier Miranda <miranda@adacore.com> Thomas Quinot <quinot@adacore.com> Robert Dewar <dewar@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> Gary Dismukes <dismukes@adacore.com> * einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on anonymous access types, to indicate that the accessibility level of the type is determined by that of the enclosing declaration. (Has_Persistent_BSS): New flag (Set_Is_Primitive_Wrapper): Upgrade the barrier to allow the usage of this attribute with functions. (Is_Primitive_Wrapper): Remove the barrier. (Has_Specified_Stream_Input, Has_Specified_Stream_Output, Has_Specified_Stream_Read, Has_Specified_Stream_Write): New subprograms. (Set_Has_Specified_Stream_Input, Set_Has_Specified_Stream_Output, Set_Has_Specified_Stream_Read, Set_Has_Specified_Stream_Write): New subprograms. (Is_Pure_Unit_Access_Type): New flag (Abstract_Interfaces): Complete the assertion to cover all usages. (Set_Is_Interface): Complete the assertion to cover all usages. (Is_Primitive_Wrapper): New attribute. (Is_Obsolescent): Now applies to all entities (though it is only set for subprograms currently) New flag: Has_Constrained_Partial_View, to implemente Ada 2005 AI-363, which solves various problems concerning access subtypes. (Has_Persistent_BSS): New flag (Is_Primitive_Wrapper, Set_Primitive_Wrapper): Code cleanup. Remove these subprograms because this attribute is currently not used. New entity flags: Has_Specified_Stream_Input (Flag190) Has_Specified_Stream_Output (Flag191) Has_Specified_Stream_Read (Flag192) Has_Specified_Stream_Write (Flag193) Present in all type and subtype entities. Set for a given view if the corresponding stream-oriented attribute has been defined by an attribute definition clause. When such a clause occurs, a TSS is set on the underlying full view; the flags are used to track visibility of the attribute definition clause for partial or incomplete views. (Is_Pure_Unit_Access_Type): New flag Clarify use of Is_Internal. (Is_Primitive_Wrapper): New attribute present in primitive subprograms internally generated to wrap the invocation of tasks and protected types that implement interfaces. (Implementation_Base_Type): Documentation correction (Is_Obsolescent): Now applies to all entities (though it is only set for subprograms currently) New flag: Has_Constrained_Partial_View, to implement Ada 2005 AI-363, which solves various problems concerning access subtypes. * exp_ch9.adb (Type_Conformant_Parameters): Introduce mode conformance for examined parameters. Identify unequal parameter list lengths as non-conformant parameters. (Overriding_Possible): Do not check for "All" qualifier in declaration of controlling access parameter, following prescription of AI-404. (Build_Entry_Wrapper_Spec, Build_Entry_Wrapper_Body): New subprograms that build the procedure body that wraps an entry invocation (Build_Corresponding_Record, Build_Protected_Sub_Specification, Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration, Expand_N_Task_Body, Expand_N_Task_Type_Declaration): Modified to give support to abstract interface types * freeze.adb (Freeze_Entity): Issue error message if Is_Pure_Unit_Access_Type set, unless we are in Ada 2005 mode and the type has no storage pool (Ada 2005) AI-366. Also modified to give support to abstract interface types (Freeze_Subprogram): Issue an error for a dispatching subprogram with an Inline_Always pragma. * par-ch9.adb (P_Task_Items): Reserved words "not" or "overriding" may now begin an entry declaration. (P_Entry_Or_Subprogram_With_Indicator): New procedure in P_Protected_Operation_Declaration_Opt. Parse an entry declaration or a subprogram declaration preceded by an overriding indicator. (P_Protected_Operation_Declaration_Opt): Add case for parsing entry declarations or subprogram declarations preceded by reserved words "not" or "overriding". (P_Entry_Declaration): Update comment. Parse and check overriding indicator, set semantic flags of entry declarations. (P_Task): New error message in case of private applied to a task type declaration. (P_Protected): New error message in case of private applied to a task type declaration. * sem_ch7.adb (Preserve_Full_Attributes): Modified to handle the case in which the full view of a type implementing an interface is a concurrent type. (Has_Overriding_Pragma): Remove obsolete implementation of AI-218. Declare_Inherited_Private_Subprograms): If an explicit operation overrides an operation that is inherited in the private part, mark the explicit one as overriding, to enable overriding indicator checks. (Preserve_Full_Attributes): Propagate Is_Unchecked_Union attribute from full view to partial view, to simplify handling in back-end. * sprint.adb: Print interface lists where needed: derived types, protected types, task types. output "is null" for null procedures. Part of implementation of * sem_cat.adb (Validate_Access_Type_Declaration): Implement AI-366 relaxation of rules for access types in pure, shared passive partitions. * exp_strm.adb (Build_Mutable_Record_Read_Procedure): Reorganize to first read discriminants into temporary objects, performing checks on the read values, then possibly performing discriminant checks on the actual (if it is constrained), and only finally reading the components into a constrained temporary object. (Build_Elementary_Input_Call): Adjust the specific circuitry for the case of reading discriminants of a mutable record type to recognize the new form of the code generated by Build_Mutable_Record_Read_Procedure. * exp_tss.ads, exp_tss.adb (Make_Init_Proc_Name): Reimplement in terms of a simple call to Make_TSS_Name. (Make_TSS_Name_Local): Add the TSS name as the last thing in the name buffer, in order for Is_TSS to work correctly on local TSS names. * sem_attr.ads, sem_attr.adb (Resolve_Attribute, case 'Access): Use flag Is_Local_Anonymous_Access to check legaliy of attributes in the context of access components and stand-alone access objects. (Stream_Attribute_Available): In Ada 95 mode, a stream attribute is treated as available for a limited private type if there is an attribute_definition_clause that applies to its full view, but not in other cases where the attribute is available for the full view (specifically, the sole fact that the full view is non-limited does not make the attribute available for the partial view). (Build_Access_Subprogram_Type): Diagnose attempt to apply 'access to a non-overloaded intrinsic subprogram. (Check_Stream_Attribute): Reject an attribute reference for an unavailable stream attribute even if the prefix is not a limited type (case of a 'Input attribute reference for an abstract, non-classwide type) (Stream_Attribute_Available): New function to determine whether a stream attribute is available at a place. (Check_Attribute): Use Stream_Attribute_Available instead of just testing for TSS presence on the implementation base type. (Analyze_Attribute): Modified to give support to task interfaces. (Analyze_Access_Attribute): Add error check for use of an Access (or Unrestricted_Access) attribute with a subprogram marked as Inline_Always. (Analyze_Attribute, case Attribute_Address): Add error check for use of an Address attribute with a subprogram marked as Inline_Always. Update Eval_Attribute to handle new value of Width from AI-395 * sem_ch13.adb (Analyze_Stream_TSS_Definition): New subprogram. (Analyze_Attribute_Definition_Clause, cases Input, Output, Read, Write): Factor common code across the stream-oriented attribute circcuits into a new subprogram, Analyze_Stream_TSS_Definition. The new uniform processing is functionally identical to the previous duplicated one, except that an expression that denotes an abstract subprogram will now be rejected, as mandated by AI-195 item 5. * sem_util.ads, sem_util.adb (Type_Access_Level): Use flag Is_Local_Anonymous_Access to apply accessibility checks to access components and stand-alone access objects. (Has_Discriminant_Dependent_Constraint): Moved to spec for use elsewhere. (Is_Potentially_Persistent_Type): New function (Is_Dependent_Component_Of_Mutable_Object): If the enclosing object is a heap-object whose type has a constrained partial view, the object is unconstrained and the component may depend on a discriminant, making its renaming illegal. * sinfo.ads, sinfo.adb (Must_Not_Override): Flag applicable to N_Entry_Declaration. (Must_Override): Flag applicable to N_Entry_Declaration. Indicate that interface_list can appear in single task and single protected declarations. Replace Is_Overriding and Not_Overriding with Must_Override and Must_Not_Override, to better express intent of AI. Is_Overriding, Not_Overriding: Ada2005 flags that indicate the presence of an overriding indicator in a subprogram or instance. Ada 2005 (AI-248) Null_Present can appear in a procedure specification. Add the overriding indicator [[not] overriding] construct to the following grammar productions: ENTRY_DECLARATION GENERIC_INSTANTIATION SUBPROGRAM_SPECIFICATION * par-ch10.adb (P_Compilation_Unit): Subprogram declaration or body can start with an overriding indicator. * par-ch6.adb (P_Subprogram): Recognize overriding indicator, and set flags accordingly on subrogram specifications or instances. * sem_ch8.adb: (Analyze_Subprogram_Renaming): For a renaming_as_body, verify that the overriding_indicator, if present, is consistent with status of spec. Improve error message for null-excluding checks on controlling access parameters. (Check_In_Previous_With_Clause): Protect the frontend against previously reported critical errors in the context clauses. Save and restore Ada_Version_Explicit, for implementation of AI-362 (Analyze_Subprogram_Renaming): If the new entity is a dispatching operation verify that controlling formals of the renamed entity that are access parameters are explicitly non-null. (Find_Expanded_Name): Improve error message when prefix is an illegal reference to a private child unit. * exp_imgv.adb, s-imgwch.ads, s-imgwch.adb, s-valwch.adb, s-valwch.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdwch.adb: Rewrite to correspond to new wide character names in AI-395 * par-ch12.adb (P_Formal_Subprogram_Declaration): Recognize null default procedures. From-SVN: r101029
2005-06-16 10:35:26 +02:00
Error_Msg_SP
("null default subprograms are an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
if Nkind (Spec_Node) = N_Procedure_Specification then
Set_Null_Present (Spec_Node);
else
Error_Msg_SP ("only procedures can be null");
end if;
Scan; -- past NULL
2001-10-02 16:23:52 +02:00
else
Set_Default_Name (Def_Node, P_Name);
end if;
g-zstspl.ads: New file. 2005-02-09 Robert Dewar <dewar@adacore.com> Thomas Quinot <quinot@adacore.com> Javier Miranda <miranda@adacore.com> Pascal Obry <obry@adacore.com> Ed Schonberg <schonberg@adacore.com> Doug Rupp <rupp@adacore.com> Gary Dismukes <dismukes@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * g-zstspl.ads: New file. * a-chahan.ads, a-chahan.adb: Add declarations from AI-285 * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in Ada 95 mode Add definition of Wide_Wide_Space for AI-285 * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new interface (to support Ada 95 and Ada 2005 units). Add Unbounded_IO files Add entries for Wide_Wide packages for AI-285 Add list of containers packages to Ada 2005 unit list * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to support new Unbounded_IO package cleanly. * g-utf_32.ads, g-utf_32.adb: New files. * Makefile.rtl: Add entry for g-utf_32 Add new files for Unbounded_IO Adjust make file for new AI-285 wide wide packages Add AI-302 containers to the run time. * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads, a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New subprograms for AI-301. * a-stwiun.adb, a-stwiun.ads: Minor reformatting. * a-stunau.ads: Minor comment correction * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes etc. Also extend Text_IO_Kludge to support Wide_Wide_Text_IO (Check_RPC): Update to match changes in expanded code. Clean up unused entity. * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String was not taken into account. This includes proper initialization with Normalize_Scalars. (Get_Simple_Init_Val): Major rewrite for initialize scalars and normalize scalars cases (particularly the latter) to do a better job of finding invalid representations. * s-scaval.ads, s-scaval.adb: Add values for zero invalid values * s-strops.ads, s-strops.adb: Remove string normalize routines, never used * exp_dist.adb: Add support for wide wide character type (Expand_Receiving_Stubs_Bodies): For a package declaration that has a private part, generate stub bodies at the end of the private part, not the visible part. (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for PolyORB support. (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and generic wrapper to execute final processing after completing the expansion of the RPC receiver for an RACW. * snames.h, snames.ads, snames.adb: Add definitions for wide_wide packages and attributes. (Preset_Names): Addition of the new reserved words of Ada 2005, that is interface, overriding and synchronized. (Get_Pragma_Id): Give support to the use of the new reserved word "interface" as a pragma name. (Is_Pragma_Name): Give support to the use of the new reserved word "interface" as a pragma name. (Preset_Names): Add stream_size string for the Stream_Size Ada2005 attribute implementation. * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity checks to entities that are output parameters of Asm operations. Handle the Stream_Size attribute. Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error for second parameter being 0.0. Add support for wide wide character type. (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute. * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb, s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support for wide wide character cases. * cstand.adb: Create entities for Wide_Wide_Character and Wide_Wide_String. * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in accordance with AI-258. Add new declarations for 16/32 bit C character types (Part of AI285) * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag (Obsolescent_Warning): New field (Rep_Clause): New local subprogram used to share code. Returns the rep clause for which the name is given in parameter. (Has_Stream_Size_Clause): New routine. (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause. (Address_Clause): Implementation is now using Rep_Clause. (Alignment_Clause): Idem. (Size_Clause): Idem. * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005 entity in non-Ada 2005 mode and generate warning. * par-prag.adb: Add handling of one argument form for pragma Ada_05. (Prag): Code cleanup. Remove old gnat pragma "overriding" * sem_prag.adb: Add handling of one argument form for pragma Ada_05 (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings on the named unit if the pragma is not in the current compilation unit, so that elaboration calls in the current unit can set up an elaboration dependency on the named unit, as needed. (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library subprogram as well as for subprograms declared within a package. (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT pragma overriding. * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched to z) to avoid some instances of duplication for Wide_Wide packages. * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide characters. * scn.adb: Char_Literal_Value field is now a Uint * scng.adb: Significant rewrite to handle new Ada 2005 features allowing wide and wide wide characters in program text, e.g. for identifiers, as described in AI-285. (Set_Reserved): New procedure, makes setting up keywords cleaner. (Initialize_Scanner): Register the new reserved words of Ada 2005. (Scan): Give support to the new reserved words. * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. (P_Pragma): Allow the use of the new reserved word "interface" as a pragma name. * gnatls.adb, gnatbind.adb, ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename identifiers named "interface" to "SAL_Interface". * bindgen.adb (Gen_Main_Ada): Add support for the new SEH (Structured Exception handling). (Gen_Main_C): Idem. * bindgen.adb: (Gen_Main_Ada): Set the default exit code if specified. (Gen_Main_C): Likewise. Part of *DC20-006. (Gen_Output_File_C): Remove redundant output of gnat_exit_status. Code cleanup. Rename identifiers named "interface" to "SAL_Interface" * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of new -Xnnn switch. * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that has a collision with the new Ada 2005 "interface" reserved word. * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode, generate a warning notifying that interface, overriding, and synchronized are new reserved words. * scans.ads (Token_Type): Addition of the tokens corresponding to the new reserved words of Ada 2005: Tok_Interface, Tok_Overriding and Tok_Synchronized. * sem_res.adb (Resolve_Actuals): Change error messages to refer to "dispatching" rather than "primitive" operations, since dispatching calls are now allowed to abstract formal subprograms (which are not primitive). Char_Literal_Value field is now a Uint (Resolve_Slice): If the prefix is an access to an unconstrained array, compute the actual subtype of the designated object to impose the proper index constraints. (Resolve_Selected_Component): Do not insert an access check if the prefix is an access type: such a node is expanded into an explicit dereference, on which the access check is performed anyway. Removes expensive duplicate checks. (Resolve_Call): Use new flag Is_Obsolescent and field Obsolescent_Warning so that pragma Obsolescent works on library subprograms. Add support for wide wide character type (Resolve_Allocator): Replace the error message on wrong null-exclusion value by a warning message. (Resolve_Type_Conversion): If the mixed-mode expression is interpreted as fixed-point, and one of the operands is non-static and universal, it can only be an illegal exponentiation operation, in which case there is no real value to retrieve. * exp_strm.adb: Add support for wide wide character type (Build_Elementary_Input_Call): Compute the size of the stream element by querying the rep chain to find the Stream_Attribute attribute value. (Build_Elementary_Write_Call): Ditto. * sem_aggr.adb: Char_Literal_Value field is now a Uint Add support for wide wide character type Replace the error messages on wrong null-exclusion value by warnings as described in Ada 2005. (Resolve_Extension_Aggregate): Document the fact that the error message on class-wide expressions in extensions aggregates. * sem_case.adb: Add support for wide wide character type * sem_ch13.adb: Add support for wide wide character type (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute. * sem_ch3.adb: Add support for wide wide character type (Process_Subtype): If constraint is illegal for the type, set Ekind of now-useless Itype, to prevent cascaded errors on a compiler built without -gnatp. * sem_ch8.adb: Add with and use of Sem_Disp. (Analyze_Subprogram_Renaming): Replace unclean uses of Corresponding_Spec with Corresponding_Formal_Spec (and delete setting of Corresponding_Spec to Empty). (Attribute_Renaming): Replace use of Corresponding_Spec with Corresponding_ Formal_Spec and simplify condition. (Use_One_Package): Check that scope of homonym of identifier is defined, before checking whether it is a wrapper package. Add support for wide wide character type * sem_eval.adb: Add support for wide wide character type. (Eval_Arithmetic_Op): Check for compile time known signed integer overflow in the non-static case. (Subtypes_Statically_Match): A formal scalar type and its base type do not statically match. * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to "not in" for test of N_Formal_Subprogram_Declaration (which is now a subtype). (Unit_Declaration_Node): Ditto. (Is_Variable_Prefix): For the case of an indexed component whose prefix has a packed array type, the prefix has been rewritten into a type conversion. Determine variable-ness from the converted expression. Handle wide wide character cases. * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String * stringt.ads, stringt.adb: Handle full UTF-32 range. Remove ["0A"] from comment, since it can look like a line terminator. Currently we don't permit this, but this is under discussion by the ARG, and it is easy enough to use a different example. * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for handling UTF-32 encoding for wide wide character. Implement new brackets coding ["hhhhhhhh"] Add UTF-8 encodings for full UTF-32 range * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31 bit range Add full UTF-32 support. (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to notify that constraint error will be raised at run-time because a null value is assigned to a null-excluding object. Remove some obsolete declarations and make Char_Code unsigned. * a-except.adb (Rcheck_30): New subprogram. Addition of the message corresponding to CE_Null_Not_Allowed, and adjust the output of all the Rcheck subprograms. * checks.adb (Check_Null_Not_Allowed): Replace the error message on wrong null-exclusion value by a warning message. (Enable_Range_Check): Do range check if the prefix is an explicit dereference whose designated object is an unconstrained array. Current algorithm for removing duplicate checks is over-eager in this case. * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong null-exclusion value by a warning message * atree.h, atree.ads, atree.adb: Remove Char_Code field support completely. Add support for Uint2 field sem_ch2.adb, exp_ch11.adb, exp_dbug.adb, exp_prag.adb: Char_Literal_Value field is now a Uint. * exp_util.adb (Insert_Actions): Replace N_Formal_Subprogram_Declaration by N_Formal_{Abstract|Concrete}_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function defined for subprogram renaming declarations. When set, the field indicates the defining entity of a corresponding formal subprogram when the renaming corresponds to a formal subprogram association in an instantiation. (Set_Corresponding_Formal_Spec): New procedure to return Corresponding_Formal_Spec field. Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration (which is now a subtype). Char_Literal_Value field is now a Uint * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the pointer to the base of the dispatch table. Minor changes to comments. (Controlling_Type): New function for determining the tagged type associated with a tagged primitive subprogram. (Expand_Dispatching_Call): Add support for a controlling actual that is directly a value of type Ada.Tag rather than a tagged object. * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation describing the new layout. (Dispatch_Table): The expander computes the actual array size, allocates the Dispatch_Table record accordingly, and generates code that displaces the base of the record after the Typeinfo_Ptr component. The access to these components is done by means of local functions. (Offset_To_Top): New function. (Typeinfo_Ptr): New function. (Get_TSD): Modified to access the new position of the TSD. (Set_TSD): Modified to save the TSD in its new position. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the case of formal abstract subprograms. Add check and message for -gnat05. Update comments. * sem_ch12.adb: Add with and use for Sem_Disp. (Analyze_Associations): Minor change from "=" to "in" for use of N_Formal_Subtype_Declaration (which is now a subtype). (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of N_Formal_Subtype_Declaration (which is now a subtype). (Analyze_Formal_Subprogram): Add handling for N_Formal_Abstract_Subprogram, marking the formal as abstract and dispatching, setting the controlling status of the formal parameters and result, and issuing an error if there is no controlling type for the formal subprogram. (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec, which is an unclean use of that field, we set the new field Corresponding_Formal_Spec to make the formal subprogram available to processing in Analyze_Subprogram_Declaration. (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point, Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type Constrained, so that it is is does not statically match its anonymous base type. * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for abstract formal subprograms in error check for functions returning abstract types. Set scope of new designator for a parameterless subprogram, so that it is available when checking the body for nested subprograms, before full analysis of said body. (Analyze_Subprogram_Body): Warn on inlining bodies with nested subprogram only if inner one comes from source. (Analyze_Function_Call): If the call is given in object notation, the analysis of the name rewrites the node and analyzes it with the proper argument list. After analyzing the name, if the call has been rewritten and the result type is set, no further analysis is needed. (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype mark in function specification, in a context where the formals are visible and hide outer homographs. * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope as the tagged type for the cases of abstract formal subprograms and renamings of those. Clean up spec comments. (Check_Dispatching_Context): Add error message to indicate "abstract procedure", covering the case of a call to a formal abstract procedure that has statically tagged operands. (Check_Dispatching_Call): Check for the case of an actual given by a tag-indeterminate function call whose type is an ancestor of the containing call's associated tagged type. This situation can occur for inherited primitives with function defaults. In this case we use the tagged type's tag directly as the controlling argument for the calls. (Expand_Call): Name change on call to Expand_Dispatch_Call. * sprint.adb (Sprint_Node_Actual): Split N_Formal_Subprogram_Declaration into two alternatives for the new cases N_Formal_Abstract_Subprogram_Declaration and N_Formal_Concrete_Subprogram_Declaration. Char_Literal_Value field is now a Uint. * trans.c: Get rid of junk Uint2 reference. Char_Literal_Value field is now a Uint. (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P. (gigi): Correct third arg to gimplify_body. * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag. (TYPE_LANG_FLAG_0): Check for record or union. * treepr.adb: Char_Literal_Value field is now a Uint * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and UI_From_CC. * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function Add full UTF-32 support Char_Code is now 32 bits * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with wide character UTF_32 line terminators. Initialize Main_Source_File to avoid error when no main source is loaded. * errout.adb (Finalize): Do not check Num_SRef_Pragmas (Main_Source_File) when no main source has been loaded, to avoid potential crash. From-SVN: r94809
2005-02-10 14:50:48 +01:00
else
Def_Node :=
New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
Set_Specification (Def_Node, Spec_Node);
2001-10-02 16:23:52 +02:00
end if;
P_Aspect_Specifications (Def_Node);
2001-10-02 16:23:52 +02:00
return Def_Node;
end P_Formal_Subprogram_Declaration;
------------------------------
-- 12.6 Subprogram Default --
------------------------------
-- Parsed by P_Formal_Procedure_Declaration (12.6)
------------------------
-- 12.6 Default Name --
------------------------
-- Parsed by P_Formal_Procedure_Declaration (12.6)
--------------------------------------
-- 12.7 Formal Package Declaration --
--------------------------------------
-- FORMAL_PACKAGE_DECLARATION ::=
-- with package DEFINING_IDENTIFIER
-- is new generic_package_NAME FORMAL_PACKAGE_ACTUAL_PART
-- [ASPECT_SPECIFICATIONS];
2001-10-02 16:23:52 +02:00
-- FORMAL_PACKAGE_ACTUAL_PART ::=
-- ([OTHERS =>] <>) |
-- [GENERIC_ACTUAL_PART]
-- (FORMAL_PACKAGE_ASSOCIATION {, FORMAL_PACKAGE_ASSOCIATION}
-- [, OTHERS => <>)
-- FORMAL_PACKAGE_ASSOCIATION ::=
-- GENERIC_ASSOCIATION
-- | GENERIC_FORMAL_PARAMETER_SELECTOR_NAME => <>
2001-10-02 16:23:52 +02:00
-- The caller has checked that the initial tokens are WITH PACKAGE,
-- and the initial WITH has been scanned out (so Token = Tok_Package).
-- Error recovery: cannot raise Error_Resync
function P_Formal_Package_Declaration return Node_Id is
Def_Node : Node_Id;
Scan_State : Saved_Scan_State;
begin
Def_Node := New_Node (N_Formal_Package_Declaration, Prev_Token_Ptr);
Scan; -- past PACKAGE
Set_Defining_Identifier (Def_Node, P_Defining_Identifier (C_Is));
2001-10-02 16:23:52 +02:00
T_Is;
T_New;
Set_Name (Def_Node, P_Qualified_Simple_Name);
if Token = Tok_Left_Paren then
Save_Scan_State (Scan_State); -- at the left paren
Scan; -- past the left paren
if Token = Tok_Box then
Set_Box_Present (Def_Node, True);
Scan; -- past box
T_Right_Paren;
else
Restore_Scan_State (Scan_State); -- to the left paren
Set_Generic_Associations (Def_Node, P_Generic_Actual_Part_Opt);
end if;
end if;
P_Aspect_Specifications (Def_Node);
2001-10-02 16:23:52 +02:00
return Def_Node;
end P_Formal_Package_Declaration;
--------------------------------------
-- 12.7 Formal Package Actual Part --
--------------------------------------
-- Parsed by P_Formal_Package_Declaration (12.7)
end Ch12;