gcc/gcc/ada/impunit.adb

962 lines
38 KiB
Ada
Raw Normal View History

2001-10-02 16:18:40 +02:00
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- I M P U N I T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2000-2016, Free Software Foundation, Inc. --
2001-10-02 16:18:40 +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:18:40 +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:18:40 +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:18:40 +02:00
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Errout; use Errout;
with Sinfo; use Sinfo;
with Fname.UF; use Fname.UF;
with Lib; use Lib;
with Namet; use Namet;
with Opt; use Opt;
with Uname; use Uname;
2001-10-02 16:18:40 +02:00
-- Note: this package body is used by GPS and GNATBench to supply a list of
-- entries for help on available library routines.
2001-10-02 16:18:40 +02:00
package body Impunit is
subtype File_Name_8 is String (1 .. 8);
type File_Name_Record is record
Fname : File_Name_8;
-- 8 character name of unit
RMdef : Boolean;
-- True if unit is RM defined. False for any unit that is implementation
-- defined (and thus not with'able in No_Implementation_Units mode).
end record;
type File_List is array (Nat range <>) of File_Name_Record;
T : constant Boolean := True;
F : constant Boolean := False;
-- Short hand for RM_Defined values in lists below
2001-10-02 16:18:40 +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
------------------
-- Ada 95 Units --
------------------
2001-10-02 16:18:40 +02:00
-- The following is a giant string list containing the names of all non-
-- implementation internal files, i.e. the complete list of files for
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
-- internal units which a program may legitimately WITH when operating in
-- either Ada 95 or Ada 2005 mode.
2001-10-02 16:18:40 +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
-- Note that this list should match the list of units documented in the
-- "GNAT Library" section of the GNAT Reference Manual. A unit listed here
-- must either be documented in that section or described in the Ada RM.
2001-10-02 16:18:40 +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
Non_Imp_File_Names_95 : constant File_List := (
------------------------------------------------------
-- Ada Hierarchy Units from Ada-95 Reference Manual --
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:18:40 +02:00
("a-astaco", T), -- Ada.Asynchronous_Task_Control
("a-calend", T), -- Ada.Calendar
("a-chahan", T), -- Ada.Characters.Handling
("a-charac", T), -- Ada.Characters
("a-chlat1", T), -- Ada.Characters.Latin_1
("a-comlin", T), -- Ada.Command_Line
("a-decima", T), -- Ada.Decimal
("a-direio", T), -- Ada.Direct_IO
("a-dynpri", T), -- Ada.Dynamic_Priorities
("a-except", T), -- Ada.Exceptions
("a-finali", T), -- Ada.Finalization
("a-flteio", T), -- Ada.Float_Text_IO
("a-fwteio", T), -- Ada.Float_Wide_Text_IO
("a-inteio", T), -- Ada.Integer_Text_IO
("a-interr", T), -- Ada.Interrupts
("a-intnam", T), -- Ada.Interrupts.Names
("a-ioexce", T), -- Ada.IO_Exceptions
("a-iwteio", T), -- Ada.Integer_Wide_Text_IO
("a-ncelfu", T), -- Ada.Numerics.Complex_Elementary_Functions
("a-ngcefu", T), -- Ada.Numerics.Generic_Complex_Elementary_Functions
("a-ngcoty", T), -- Ada.Numerics.Generic_Complex_Types
("a-ngelfu", T), -- Ada.Numerics.Generic_Elementary_Functions
("a-nucoty", T), -- Ada.Numerics.Complex_Types
("a-nudira", T), -- Ada.Numerics.Discrete_Random
("a-nuelfu", T), -- Ada.Numerics.Elementary_Functions
("a-nuflra", T), -- Ada.Numerics.Float_Random
("a-numeri", T), -- Ada.Numerics
("a-reatim", T), -- Ada.Real_Time
("a-sequio", T), -- Ada.Sequential_IO
("a-stmaco", T), -- Ada.Strings.Maps.Constants
("a-storio", T), -- Ada.Storage_IO
("a-strbou", T), -- Ada.Strings.Bounded
("a-stream", T), -- Ada.Streams
("a-strfix", T), -- Ada.Strings.Fixed
("a-string", T), -- Ada.Strings
("a-strmap", T), -- Ada.Strings.Maps
("a-strunb", T), -- Ada.Strings.Unbounded
("a-ststio", T), -- Ada.Streams.Stream_IO
("a-stwibo", T), -- Ada.Strings.Wide_Bounded
("a-stwifi", T), -- Ada.Strings.Wide_Fixed
("a-stwima", T), -- Ada.Strings.Wide_Maps
("a-stwiun", T), -- Ada.Strings.Wide_Unbounded
("a-swmwco", T), -- Ada.Strings.Wide_Maps.Wide_Constants
("a-sytaco", T), -- Ada.Synchronous_Task_Control
("a-tags ", T), -- Ada.Tags
("a-tasatt", T), -- Ada.Task_Attributes
("a-taside", T), -- Ada.Task_Identification
("a-teioed", T), -- Ada.Text_IO.Editing
("a-textio", T), -- Ada.Text_IO
("a-ticoio", T), -- Ada.Text_IO.Complex_IO
("a-titest", T), -- Ada.Text_IO.Text_Streams
("a-unccon", T), -- Ada.Unchecked_Conversion
("a-uncdea", T), -- Ada.Unchecked_Deallocation
("a-witeio", T), -- Ada.Wide_Text_IO
("a-wtcoio", T), -- Ada.Wide_Text_IO.Complex_IO
("a-wtedit", T), -- Ada.Wide_Text_IO.Editing
("a-wttest", T), -- Ada.Wide_Text_IO.Text_Streams
2001-10-02 16:18:40 +02:00
-------------------------------------------------
-- RM Required Additions to Ada for GNAT Types --
-------------------------------------------------
-- Note: Long versions are considered RM defined, but not the Long Long,
-- Short, or Short_Short versions.
("a-lfteio", T), -- Ada.Long_Float_Text_IO
("a-lfwtio", T), -- Ada.Long_Float_Wide_Text_IO
("a-liteio", T), -- Ada.Long_Integer_Text_IO
("a-liwtio", T), -- Ada.Long_Integer_Wide_Text_IO
("a-llftio", T), -- Ada.Long_Long_Float_Text_IO
("a-llfwti", T), -- Ada.Long_Long_Float_Wide_Text_IO
("a-llitio", T), -- Ada.Long_Long_Integer_Text_IO
("a-lliwti", F), -- Ada.Long_Long_Integer_Wide_Text_IO
("a-nlcefu", F), -- Ada.Long_Complex_Elementary_Functions
("a-nlcoty", T), -- Ada.Numerics.Long_Complex_Types
("a-nlelfu", T), -- Ada.Numerics.Long_Elementary_Functions
("a-nllcef", F), -- Ada.Long_Long_Complex_Elementary_Functions
("a-nllefu", F), -- Ada.Numerics.Long_Long_Elementary_Functions
("a-nllcty", F), -- Ada.Numerics.Long_Long_Complex_Types
("a-nscefu", F), -- Ada.Short_Complex_Elementary_Functions
("a-nscoty", F), -- Ada.Numerics.Short_Complex_Types
("a-nselfu", F), -- Ada.Numerics.Short_Elementary_Functions
("a-sfteio", F), -- Ada.Short_Float_Text_IO
("a-sfwtio", F), -- Ada.Short_Float_Wide_Text_IO
("a-siteio", F), -- Ada.Short_Integer_Text_IO
("a-siwtio", F), -- Ada.Short_Integer_Wide_Text_IO
("a-ssitio", F), -- Ada.Short_Short_Integer_Text_IO
("a-ssiwti", F), -- Ada.Short_Short_Integer_Wide_Text_IO
2001-10-02 16:18:40 +02:00
-----------------------------------
-- GNAT Defined Additions to Ada --
-----------------------------------
("a-calcon", F), -- Ada.Calendar.Conversions
("a-chlat9", F), -- Ada.Characters.Latin_9
("a-clrefi", F), -- Ada.Command_Line.Response_File
("a-colien", F), -- Ada.Command_Line.Environment
("a-colire", F), -- Ada.Command_Line.Remove
("a-cwila1", F), -- Ada.Characters.Wide_Latin_1
("a-cwila9", F), -- Ada.Characters.Wide_Latin_9
("a-diocst", F), -- Ada.Direct_IO.C_Streams
("a-einuoc", F), -- Ada.Exceptions.Is_Null_Occurrence
("a-elchha", F), -- Ada.Exceptions.Last_Chance_Handler
("a-exctra", F), -- Ada.Exceptions.Traceback
("a-siocst", F), -- Ada.Sequential_IO.C_Streams
("a-ssicst", F), -- Ada.Streams.Stream_IO.C_Streams
("a-suteio", F), -- Ada.Strings.Unbounded.Text_IO
("a-swuwti", F), -- Ada.Strings.Wide_Unbounded.Wide_Text_IO
("a-tiocst", F), -- Ada.Text_IO.C_Streams
("a-wtcstr", F), -- Ada.Wide_Text_IO.C_Streams
2001-10-02 16:18:40 +02:00
system-unixware.ads, [...]: Minor comment update for AI-362 (unit is Pure). 2005-06-14 Robert Dewar <dewar@adacore.com> * system-unixware.ads, system-linux-ia64.ads, system-freebsd-x86.ads, system-lynxos-ppc.ads, system-lynxos-x86.ads, system-linux-x86_64.ads, system-tru64.ads, system-aix.ads, system-vxworks-sparcv9.ads, system-vxworks-xscale.ads, system-solaris-x86.ads, system-irix-o32.ads, system-irix-n32.ads, system-hpux.ads, system-vxworks-m68k.ads, system-linux-x86.ads, system-vxworks-mips.ads, system-vxworks-mips.ads, system-os2.ads, system-interix.ads, system-solaris-sparc.ads, system-solaris-sparcv9.ads, system-vms.ads, system-mingw.ads, system-vms-zcx.ads, system-vxworks-ppc.ads, system.ads, system-darwin-ppc.ads, system-vxworks-x86.ads, system-linux-ppc.ads, system-linux-hppa.ads, system-vms_64.ads, system-vxworks-alpha.ads: Minor comment update for AI-362 (unit is Pure). * a-chahan.ads, a-chahan.adb: Move Wide_Wide functions to Conversions Add pragma Pure_05 for AI-362 Make remaining conversion functions obsolescent in Ada 95 * impunit.adb: Change a-swunha to a-swuwha and a-szunha to a-szuzha Make Ada.Wide_Characters[.Unicode] available in Ada 95 mode Add entries for a-wichun and a-zchuni Add a-widcha a-zchara for AI-395 Add a-chacon (Ada.Characters.Conversions) to list of Ada 2005 routines * Makefile.rtl: Change a-swunha to a-swuwha and a-szunha to a-szuzha Add entries for a-wichun.o and a-zchuni.o Entries for a-widcha.o and a-zchara.o Add entry for a-chacon.o * a-ztenau.adb: Add with of Ada.Characters.Conversions * a-chacon.ads, a-chacon.adb: New files. * a-taside.adb, a-exstat.adb, a-excach.adb: Add warnings off to allow categorization violations. * a-strmap.ads: Add pragma Pure_05 for AI-362 * a-strmap.ads: Add note on implicit categorization for AI-362 * a-tgdico.ads, a-taside.ads: Add pragma Preelaborate_05 for AI-362 * par-prag.adb: Dummy entry for pragma Persistent_BSS Set Ada_Version_Explicit, for implementation of AI-362 Add processing for pragma Pure_05 and Preelaborate_05 Add entry for Assertion_Policy pragma * sem.adb: Make sure predefined units are compiled with GNAT_Mode true when needed for proper processing of categorization stuff * sem_cat.adb: For several cases, make errors in preealborate units warnings, instead of errors, if GNAT_Mode is set. For AI-362. * sem_elab.adb (Check_Elab_Call): Call to non-static subprogram in preelaborate unit is now warning if in GNAT mode * s-stoele.ads: Document AI-362 for pragma preelaborate From-SVN: r101016
2005-06-16 10:28:59 +02:00
-- Note: strictly the next two should be Ada 2005 units, but it seems
-- harmless (and useful) to make then available in Ada 95 mode, since
-- they only deal with Wide_Character, not Wide_Wide_Character.
("a-wichun", F), -- Ada.Wide_Characters.Unicode
("a-widcha", F), -- Ada.Wide_Characters
system-unixware.ads, [...]: Minor comment update for AI-362 (unit is Pure). 2005-06-14 Robert Dewar <dewar@adacore.com> * system-unixware.ads, system-linux-ia64.ads, system-freebsd-x86.ads, system-lynxos-ppc.ads, system-lynxos-x86.ads, system-linux-x86_64.ads, system-tru64.ads, system-aix.ads, system-vxworks-sparcv9.ads, system-vxworks-xscale.ads, system-solaris-x86.ads, system-irix-o32.ads, system-irix-n32.ads, system-hpux.ads, system-vxworks-m68k.ads, system-linux-x86.ads, system-vxworks-mips.ads, system-vxworks-mips.ads, system-os2.ads, system-interix.ads, system-solaris-sparc.ads, system-solaris-sparcv9.ads, system-vms.ads, system-mingw.ads, system-vms-zcx.ads, system-vxworks-ppc.ads, system.ads, system-darwin-ppc.ads, system-vxworks-x86.ads, system-linux-ppc.ads, system-linux-hppa.ads, system-vms_64.ads, system-vxworks-alpha.ads: Minor comment update for AI-362 (unit is Pure). * a-chahan.ads, a-chahan.adb: Move Wide_Wide functions to Conversions Add pragma Pure_05 for AI-362 Make remaining conversion functions obsolescent in Ada 95 * impunit.adb: Change a-swunha to a-swuwha and a-szunha to a-szuzha Make Ada.Wide_Characters[.Unicode] available in Ada 95 mode Add entries for a-wichun and a-zchuni Add a-widcha a-zchara for AI-395 Add a-chacon (Ada.Characters.Conversions) to list of Ada 2005 routines * Makefile.rtl: Change a-swunha to a-swuwha and a-szunha to a-szuzha Add entries for a-wichun.o and a-zchuni.o Entries for a-widcha.o and a-zchara.o Add entry for a-chacon.o * a-ztenau.adb: Add with of Ada.Characters.Conversions * a-chacon.ads, a-chacon.adb: New files. * a-taside.adb, a-exstat.adb, a-excach.adb: Add warnings off to allow categorization violations. * a-strmap.ads: Add pragma Pure_05 for AI-362 * a-strmap.ads: Add note on implicit categorization for AI-362 * a-tgdico.ads, a-taside.ads: Add pragma Preelaborate_05 for AI-362 * par-prag.adb: Dummy entry for pragma Persistent_BSS Set Ada_Version_Explicit, for implementation of AI-362 Add processing for pragma Pure_05 and Preelaborate_05 Add entry for Assertion_Policy pragma * sem.adb: Make sure predefined units are compiled with GNAT_Mode true when needed for proper processing of categorization stuff * sem_cat.adb: For several cases, make errors in preealborate units warnings, instead of errors, if GNAT_Mode is set. For AI-362. * sem_elab.adb (Check_Elab_Call): Call to non-static subprogram in preelaborate unit is now warning if in GNAT mode * s-stoele.ads: Document AI-362 for pragma preelaborate From-SVN: r101016
2005-06-16 10:28:59 +02:00
-- Note: strictly the following should be Ada 2012 units, but it seems
-- harmless (and useful) to make then available in Ada 95 mode, since
-- they do not deal with Wide_Wide_Character.
("a-wichha", F), -- Ada.Wide_Characters.Handling
("a-stuten", F), -- Ada.Strings.UTF_Encoding
("a-suenco", F), -- Ada.Strings.UTF_Encoding.Conversions
("a-suenst", F), -- Ada.Strings.UTF_Encoding.Strings
("a-suewst", F), -- Ada.Strings.UTF_Encoding.Wide_Strings
2001-10-02 16:18:40 +02:00
---------------------------
-- GNAT Special IO Units --
---------------------------
-- As further explained elsewhere (see Sem_Ch10), the internal packages of
-- Text_IO and Wide_Text_IO are actually implemented as separate children,
-- but this fact is intended to be hidden from the user completely. Any
-- attempt to WITH one of these units will be diagnosed as an error later
-- on, but for now we do not consider these internal implementation units
-- (if we did, then we would get a junk warning which would be confusing
-- and unnecessary, given that we generate a clear error message).
2001-10-02 16:18:40 +02:00
("a-tideio", F), -- Ada.Text_IO.Decimal_IO
("a-tienio", F), -- Ada.Text_IO.Enumeration_IO
("a-tifiio", F), -- Ada.Text_IO.Fixed_IO
("a-tiflio", F), -- Ada.Text_IO.Float_IO
("a-tiinio", F), -- Ada.Text_IO.Integer_IO
("a-tiinio", F), -- Ada.Text_IO.Integer_IO
("a-timoio", F), -- Ada.Text_IO.Modular_IO
("a-wtdeio", F), -- Ada.Wide_Text_IO.Decimal_IO
("a-wtenio", F), -- Ada.Wide_Text_IO.Enumeration_IO
("a-wtfiio", F), -- Ada.Wide_Text_IO.Fixed_IO
("a-wtflio", F), -- Ada.Wide_Text_IO.Float_IO
("a-wtinio", F), -- Ada.Wide_Text_IO.Integer_IO
("a-wtmoio", F), -- Ada.Wide_Text_IO.Modular_IO
2001-10-02 16:18:40 +02:00
------------------------
-- GNAT Library Units --
------------------------
("g-altive", F), -- GNAT.Altivec
("g-altcon", F), -- GNAT.Altivec.Conversions
("g-alveop", F), -- GNAT.Altivec.Vector_Operations
("g-alvety", F), -- GNAT.Altivec.Vector_Types
("g-alvevi", F), -- GNAT.Altivec.Vector_Views
("g-arrspl", F), -- GNAT.Array_Split
("g-awk ", F), -- GNAT.AWK
("g-binenv", F), -- GNAT.Bind_Environment
("g-boubuf", F), -- GNAT.Bounded_Buffers
("g-boumai", F), -- GNAT.Bounded_Mailboxes
("g-bubsor", F), -- GNAT.Bubble_Sort
("g-busora", F), -- GNAT.Bubble_Sort_A
("g-busorg", F), -- GNAT.Bubble_Sort_G
("g-byorma", F), -- GNAT.Byte_Order_Mark
("g-bytswa", F), -- GNAT.Byte_Swapping
("g-calend", F), -- GNAT.Calendar
("g-catiio", F), -- GNAT.Calendar.Time_IO
("g-casuti", F), -- GNAT.Case_Util
("g-cgi ", F), -- GNAT.CGI
("g-cgicoo", F), -- GNAT.CGI.Cookie
("g-cgideb", F), -- GNAT.CGI.Debug
("g-comlin", F), -- GNAT.Command_Line
("g-comver", F), -- GNAT.Compiler_Version
("g-cppexc", F), -- GNAT.CPP_Exceptions
("g-crc32 ", F), -- GNAT.CRC32
("g-ctrl_c", F), -- GNAT.Ctrl_C
("g-curexc", F), -- GNAT.Current_Exception
("g-debpoo", F), -- GNAT.Debug_Pools
("g-debuti", F), -- GNAT.Debug_Utilities
("g-decstr", F), -- GNAT.Decode_String
("g-deutst", F), -- GNAT.Decode_UTF8_String
("g-dirope", F), -- GNAT.Directory_Operations
("g-diopit", F), -- GNAT.Directory_Operations.Iteration
("g-dynhta", F), -- GNAT.Dynamic_HTables
("g-dyntab", F), -- GNAT.Dynamic_Tables
("g-encstr", F), -- GNAT.Encode_String
("g-enutst", F), -- GNAT.Encode_UTF8_String
("g-excact", F), -- GNAT.Exception_Actions
("g-except", F), -- GNAT.Exceptions
("g-exctra", F), -- GNAT.Exception_Traces
("g-expect", F), -- GNAT.Expect
("g-exptty", F), -- GNAT.Expect.TTY
("g-flocon", F), -- GNAT.Float_Control
("g-forstr", F), -- GNAT.Formatted_String
("g-heasor", F), -- GNAT.Heap_Sort
("g-hesora", F), -- GNAT.Heap_Sort_A
("g-hesorg", F), -- GNAT.Heap_Sort_G
("g-htable", F), -- GNAT.Htable
("g-io ", F), -- GNAT.IO
("g-io_aux", F), -- GNAT.IO_Aux
("g-locfil", F), -- GNAT.Lock_Files
("g-mbdira", F), -- GNAT.MBBS_Discrete_Random
("g-mbflra", F), -- GNAT.MBBS_Float_Random
("g-md5 ", F), -- GNAT.MD5
("g-memdum", F), -- GNAT.Memory_Dump
("g-moreex", F), -- GNAT.Most_Recent_Exception
("g-os_lib", F), -- GNAT.Os_Lib
("g-pehage", F), -- GNAT.Perfect_Hash_Generators
("g-rannum", F), -- GNAT.Random_Numbers
("g-regexp", F), -- GNAT.Regexp
("g-regist", F), -- GNAT.Registry
("g-regpat", F), -- GNAT.Regpat
("g-rewdat", F), -- GNAT.Rewrite_Data
("g-semaph", F), -- GNAT.Semaphores
("g-sercom", F), -- GNAT.Serial_Communications
("g-sestin", F), -- GNAT.Secondary_Stack_Info
("g-sha1 ", F), -- GNAT.SHA1
("g-sha224", F), -- GNAT.SHA224
("g-sha256", F), -- GNAT.SHA256
("g-sha384", F), -- GNAT.SHA384
("g-sha512", F), -- GNAT.SHA512
("g-signal", F), -- GNAT.Signals
("g-socket", F), -- GNAT.Sockets
("g-souinf", F), -- GNAT.Source_Info
("g-speche", F), -- GNAT.Spell_Checker
("g-spchge", F), -- GNAT.Spell_Checker_Generic
("g-spitbo", F), -- GNAT.Spitbol
("g-spipat", F), -- GNAT.Spitbol.Patterns
("g-sptabo", F), -- GNAT.Spitbol.Table_Boolean
("g-sptain", F), -- GNAT.Spitbol.Table_Integer
("g-sptavs", F), -- GNAT.Spitbol.Table_Vstring
[multiple changes] 2015-11-18 Nicolas Roche <roche@adacore.com> * sysdep.c (__gnat_localtime_tzoff): On Windows platform GetTimeZoneInformation function is thread-safe. Thus there is no need to lock the runtime in the implementation of __gnat_localtime_tzoff on that platform. 2015-11-18 Eric Botcazou <ebotcazou@adacore.com> * s-arit64.adb (To_Neg_Int): Add a special case for 2**63 input. 2015-11-18 Hristian Kirtchev <kirtchev@adacore.com> * contracts.adb (Analyze_Contracts): New routine. (Analyze_Enclosing_Package_Body_Contract): Removed. (Analyze_Entry_Or_Subprogram_Contract): Add formal parameter Freeze_Id. Propagate the entity of the freezing body to vaious analysis routines. (Analyze_Initial_Declaration_Contract): Removed. (Analyze_Object_Contract): Add formal parameter Freeze_Id. Propagate the entity of the freezing body to vaious analysis routines. (Analyze_Previous_Contracts): New routine. * contracts.ads (Analyze_Enclosing_Package_Body_Contract): Removed. (Analyze_Contracts): New routine. (Analyze_Entry_Or_Subprogram_Contract): Add formal parameter Freeze_Id and update the comment on usage. (Analyze_Initial_Declaration_Contract): Removed. (Analyze_Object_Contract): Add formal parameter Freeze_Id and update the comment on usage. (Analyze_Previous_Contracts): New routine. * sem_ch3.adb (Analyze_Declarations): Use Analyze_Contracts to analyze all contracts of eligible constructs. * sem_ch6.adb (Analyze_Generic_Subprogram_Body): A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. (Analyze_Subprogram_Body_Helper): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. * sem_ch7.adb (Analyze_Package_Body_Helper): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. * sem_ch9.adb (Analyze_Entry_Body): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. (Analyze_Protected_Body): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. (Analyze_Task_Body): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. * sem_prag.adb (Add_Item_To_Name_Buffer): Single protected/task objects now output their respective current instance of xxx type messages. (Analyze_Contract_Cases_In_Decl_Part): Add formal parameter Freeze_Id. Emit a clarification message when an undefined entity may the byproduct of contract freezing. (Analyze_Part_Of_In_Decl_Part): Add formal parameter Freeze_Id. Emit a clarification message when an undefined entity may the byproduct of contract freezing. (Analyze_Pre_Post_Condition_In_Decl_Part): Add formal parameter Freeze_Id. Emit a clarification message when an undefined entity may the byproduct of contract freezing. (Analyze_Refined_State_In_Decl_Part): Do not report unused body states as constituents of single protected/task types may not bave been identified yet. (Collect_Subprogram_Inputs_Outputs): Reimplemented. (Contract_Freeze_Error): New routine. (Process_Overloadable): Use predicate Is_Single_Task_Object. * sem_prag.ads (Analyze_Contract_Cases_In_Decl_Part): Add formal parameter Freeze_Id and update the comment on usage. (Analyze_Part_Of_In_Decl_Part): Add formal parameter Freeze_Id and update the comment on usage. (Analyze_Pre_Post_Condition_In_Decl_Part): Add formal parameter Freeze_Id and update the comment on usage. * sem_util.adb (Check_Unused_Body_States): Remove global variable Legal_Constits. The routine now reports unused body states regardless of whether constituents are legal or not. (Collect_Body_States): A constituent of a single protected/task type is not a visible state of a package body. (Collect_Visible_States): A constituent of a single protected/task type is not a visible state of a package body. (Has_Undefined_Reference): New routine. (Is_Single_Concurrent_Object): Reimplemented. (Is_Single_Protected_Object): New routine. (Is_Single_Task_Object): New routine. (Is_Visible_Object): New routine. (Report_Unused_Body_States): Moved to Check_Unused_Body_States. * sem_util.ads (Check_Unused_Body_States): Update the comment on usage. (Has_Undefined_Reference): New routine. (Is_Single_Protected_Object): New routine. (Is_Single_Task_Object): New routine. (Report_Unused_Body_States): Moved to Check_Unused_Body_States. 2015-11-18 Pierre-Marie de Rodat <derodat@adacore.com> * Makefile.rtl, impunit.adb: Add g-strhas.ads. * g-strhas.ads: New file. * s-strhas.ads: Add a comment to redirect users to g-strhas.ads. 2015-11-18 Bob Duff <duff@adacore.com> * sem_elab.adb (Check_Internal_Call_Continue): Fix the case where the call in question is to a renaming of a subprogram that can be safely called without ABE. * checks.adb: Minor edits. From-SVN: r230546
2015-11-18 14:53:58 +01:00
("g-strhas", F), -- GNAT.String_Hash
("g-string", F), -- GNAT.Strings
("g-strspl", F), -- GNAT.String_Split
("g-sse ", F), -- GNAT.SSE
("g-ssvety", F), -- GNAT.SSE.Vector_Types
("g-table ", F), -- GNAT.Table
("g-tasloc", F), -- GNAT.Task_Lock
("g-tastus", F), -- GNAT.Task_Stack_Usage
("g-thread", F), -- GNAT.Threads
("g-timsta", F), -- GNAT.Time_Stamp
("g-traceb", F), -- GNAT.Traceback
("g-trasym", F), -- GNAT.Traceback.Symbolic
("g-tty ", F), -- GNAT.TTY
("g-utf_32", F), -- GNAT.UTF_32
("g-u3spch", F), -- GNAT.UTF_32_Spelling_Checker
("g-wispch", F), -- GNAT.Wide_Spelling_Checker
("g-wistsp", F), -- GNAT.Wide_String_Split
2001-10-02 16:18:40 +02:00
-----------------------------------------------------
-- Interface Hierarchy Units from Reference Manual --
-----------------------------------------------------
("i-c ", T), -- Interfaces.C
("i-cobol ", T), -- Interfaces.Cobol
("i-cpoint", T), -- Interfaces.C.Pointers
("i-cstrin", T), -- Interfaces.C.Strings
("i-fortra", T), -- Interfaces.Fortran
2001-10-02 16:18:40 +02:00
------------------------------------------
-- GNAT Defined Additions to Interfaces --
------------------------------------------
("i-cexten", F), -- Interfaces.C.Extensions
("i-cil ", F), -- Interfaces.CIL
("i-cilobj", F), -- Interfaces.CIL.Object
("i-cstrea", F), -- Interfaces.C.Streams
("i-java ", F), -- Interfaces.Java
("i-javjni", F), -- Interfaces.Java.JNI
("i-pacdec", F), -- Interfaces.Packed_Decimal
("i-vxinco", F), -- Interfaces.VxWorks.Int_Connection
("i-vxwoio", F), -- Interfaces.VxWorks.IO
("i-vxwork", F), -- Interfaces.VxWorks
2001-10-02 16:18:40 +02:00
--------------------------------------------------
-- System Hierarchy Units from Reference Manual --
--------------------------------------------------
("s-atacco", T), -- System.Address_To_Access_Conversions
("s-maccod", T), -- System.Machine_Code
("s-rpc ", T), -- System.Rpc
("s-stoele", T), -- System.Storage_Elements
("s-stopoo", T), -- System.Storage_Pools
2001-10-02 16:18:40 +02:00
--------------------------------------
-- GNAT Defined Additions to System --
--------------------------------------
("s-addima", F), -- System.Address_Image
("s-atocou", F), -- System.Atomic_Counters
("s-assert", F), -- System.Assertions
("s-diflio", F), -- System.Dim.Float_IO
("s-diinio", F), -- System.Dim.Integer_IO
("s-dimkio", F), -- System.Dim.Mks_IO
("s-dimmks", F), -- System.Dim.Mks
("s-dmotpr", F), -- System.Dim.Mks.Other_Prefixes
("s-memory", F), -- System.Memory
("s-parint", F), -- System.Partition_Interface
("s-pooglo", F), -- System.Pool_Global
("s-pooloc", F), -- System.Pool_Local
("s-restri", F), -- System.Restrictions
("s-rident", F), -- System.Rident
("s-ststop", F), -- System.Strings.Stream_Ops
("s-tasinf", F), -- System.Task_Info
("s-unstyp", F), -- System.Unsigned_Types
("s-wchcnv", F), -- System.WCh_Cnv
("s-wchcon", F), -- System.WCh_Con
-- The following are strictly speaking Ada 2012 units, but we are allowed
-- to add children to system, so we consider them to be implementation
-- defined additions to System in earlier versions of Ada.
("s-multip", T), -- System.Multiprocessors
("s-mudido", T)); -- System.Multiprocessors.Dispatching_Domains
2001-10-02 16:18:40 +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
--------------------
-- Ada 2005 Units --
--------------------
-- The following units should be used only in Ada 05 mode
Non_Imp_File_Names_05 : constant File_List := (
--------------------------------------------------------
-- Ada Hierarchy Units from Ada 2005 Reference Manual --
--------------------------------------------------------
("a-assert", T), -- Ada.Assertions
("a-calari", T), -- Ada.Calendar.Arithmetic
("a-calfor", T), -- Ada.Calendar.Formatting
("a-catizo", T), -- Ada.Calendar.Time_Zones
("a-cdlili", T), -- Ada.Containers.Doubly_Linked_Lists
("a-cgarso", T), -- Ada.Containers.Generic_Array_Sort
("a-cgcaso", T), -- Ada.Containers.Generic_Constrained_Array_Sort
("a-chacon", T), -- Ada.Characters.Conversions
("a-cidlli", T), -- Ada.Containers.Indefinite_Doubly_Linked_Lists
("a-cihama", T), -- Ada.Containers.Indefinite_Hashed_Maps
("a-cihase", T), -- Ada.Containers.Indefinite_Hashed_Sets
("a-ciorma", T), -- Ada.Containers.Indefinite_Ordered_Maps
("a-ciorse", T), -- Ada.Containers.Indefinite_Ordered_Sets
("a-cohama", T), -- Ada.Containers.Hashed_Maps
("a-cohase", T), -- Ada.Containers.Hashed_Sets
("a-coinve", T), -- Ada.Containers.Indefinite_Vectors
("a-contai", T), -- Ada.Containers
("a-convec", T), -- Ada.Containers.Vectors
("a-coorma", T), -- Ada.Containers.Ordered_Maps
("a-coorse", T), -- Ada.Containers.Ordered_Sets
("a-coteio", T), -- Ada.Complex_Text_IO
("a-direct", T), -- Ada.Directories
("a-dinopr", T), -- Ada.Dispatching.Non_Preemptive
("a-diroro", T), -- Ada.Dispatching.Round_Robin
("a-disedf", T), -- Ada.Dispatching.EDF
("a-dispat", T), -- Ada.Dispatching
("a-envvar", T), -- Ada.Environment_Variables
("a-etgrbu", T), -- Ada.Execution_Time.Group_Budgets
("a-exetim", T), -- Ada.Execution_Time
("a-extiti", T), -- Ada.Execution_Time.Timers
("a-izteio", T), -- Ada.Integer_Wide_Wide_Text_IO
("a-rttiev", T), -- Ada.Real_Time.Timing_Events
("a-ngcoar", T), -- Ada.Numerics.Generic_Complex_Arrays
("a-ngrear", T), -- Ada.Numerics.Generic_Real_Arrays
("a-nucoar", T), -- Ada.Numerics.Complex_Arrays
("a-nurear", T), -- Ada.Numerics.Real_Arrays
("a-stboha", T), -- Ada.Strings.Bounded.Hash
("a-stfiha", T), -- Ada.Strings.Fixed.Hash
("a-strhas", T), -- Ada.Strings.Hash
("a-stunha", T), -- Ada.Strings.Unbounded.Hash
("a-stwiha", T), -- Ada.Strings.Wide_Hash
("a-stzbou", T), -- Ada.Strings.Wide_Wide_Bounded
("a-stzfix", T), -- Ada.Strings.Wide_Wide_Fixed
("a-stzhas", T), -- Ada.Strings.Wide_Wide_Hash
("a-stzmap", T), -- Ada.Strings.Wide_Wide_Maps
("a-stzunb", T), -- Ada.Strings.Wide_Wide_Unbounded
("a-swbwha", T), -- Ada.Strings.Wide_Bounded.Wide_Hash
("a-swfwha", T), -- Ada.Strings.Wide_Fixed.Wide_Hash
("a-swuwha", T), -- Ada.Strings.Wide_Unbounded.Wide_Hash
("a-szbzha", T), -- Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash
("a-szfzha", T), -- Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash
("a-szmzco", T), -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants
("a-szuzha", T), -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash
("a-taster", T), -- Ada.Task_Termination
("a-tgdico", T), -- Ada.Tags.Generic_Dispatching_Constructor
("a-tiboio", T), -- Ada.Text_IO.Bounded_IO
("a-tiunio", T), -- Ada.Text_IO.Unbounded_IO
("a-wichun", T), -- Ada.Wide_Characters.Unicode
("a-wwboio", T), -- Ada.Wide_Text_IO.Wide_Bounded_IO
("a-wwunio", T), -- Ada.Wide_Text_IO.Wide_Unbounded_IO
("a-zchara", T), -- Ada.Wide_Wide_Characters
("a-zchhan", T), -- Ada.Wide_Wide_Characters.Handling
("a-ztcoio", T), -- Ada.Wide_Wide_Text_IO.Complex_IO
("a-ztedit", T), -- Ada.Wide_Wide_Text_IO.Editing
("a-zttest", T), -- Ada.Wide_Wide_Text_IO.Text_Streams
("a-ztexio", T), -- Ada.Wide_Wide_Text_IO
("a-zzboio", T), -- Ada.Wide_Wide_Text_IO.Wide_Wide_Bounded_IO
("a-zzunio", T), -- Ada.Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO
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
------------------------------------------------------
-- RM Required Additions to Ada 2005 for GNAT Types --
------------------------------------------------------
-- Note: Long versions are considered RM defined, but not the Long Long,
-- Short, or Short_Short versions.
("a-lcteio", T), -- Ada.Long_Complex_Text_IO
("a-lfztio", T), -- Ada.Long_Float_Wide_Wide_Text_IO
("a-liztio", T), -- Ada.Long_Integer_Wide_Wide_Text_IO
("a-llctio", T), -- Ada.Long_Long_Complex_Text_IO
("a-llfzti", T), -- Ada.Long_Long_Float_Wide_Wide_Text_IO
("a-llizti", T), -- Ada.Long_Long_Integer_Wide_Wide_Text_IO
("a-nlcoar", T), -- Ada.Numerics.Long_Complex_Arrays
("a-nllcar", T), -- Ada.Numerics.Long_Long_Complex_Arrays
("a-nllrar", T), -- Ada.Numerics.Long_Long_Real_Arrays
("a-nlrear", T), -- Ada.Numerics.Long_Real_Arrays
("a-scteio", F), -- Ada.Short_Complex_Text_IO
("a-sfztio", F), -- Ada.Short_Float_Wide_Wide_Text_IO
("a-siztio", F), -- Ada.Short_Integer_Wide_Wide_Text_IO
("a-ssizti", F), -- Ada.Short_Short_Integer_Wide_Wide_Text_IO
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
----------------------------------------
-- GNAT Defined Additions to Ada 2005 --
----------------------------------------
("a-cgaaso", F), -- Ada.Containers.Generic_Anonymous_Array_Sort
("a-chzla1", F), -- Ada.Characters.Wide_Wide_Latin_1
("a-chzla9", F), -- Ada.Characters.Wide_Wide_Latin_9
("a-ciormu", F), -- Ada.Containers.Indefinite_Ordered_Multisets
("a-coormu", F), -- Ada.Containers.Ordered_Multisets
("a-crdlli", F), -- Ada.Containers.Restricted_Doubly_Linked_Lists
("a-szuzti", F), -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO
("a-zchuni", F), -- Ada.Wide_Wide_Characters.Unicode
("a-ztcstr", F), -- Ada.Wide_Wide_Text_IO.C_Streams
2001-10-02 16:18:40 +02:00
-- Note: strictly the following should be Ada 2012 units, but it seems
-- harmless (and useful) to make then available in Ada 2005 mode.
[multiple changes] 2010-06-23 Eric Botcazou <ebotcazou@adacore.com> * exp_ch11.adb (Expand_Local_Exception_Handlers): Propagate the end label to the new sequence of statements. Set the sloc of the raise statement onto the new goto statements. 2010-06-23 Robert Dewar <dewar@adacore.com> * a-stuten.ads, a-stuten.adb: New files. * impunit.adb: Add engtry for Ada.Strings.UTF_Encoding (a-stuten.ads) * Makefile.rtl: Add entry for a-stuten (Ada.Strings.UTF_Encoding) 2010-06-23 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Add documentation of -gnat12 switch Add documentation of -gnatX switch. 2010-06-23 Ed Schonberg <schonberg@adacore.com> * inline.ads: Include the current Ada_Version in the info for pending instance bodies, so that declaration and body are compiled with the same Ada_Version. * inline.adb: Move with_clause for Opt to spec. * sem_ch12.adb (Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation): Save current Ada_Version in Pending_Instantiation information. (Instantiate_Package_Body, Instantiate_Subprogram_Body, Inline_Package_Body): Use the Ada_Version present in the body information. 2010-06-23 Robert Dewar <dewar@adacore.com> * usage.adb: Add documentation for -gnat12 switch. * errout.ads: Add VMS alias entry for -gnat12 switch * gnat_rm.texi: Add documentation for pragma Ada_12 and Ada_2012 Add documentation for pragma Extensions_Allowed. * opt.ads: Add entry for Ada 2012 mode. * sem_ch4.adb, par-ch3.adb, par-ch4.adb: Use new Ada 2012 mode for 2012 features. * sem_prag.adb, par-prag.adb: Add processing for pragma Ada_12 and Ada_2012. * sem_ch13.adb: Add handling for Ada 2012 mode. * snames.ads-tmpl: Add entries for pragma Ada_2012 and Ada_12. * switch-c.adb: Add handling for -gnat12 switch. Implement -gnat2005 and -gnat2012. * usage.adb: Add documentation for -gnat12 switch. * vms_data.ads: Add /12 switch for Ada 2012 mode. From-SVN: r161268
2010-06-23 11:53:24 +02:00
[multiple changes] 2011-11-04 Yannick Moy <moy@adacore.com> * atree.adb, atree.ads (Set_Original_Node): New set procedure. * sem_ch13.adb (Analyze_Aspect_Specifications/Pre_Post_Aspects): In ASIS mode, no splitting of aspects between conjuncts. (Analyze_Aspect_Specifications/Aspect_Test_Case): Make pragma expressions refer to the original aspect expressions through the Original_Node link. This is used in semantic analysis for ASIS mode, so that the original expression also gets analyzed. * sem_prag.adb (Preanalyze_TC_Args, Check_Precondition_Postcondition, Analyze_Pragma/Pragma_Test_Case): In ASIS mode, for a pragma generated from a source aspect, also analyze the original aspect expression. (Check_Expr_Is_Static_Expression): New procedure similar to existing procedure Check_Arg_Is_Static_Expression, except called on expression inside pragma. 2011-11-04 Tristan Gingold <gingold@adacore.com> * prj-env.adb, prj-env.ads (Find_Name_In_Path): New function, from Find_Project.Try_Path_Name. (Find_Project): Use Find_Name_In_Path to implement Try_Path_Name. 2011-11-04 Eric Botcazou <ebotcazou@adacore.com> * s-atocou.ads (Atomic_Counter): Remove redundant pragma Volatile. 2011-11-04 Pascal Obry <obry@adacore.com> * projects.texi: Add short description for qualifiers aggregate and aggregate library. 2011-11-04 Matthew Heaney <heaney@adacore.com> * Makefile.rtl, impunit.adb: Added a-cogeso.ad[sb] * a-cgaaso.adb: Replaced implementation with instantiation of Generic_Sort. * a-cogeso.ad[sb] This is the new Ada 2012 unit Ada.Containers.Generic_Sort From-SVN: r180948
2011-11-04 14:45:01 +01:00
("a-cogeso", T), -- Ada.Containers.Generic_Sort
("a-dhfina", T), -- Ada.Directories.Hierarchical_File_Names
("a-secain", T), -- Ada.Strings.Equal_Case_Insensitive
("a-shcain", T), -- Ada.Strings.Hash_Case_Insensitive
("a-slcain", T), -- Ada.Strings.Less_Case_Insensitive
("a-sfecin", T), -- Ada.Strings.Fixed.Equal_Case_Insensitive
("a-sfhcin", T), -- Ada.Strings.Fixed.Hash_Case_Insensitive
("a-sflcin", T), -- Ada.Strings.Fixed.Less_Case_Insensitive
("a-sbecin", T), -- Ada.Strings.Bounded.Equal_Case_Insensitive
("a-sbhcin", T), -- Ada.Strings.Bounded.Hash_Case_Insensitive
("a-sblcin", T), -- Ada.Strings.Bounded.Less_Case_Insensitive
("a-suecin", T), -- Ada.Strings.Unbounded.Equal_Case_Insensitive
("a-suhcin", T), -- Ada.Strings.Unbounded.Hash_Case_Insensitive
("a-sulcin", T), -- Ada.Strings.Unbounded.Less_Case_Insensitive
("a-suezst", T), -- Ada.Strings.UTF_Encoding.Wide_Wide_Strings
[multiple changes] 2010-06-23 Eric Botcazou <ebotcazou@adacore.com> * exp_ch11.adb (Expand_Local_Exception_Handlers): Propagate the end label to the new sequence of statements. Set the sloc of the raise statement onto the new goto statements. 2010-06-23 Robert Dewar <dewar@adacore.com> * a-stuten.ads, a-stuten.adb: New files. * impunit.adb: Add engtry for Ada.Strings.UTF_Encoding (a-stuten.ads) * Makefile.rtl: Add entry for a-stuten (Ada.Strings.UTF_Encoding) 2010-06-23 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Add documentation of -gnat12 switch Add documentation of -gnatX switch. 2010-06-23 Ed Schonberg <schonberg@adacore.com> * inline.ads: Include the current Ada_Version in the info for pending instance bodies, so that declaration and body are compiled with the same Ada_Version. * inline.adb: Move with_clause for Opt to spec. * sem_ch12.adb (Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation): Save current Ada_Version in Pending_Instantiation information. (Instantiate_Package_Body, Instantiate_Subprogram_Body, Inline_Package_Body): Use the Ada_Version present in the body information. 2010-06-23 Robert Dewar <dewar@adacore.com> * usage.adb: Add documentation for -gnat12 switch. * errout.ads: Add VMS alias entry for -gnat12 switch * gnat_rm.texi: Add documentation for pragma Ada_12 and Ada_2012 Add documentation for pragma Extensions_Allowed. * opt.ads: Add entry for Ada 2012 mode. * sem_ch4.adb, par-ch3.adb, par-ch4.adb: Use new Ada 2012 mode for 2012 features. * sem_prag.adb, par-prag.adb: Add processing for pragma Ada_12 and Ada_2012. * sem_ch13.adb: Add handling for Ada 2012 mode. * snames.ads-tmpl: Add entries for pragma Ada_2012 and Ada_12. * switch-c.adb: Add handling for -gnat12 switch. Implement -gnat2005 and -gnat2012. * usage.adb: Add documentation for -gnat12 switch. * vms_data.ads: Add /12 switch for Ada 2012 mode. From-SVN: r161268
2010-06-23 11:53:24 +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
---------------------------
-- GNAT Special IO Units --
---------------------------
2001-10-02 16:18:40 +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
-- See Ada 95 section for further information. These packages are for the
-- implementation of the Wide_Wide_Text_IO generic packages.
2001-10-02 16:18:40 +02:00
("a-ztdeio", F), -- Ada.Wide_Wide_Text_IO.Decimal_IO
("a-ztenio", F), -- Ada.Wide_Wide_Text_IO.Enumeration_IO
("a-ztfiio", F), -- Ada.Wide_Wide_Text_IO.Fixed_IO
("a-ztflio", F), -- Ada.Wide_Wide_Text_IO.Float_IO
("a-ztinio", F), -- Ada.Wide_Wide_Text_IO.Integer_IO
("a-ztmoio", F), -- Ada.Wide_Wide_Text_IO.Modular_IO
2001-10-02 16:18:40 +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
------------------------
-- GNAT Library Units --
------------------------
("g-zspche", F), -- GNAT.Wide_Wide_Spelling_Checker
("g-zstspl", F)); -- GNAT.Wide_Wide_String_Split
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
--------------------
-- Ada 2012 Units --
--------------------
-- The following units should be used only in Ada 2012 mode
Non_Imp_File_Names_12 : constant File_List := (
("s-stposu", T), -- System.Storage_Pools.Subpools
("a-cobove", T), -- Ada.Containers.Bounded_Vectors
("a-cbdlli", T), -- Ada.Containers.Bounded_Doubly_Linked_Lists
("a-cborse", T), -- Ada.Containers.Bounded_Ordered_Sets
("a-cborma", T), -- Ada.Containers.Bounded_Ordered_Maps
("a-cbhase", T), -- Ada.Containers.Bounded_Hashed_Sets
("a-cbhama", T), -- Ada.Containers.Bounded_Hashed_Maps
("a-coinho", T), -- Ada.Containers.Indefinite_Holders
("a-comutr", T), -- Ada.Containers.Multiway_Trees
("a-cimutr", T), -- Ada.Containers.Indefinite_Multiway_Trees
("a-cbmutr", T), -- Ada.Containers.Bounded_Multiway_Trees
("a-csquin", T), -- Ada.Containers.Synchronized_Queue_Interfaces
("a-cusyqu", T), -- Ada.Containers.Unbounded_Synchronized_Queues
("a-cuprqu", T), -- Ada.Containers.Unbounded_Priority_Queues
("a-cbsyqu", T), -- Ada.Containers.Bounded_Synchronized_Queues
("a-cbprqu", T), -- Ada.Containers.Bounded_Priority_Queues
("a-extiin", T), -- Ada.Execution_Time.Interrupts
("a-iteint", T), -- Ada.Iterator_Interfaces
[multiple changes] 2012-10-01 Vincent Pucci <pucci@adacore.com> * system-solaris-sparcv9.ads, system-mingw.ads, system-vms_64.ads: Flag Support_Atomic_Primitives set to True. 2012-10-01 Robert Dewar <dewar@adacore.com> * impunit.adb: Ada.Locales is a language defined unit. 2012-10-01 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Apply_Parameter_Aliasing_Checks): Removed. (Apply_Parameter_Aliasing_And_Validity_Checks): New routine. (Apply_Parameter_Validity_Checks): Removed. * checks.ads (Apply_Parameter_Aliasing_Checks): Removed. (Apply_Parameter_Aliasing_And_Validity_Checks): New routine. (Apply_Parameter_Validity_Checks): Removed. * exp_ch6.adb (Expand_Call): Remove the generation of parameter aliasing checks. * freeze.adb: Remove with and use clauses for Validsw. (Freeze_Entity): Update the guard and generation of aliasing and scalar initialization checks for subprogram parameters. * opt.ads: Add new flags Check_Aliasing_Of_Parameters and Check_Validity_Of_Parameters along with comments on usage. * sem_attr.adb (Analyze_Attribute): Pragma Overlaps_Storage is no longer an Ada 2012 feature. * sem_ch4.adb: Remove with and use clauses for Checks and Validsw. (Analyze_Call): Remove the generation of aliasing checks for subprogram parameters. * sem_ch13.adb: Remove with and use clauses for Validsw. (Analyze_Aspect_Specifications): Remove the generation of scalar initialization checks. * switch-c.adb (Scan_Front_End_Switches): Add processing for -gnateA and -gnateV. * usage.adb (Usage): Add information on switches -gnateA and -gnateV. Remove information on validity switches 'l', 'L', 'v' and 'V'. * validsw.adb (Reset_Validity_Check_Options): Remove the reset of flags Validity_Check_Non_Overlapping_Params and Validity_Check_Valid_Scalars_On_Params. (Save_Validity_Check_Options): Remove the processing for flags Validity_Check_Non_Overlapping_Params and Validity_Check_Valid_Scalars_On_Params. (Set_Validity_Check_Options): Remove the processing for flags Validity_Check_Non_Overlapping_Params and Validity_Check_Valid_Scalars_On_Params. * validsw.ads: Remove flags Validity_Check_Non_Overlapping_Params and Validity_Check_Valid_Scalars_On_Params along with their comments on usage. From-SVN: r191900
2012-10-01 10:37:25 +02:00
("a-locale", T), -- Ada.Locales
("a-stcoed", T), -- Ada.Synchronous_Task_Control.EDF
("a-synbar", T), -- Ada.Synchronous_Barriers
("a-undesu", T), -- Ada.Unchecked_Deallocate_Subpool
----------------------------------------
-- GNAT Defined Additions to Ada 2012 --
----------------------------------------
("a-cfinve", F), -- Ada.Containers.Formal_Indefinite_Vectors
("a-coboho", F), -- Ada.Containers.Bounded_Holders
("a-cofove", F), -- Ada.Containers.Formal_Vectors
("a-cfdlli", F), -- Ada.Containers.Formal_Doubly_Linked_Lists
("a-cforse", F), -- Ada.Containers.Formal_Ordered_Sets
("a-cforma", F), -- Ada.Containers.Formal_Ordered_Maps
("a-cfhase", F), -- Ada.Containers.Formal_Hashed_Sets
("a-cfhama", F)); -- Ada.Containers.Formal_Hashed_Maps
-----------------------
-- Alternative Units --
-----------------------
-- For some implementation units, there is a unit in the GNAT library
-- that has identical functionality that is usable. If we have such a
-- case we record the appropriate Unit name in Error_Msg_String.
type Aunit_Record is record
Fname : String (1 .. 6);
2015-11-12 14:25:40 +01:00
Aname : String_Ptr_Const;
end record;
-- Array of alternative unit names
2015-11-12 14:25:40 +01:00
Scasuti : aliased constant String := "GNAT.Case_Util";
Scrc32 : aliased constant String := "GNAT.CRC32";
Shtable : aliased constant String := "GNAT.HTable";
Sos_lib : aliased constant String := "GNAT.OS_Lib";
Sregexp : aliased constant String := "GNAT.Regexp";
Sregpat : aliased constant String := "GNAT.Regpat";
Sstring : aliased constant String := "GNAT.Strings";
Sstusta : aliased constant String := "GNAT.Task_Stack_Usage";
Stasloc : aliased constant String := "GNAT.Task_Lock";
Sutf_32 : aliased constant String := "GNAT.UTF_32";
-- Array giving mapping
Map_Array : constant array (1 .. 10) of Aunit_Record := (
("casuti", Scasuti'Access),
("crc32 ", Scrc32 'Access),
("htable", Shtable'Access),
("os_lib", Sos_lib'Access),
("regexp", Sregexp'Access),
("regpat", Sregpat'Access),
("string", Sstring'Access),
("stusta", Sstusta'Access),
("tasloc", Stasloc'Access),
("utf_32", Sutf_32'Access));
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
----------------------
-- Get_Kind_Of_File --
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
----------------------
function Get_Kind_Of_File (File : String) return Kind_Of_Unit is
pragma Assert (File'First = 1);
Buffer : String (1 .. 8);
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
begin
Error_Msg_Strlen := 0;
-- Ada/System/Interfaces are all Ada 95 units
2001-10-02 16:18:40 +02:00
if File = "ada.ads"
or else File = "interfac.ads"
or else File = "system.ads"
then
return Ada_95_Unit;
2001-10-02 16:18:40 +02:00
end if;
-- If length of file name is greater than 12, not predefined. The value
-- 12 here is an 8 char name with extension .ads.
2001-10-02 16:18:40 +02:00
if File'Length > 12 then
return Not_Predefined_Unit;
end if;
2001-10-02 16:18:40 +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
-- Not predefined if file name does not start with a- g- s- i-
2001-10-02 16:18:40 +02:00
if File'Length < 3
or else File (2) /= '-'
or else
(File (1) /= 'a'
and then File (1) /= 'g'
and then File (1) /= 'i'
and then File (1) /= 's')
2001-10-02 16:18:40 +02:00
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
return Not_Predefined_Unit;
2001-10-02 16:18:40 +02:00
end if;
-- To be considered predefined, the file name must end in .ads or .adb.
-- File names with other extensions (coming from the use of non-standard
-- file naming schemes) can never be predefined.
-- Note that in the context of a compiler, the .adb case will never
-- arise. However it can arise for other tools, e.g. gnatprove uses
-- this routine to detect when a construct comes from an instance of
-- a generic defined in a predefined unit.
[multiple changes] 2012-11-06 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c: Interfaces.C now needs to be WITH'd even on platforms that do not support sockets (for the benefit of subtype IOCTL_Req_T). 2012-11-06 Ed Schonberg <schonberg@adacore.com> * par-ch4.adb (P_Primary): if-expressions, case-expressions, and quantified expressions are legal if surrounded by parentheses from an enclosing context, such as a call or an instantiation. 2012-11-06 Yannick Moy <moy@adacore.com> * impunit.adb (Get_Kind_Of_Unit): Return appropriate kind for predefined implementation files, instead of returning Not_Predefined_Unit on all .adb files. 2012-11-06 Tristan Gingold <gingold@adacore.com> * exp_ch9.adb (Build_Activation_Chain_Entity): Return immediately if partition elaboration policy is sequential. (Build_Task_Activation_Call): Likewise. Use Activate_Restricted_Tasks on restricted profile. (Make_Task_Create_Call): Do not use the _Chain parameter if elaboration policy is sequential. Call Create_Restricted_Task_Sequential in that case. * exp_ch3.adb (Build_Initialization_Call): Change condition to support concurrent elaboration policy. (Build_Record_Init_Proc): Likewise. (Init_Formals): Likewise. * bindgen.adb (Gen_Adainit): Declare Partition_Elaboration_Policy and set it in generated code if the elaboration policy is sequential. The procedure called to activate all tasks is now named __gnat_activate_all_tasks. * rtsfind.adb (RE_Activate_Restricted_Task, RE_Create_Restricted_Task_Sequential): New RE_Id literals. * s-tarest.adb (Create_Restricted_Task): Added to create a task without adding it on an activation chain. (Activate_Tasks): Has now a Chain parameter. (Activate_All_Tasks_Sequential): Added. Called by the binder to activate all tasks. (Activate_Restricted_Tasks): Added. Called during elaboration to activate tasks of the units. * s-tarest.ads: Remove pragma Partition_Elaboration_Policy. (Partition_Elaboration_Policy): New variable (set by the binder). (Create_Restricted_Task): Revert removal of the chain parameter. (Create_Restricted_Task_Sequential): New procedure. (Activate_Restricted_Tasks): Revert removal. (Activate_All_Tasks_Sequential): New procedure. From-SVN: r193214
2012-11-06 10:44:51 +01:00
if File (File'Last - 3 .. File'Last) /= ".ads"
[multiple changes] 2012-11-06 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c: Interfaces.C now needs to be WITH'd even on platforms that do not support sockets (for the benefit of subtype IOCTL_Req_T). 2012-11-06 Ed Schonberg <schonberg@adacore.com> * par-ch4.adb (P_Primary): if-expressions, case-expressions, and quantified expressions are legal if surrounded by parentheses from an enclosing context, such as a call or an instantiation. 2012-11-06 Yannick Moy <moy@adacore.com> * impunit.adb (Get_Kind_Of_Unit): Return appropriate kind for predefined implementation files, instead of returning Not_Predefined_Unit on all .adb files. 2012-11-06 Tristan Gingold <gingold@adacore.com> * exp_ch9.adb (Build_Activation_Chain_Entity): Return immediately if partition elaboration policy is sequential. (Build_Task_Activation_Call): Likewise. Use Activate_Restricted_Tasks on restricted profile. (Make_Task_Create_Call): Do not use the _Chain parameter if elaboration policy is sequential. Call Create_Restricted_Task_Sequential in that case. * exp_ch3.adb (Build_Initialization_Call): Change condition to support concurrent elaboration policy. (Build_Record_Init_Proc): Likewise. (Init_Formals): Likewise. * bindgen.adb (Gen_Adainit): Declare Partition_Elaboration_Policy and set it in generated code if the elaboration policy is sequential. The procedure called to activate all tasks is now named __gnat_activate_all_tasks. * rtsfind.adb (RE_Activate_Restricted_Task, RE_Create_Restricted_Task_Sequential): New RE_Id literals. * s-tarest.adb (Create_Restricted_Task): Added to create a task without adding it on an activation chain. (Activate_Tasks): Has now a Chain parameter. (Activate_All_Tasks_Sequential): Added. Called by the binder to activate all tasks. (Activate_Restricted_Tasks): Added. Called during elaboration to activate tasks of the units. * s-tarest.ads: Remove pragma Partition_Elaboration_Policy. (Partition_Elaboration_Policy): New variable (set by the binder). (Create_Restricted_Task): Revert removal of the chain parameter. (Create_Restricted_Task_Sequential): New procedure. (Activate_Restricted_Tasks): Revert removal. (Activate_All_Tasks_Sequential): New procedure. From-SVN: r193214
2012-11-06 10:44:51 +01:00
and then
File (File'Last - 3 .. File'Last) /= ".adb"
[multiple changes] 2012-11-06 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c: Interfaces.C now needs to be WITH'd even on platforms that do not support sockets (for the benefit of subtype IOCTL_Req_T). 2012-11-06 Ed Schonberg <schonberg@adacore.com> * par-ch4.adb (P_Primary): if-expressions, case-expressions, and quantified expressions are legal if surrounded by parentheses from an enclosing context, such as a call or an instantiation. 2012-11-06 Yannick Moy <moy@adacore.com> * impunit.adb (Get_Kind_Of_Unit): Return appropriate kind for predefined implementation files, instead of returning Not_Predefined_Unit on all .adb files. 2012-11-06 Tristan Gingold <gingold@adacore.com> * exp_ch9.adb (Build_Activation_Chain_Entity): Return immediately if partition elaboration policy is sequential. (Build_Task_Activation_Call): Likewise. Use Activate_Restricted_Tasks on restricted profile. (Make_Task_Create_Call): Do not use the _Chain parameter if elaboration policy is sequential. Call Create_Restricted_Task_Sequential in that case. * exp_ch3.adb (Build_Initialization_Call): Change condition to support concurrent elaboration policy. (Build_Record_Init_Proc): Likewise. (Init_Formals): Likewise. * bindgen.adb (Gen_Adainit): Declare Partition_Elaboration_Policy and set it in generated code if the elaboration policy is sequential. The procedure called to activate all tasks is now named __gnat_activate_all_tasks. * rtsfind.adb (RE_Activate_Restricted_Task, RE_Create_Restricted_Task_Sequential): New RE_Id literals. * s-tarest.adb (Create_Restricted_Task): Added to create a task without adding it on an activation chain. (Activate_Tasks): Has now a Chain parameter. (Activate_All_Tasks_Sequential): Added. Called by the binder to activate all tasks. (Activate_Restricted_Tasks): Added. Called during elaboration to activate tasks of the units. * s-tarest.ads: Remove pragma Partition_Elaboration_Policy. (Partition_Elaboration_Policy): New variable (set by the binder). (Create_Restricted_Task): Revert removal of the chain parameter. (Create_Restricted_Task_Sequential): New procedure. (Activate_Restricted_Tasks): Revert removal. (Activate_All_Tasks_Sequential): New procedure. From-SVN: r193214
2012-11-06 10:44:51 +01:00
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
return Not_Predefined_Unit;
2001-10-02 16:18:40 +02:00
end if;
-- Otherwise normalize file name to 8 characters
Buffer (1 .. File'Length - 4) := File (1 .. File'Length - 4);
for J in File'Length - 3 .. 8 loop
Buffer (J) := ' ';
2001-10-02 16:18:40 +02:00
end loop;
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
-- See if name is in 95 list
2001-10-02 16:18:40 +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
for J in Non_Imp_File_Names_95'Range loop
if Buffer = Non_Imp_File_Names_95 (J).Fname 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
return Ada_95_Unit;
2001-10-02 16:18:40 +02:00
end if;
end loop;
-- See if name is in 2005 list
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
for J in Non_Imp_File_Names_05'Range loop
if Buffer = Non_Imp_File_Names_05 (J).Fname then
return Ada_2005_Unit;
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
end if;
end loop;
-- See if name is in 2012 list
for J in Non_Imp_File_Names_12'Range loop
if Buffer = Non_Imp_File_Names_12 (J).Fname then
return Ada_2012_Unit;
end if;
end loop;
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
-- Only remaining special possibilities are children of System.RPC and
-- System.Garlic and special files of the form System.Aux...
2001-10-02 16:18:40 +02:00
if File (1 .. 5) = "s-aux"
or else File (1 .. 5) = "s-gar"
or else File (1 .. 5) = "s-rpc"
2001-10-02 16:18:40 +02:00
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
return Ada_95_Unit;
2001-10-02 16:18:40 +02:00
end if;
-- All tests failed, this is definitely an implementation unit. See if
-- we have an alternative name.
if File'Length in 11 .. 12
and then File (1 .. 2) = "s-"
and then File (File'Last - 3 .. File'Last) = ".ads"
then
for J in Map_Array'Range loop
if (File'Length = 12 and then
File (3 .. 8) = Map_Array (J).Fname)
or else
(File'Length = 11 and then
File (3 .. 7) = Map_Array (J).Fname (1 .. 5))
then
Error_Msg_Strlen := Map_Array (J).Aname'Length;
Error_Msg_String (1 .. Error_Msg_Strlen) :=
Map_Array (J).Aname.all;
end if;
end loop;
end if;
2001-10-02 16:18:40 +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
return Implementation_Unit;
end Get_Kind_Of_File;
----------------------
-- Get_Kind_Of_Unit --
----------------------
function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit is
begin
Get_Name_String (Unit_File_Name (U));
return Get_Kind_Of_File (Name_Buffer (1 .. Name_Len));
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
end Get_Kind_Of_Unit;
2001-10-02 16:18:40 +02:00
-------------------
-- Is_Known_Unit --
-------------------
function Is_Known_Unit (Nam : Node_Id) return Boolean is
Unam : Unit_Name_Type;
Fnam : File_Name_Type;
begin
-- If selector is not an identifier (e.g. it is a character literal or
-- some junk from a previous error), then definitely not a known unit.
if Nkind (Selector_Name (Nam)) /= N_Identifier then
return False;
end if;
-- Otherwise get corresponding file name
Unam := Get_Unit_Name (Nam);
Fnam := Get_File_Name (Unam, Subunit => False);
Get_Name_String (Fnam);
Error_Msg_Strlen := 0;
-- Ada/System/Interfaces are all Ada 95 units
if (Name_Len = 7 and then Name_Buffer (1 .. 7) = "ada.ads")
or else
(Name_Len = 10 and then Name_Buffer (1 .. 10) = "system.ads")
or else
(Name_Len = 12 and then Name_Buffer (1 .. 12) = "interfac.ads")
then
return True;
end if;
-- Remove extension from file name
if Name_Buffer (Name_Len - 3 .. Name_Len) = ".adb"
or else
Name_Buffer (Name_Len - 3 .. Name_Len) = ".ads"
then
Name_Len := Name_Len - 4;
else
return False;
end if;
-- Pad name to 8 characters
while Name_Len < 8 loop
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := ' ';
end loop;
-- If length more than 8, definitely not a match
if Name_Len /= 8 then
return False;
end if;
-- If length is 8, search our tables
for J in Non_Imp_File_Names_95'Range loop
if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J).Fname then
return True;
end if;
end loop;
for J in Non_Imp_File_Names_05'Range loop
if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J).Fname then
return True;
end if;
end loop;
for J in Non_Imp_File_Names_12'Range loop
if Name_Buffer (1 .. 8) = Non_Imp_File_Names_12 (J).Fname then
return True;
end if;
end loop;
-- If not found, not known
return False;
-- A safety guard, if we get an exception during this processing then it
-- is most likely the result of a previous error, or a peculiar case we
-- have not thought of. Since this routine is only used for error message
-- refinement, we will just return False.
exception
when others =>
return False;
end Is_Known_Unit;
---------------------------
-- Not_Impl_Defined_Unit --
---------------------------
function Not_Impl_Defined_Unit (U : Unit_Number_Type) return Boolean is
Fname : constant File_Name_Type := Unit_File_Name (U);
begin
Error_Msg_Strlen := 0;
Get_Name_String (Fname);
-- Ada/System/Interfaces are all RM-defined Ada 95 units
if (Name_Len = 7 and then Name_Buffer (1 .. 7) = "ada.ads")
or else
(Name_Len = 10 and then Name_Buffer (1 .. 10) = "system.ads")
or else
(Name_Len = 12 and then Name_Buffer (1 .. 12) = "interfac.ads")
then
return True;
end if;
-- If length of file name is greater than 12, then it's a user unit
-- and not a GNAT implementation defined unit.
if Name_Len > 12 then
return True;
end if;
-- Implementation defined if unit in the gnat hierarchy
if (Name_Len = 8 and then Name_Buffer (1 .. 8) = "gnat.ads")
or else (Name_Len > 2 and then Name_Buffer (1 .. 2) = "g-")
then
return False;
end if;
-- Not implementation defined if file name does not start with a- s- i-
if Name_Len < 3
or else Name_Buffer (2) /= '-'
or else (Name_Buffer (1) /= 'a'
and then
Name_Buffer (1) /= 'i'
and then
Name_Buffer (1) /= 's')
then
return True;
end if;
-- Not impl-defined if file name does not end in .ads. This can happen
-- when non-standard file names are being used.
if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then
return True;
end if;
-- Otherwise normalize file name to 8 characters
Name_Len := Name_Len - 4;
while Name_Len < 8 loop
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := ' ';
end loop;
-- Check our lists of names, if we find a match, return corresponding
-- indication of whether the file is RM defined, respecting the RM
-- version in which it is defined.
for J in Non_Imp_File_Names_95'Range loop
if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J).Fname then
return Non_Imp_File_Names_95 (J).RMdef;
end if;
end loop;
for J in Non_Imp_File_Names_05'Range loop
if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J).Fname then
return Non_Imp_File_Names_05 (J).RMdef
and then Ada_Version >= Ada_2005;
end if;
end loop;
for J in Non_Imp_File_Names_12'Range loop
if Name_Buffer (1 .. 8) = Non_Imp_File_Names_12 (J).Fname then
return Non_Imp_File_Names_95 (J).RMdef
and then Ada_Version >= Ada_2012;
end if;
end loop;
-- If unit is in System, Ada or Interfaces hierarchies and did not match
-- any entry in the list, means it is an internal implementation defined
-- unit which the restriction should definition forbid.
return True;
end Not_Impl_Defined_Unit;
2001-10-02 16:18:40 +02:00
end Impunit;