summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch9.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-21 13:42:24 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-21 13:42:24 +0000
commit9dfe12ae5b94d03c997ea2903022a5d2d5c5f266 (patch)
treebdfc70477b60f1220cb05dd233a4570dd9c6bb5c /gcc/ada/sem_ch9.adb
parent1c662558a1113238a624245a45382d3df90ccf13 (diff)
downloadgcc-9dfe12ae5b94d03c997ea2903022a5d2d5c5f266.tar.gz
2003-10-21 Arnaud Charlet <charlet@act-europe.fr>
* 3psoccon.ads, 3veacodu.adb, 3vexpect.adb, 3vsoccon.ads, 3vsocthi.adb, 3vsocthi.ads, 3vtrasym.adb, 3zsoccon.ads, 3zsocthi.adb, 3zsocthi.ads, 50system.ads, 51system.ads, 55system.ads, 56osinte.adb, 56osinte.ads, 56taprop.adb, 56taspri.ads, 56tpopsp.adb, 57system.ads, 58system.ads, 59system.ads, 5aml-tgt.adb, 5bml-tgt.adb, 5csystem.ads, 5dsystem.ads, 5fosinte.adb, 5gml-tgt.adb, 5hml-tgt.adb, 5isystem.ads, 5lparame.adb, 5msystem.ads, 5psystem.ads, 5sml-tgt.adb, 5sosprim.adb, 5stpopsp.adb, 5tsystem.ads, 5usystem.ads, 5vml-tgt.adb, 5vsymbol.adb, 5vtraent.adb, 5vtraent.ads, 5wml-tgt.adb, 5xparame.ads, 5xsystem.ads, 5xvxwork.ads, 5yparame.ads, 5ytiitho.adb, 5zinit.adb, 5zml-tgt.adb, 5zparame.ads, 5ztaspri.ads, 5ztfsetr.adb, 5zthrini.adb, 5ztiitho.adb, 5ztpopsp.adb, 7stfsetr.adb, 7straces.adb, 7strafor.adb, 7strafor.ads, 7stratas.adb, a-excach.adb, a-exexda.adb, a-exexpr.adb, a-exextr.adb, a-exstat.adb, a-strsup.adb, a-strsup.ads, a-stwisu.adb, a-stwisu.ads, bld.adb, bld.ads, bld-io.adb, bld-io.ads, clean.adb, clean.ads, ctrl_c.c, erroutc.adb, erroutc.ads, errutil.adb, errutil.ads, err_vars.ads, final.c, g-arrspl.adb, g-arrspl.ads, g-boubuf.adb, g-boubuf.ads, g-boumai.ads, g-bubsor.adb, g-bubsor.ads, g-comver.adb, g-comver.ads, g-ctrl_c.ads, g-dynhta.adb, g-dynhta.ads, g-eacodu.adb, g-excact.adb, g-excact.ads, g-heasor.adb, g-heasor.ads, g-memdum.adb, g-memdum.ads, gnatclean.adb, gnatsym.adb, g-pehage.adb, g-pehage.ads, g-perhas.ads, gpr2make.adb, gpr2make.ads, gprcmd.adb, gprep.adb, gprep.ads, g-semaph.adb, g-semaph.ads, g-string.adb, g-string.ads, g-strspl.ads, g-wistsp.ads, i-vthrea.adb, i-vthrea.ads, i-vxwoio.adb, i-vxwoio.ads, Makefile.generic, Makefile.prolog, Makefile.rtl, prep.adb, prep.ads, prepcomp.adb, prepcomp.ads, prj-err.adb, prj-err.ads, s-boarop.ads, s-carsi8.adb, s-carsi8.ads, s-carun8.adb, s-carun8.ads, s-casi16.adb, s-casi16.ads, s-casi32.adb, s-casi32.ads, s-casi64.adb, s-casi64.ads, s-casuti.adb, s-casuti.ads, s-caun16.adb, s-caun16.ads, s-caun32.adb, s-caun32.ads, s-caun64.adb, s-caun64.ads, scng.adb, scng.ads, s-exnint.adb, s-exnllf.adb, s-exnlli.adb, s-expint.adb, s-explli.adb, s-geveop.adb, s-geveop.ads, s-hibaen.ads, s-htable.adb, s-htable.ads, sinput-c.adb, sinput-c.ads, s-memcop.ads, socket.c, s-purexc.ads, s-scaval.adb, s-stopoo.adb, s-strcom.adb, s-strcom.ads, s-strxdr.adb, s-rident.ads, s-thread.adb, s-thread.ads, s-tpae65.adb, s-tpae65.ads, s-tporft.adb, s-traent.adb, s-traent.ads, styleg.adb, styleg.ads, styleg-c.adb, styleg-c.ads, s-veboop.adb, s-veboop.ads, s-vector.ads, symbols.adb, symbols.ads, tb-alvms.c, tb-alvxw.c, tempdir.adb, tempdir.ads, vms_conv.ads, vms_conv.adb, vms_data.ads, vxaddr2line.adb: Files added. Merge with ACT tree. * 4dintnam.ads, 4mintnam.ads, 4uintnam.ads, 52system.ads, 5dosinte.ads, 5etpopse.adb, 5mosinte.ads, 5qosinte.adb, 5qosinte.ads, 5qstache.adb, 5qtaprop.adb, 5qtaspri.ads, 5stpopse.adb, 5uintman.adb, 5uosinte.ads, adafinal.c, g-enblsp.adb, io-aux.c, scn-nlit.adb, scn-slit.adb, s-exnflt.ads, s-exngen.adb, s-exngen.ads, s-exnlfl.ads, s-exnlin.ads, s-exnsfl.ads, s-exnsin.ads, s-exnssi.ads, s-expflt.ads, s-expgen.adb, s-expgen.ads, s-explfl.ads, s-explin.ads, s-expllf.ads, s-expsfl.ads, s-expsin.ads, s-expssi.ads, style.adb: Files removed. Merge with ACT tree. * 1ic.ads, 31soccon.ads, 31soliop.ads, 3asoccon.ads, 3bsoccon.ads, 3gsoccon.ads, 3hsoccon.ads, 3ssoccon.ads, 3ssoliop.ads, 3wsoccon.ads, 3wsocthi.adb, 3wsocthi.ads, 3wsoliop.ads, 41intnam.ads, 42intnam.ads, 4aintnam.ads, 4cintnam.ads, 4gintnam.ads, 4hexcpol.adb, 4hintnam.ads, 4lintnam.ads, 4nintnam.ads, 4ointnam.ads, 4onumaux.ads, 4pintnam.ads, 4sintnam.ads, 4vcaldel.adb, 4vcalend.adb, 4vintnam.ads, 4wexcpol.adb, 4wintnam.ads, 4zintnam.ads, 51osinte.adb, 51osinte.ads, 52osinte.adb, 52osinte.ads, 53osinte.ads, 54osinte.ads, 5aosinte.adb, 5aosinte.ads, 5asystem.ads, 5ataprop.adb, 5atasinf.ads, 5ataspri.ads, 5atpopsp.adb, 5avxwork.ads, 5bosinte.adb, 5bosinte.ads, 5bsystem.ads, 5cosinte.ads, 5esystem.ads, 5fintman.adb, 5fosinte.ads, 5fsystem.ads, 5ftaprop.adb, 5ftasinf.ads, 5ginterr.adb, 5gintman.adb, 5gmastop.adb, 5gosinte.ads, 5gproinf.ads, 5gsystem.ads, 5gtaprop.adb, 5gtasinf.ads, 5gtpgetc.adb, 5hosinte.adb, 5hosinte.ads, 5hsystem.ads, 5htaprop.adb, 5htaspri.ads, 5htraceb.adb, 5iosinte.adb, 5itaprop.adb, 5itaspri.ads, 5ksystem.ads, 5kvxwork.ads, 5lintman.adb, 5lml-tgt.adb, 5losinte.ads, 5lsystem.ads, 5mvxwork.ads, 5ninmaop.adb, 5nintman.adb, 5nosinte.ads, 5ntaprop.adb, 5ntaspri.ads, 5ointerr.adb, 5omastop.adb, 5oosinte.adb, 5oosinte.ads, 5oosprim.adb, 5oparame.adb, 5osystem.ads, 5otaprop.adb, 5otaspri.ads, 5posinte.ads, 5posprim.adb, 5pvxwork.ads, 5sintman.adb, 5sosinte.adb, 5sosinte.ads, 5ssystem.ads, 5staprop.adb, 5stasinf.ads, 5staspri.ads, 5svxwork.ads, 5tosinte.ads, 5vasthan.adb, 5vinmaop.adb, 5vinterr.adb, 5vintman.adb, 5vintman.ads, 5vmastop.adb, 5vosinte.adb, 5vosinte.ads, 5vosprim.adb, 5vsystem.ads, 5vtaprop.adb, 5vtaspri.ads, 5vtpopde.adb, 5vtpopde.ads, 5wgloloc.adb, 5wintman.adb, 5wmemory.adb, 5wosprim.adb, 5wsystem.ads, 5wtaprop.adb, 5wtaspri.ads, 5ysystem.ads, 5zinterr.adb, 5zintman.adb, 5zosinte.adb, 5zosinte.ads, 5zosprim.adb, 5zsystem.ads, 5ztaprop.adb, 6vcpp.adb, 6vcstrea.adb, 6vinterf.ads, 7sinmaop.adb, 7sintman.adb, 7sosinte.adb, 7sosprim.adb, 7staprop.adb, 7staspri.ads, 7stpopsp.adb, 7straceb.adb, 9drpc.adb, a-caldel.adb, a-caldel.ads, a-charac.ads, a-colien.ads, a-comlin.adb, adaint.c, adaint.h, ada-tree.def, a-diocst.adb, a-diocst.ads, a-direio.adb, a-except.adb, a-except.ads, a-excpol.adb, a-exctra.adb, a-exctra.ads, a-filico.adb, a-interr.adb, a-intsig.adb, a-intsig.ads, ali.adb, ali.ads, ali-util.adb, ali-util.ads, a-ngcefu.adb, a-ngcoty.adb, a-ngelfu.adb, a-nudira.adb, a-nudira.ads, a-nuflra.adb, a-nuflra.ads, a-reatim.adb, a-reatim.ads, a-retide.ads, a-sequio.adb, a-siocst.adb, a-siocst.ads, a-ssicst.adb, a-ssicst.ads, a-strbou.adb, a-strbou.ads, a-strfix.adb, a-strmap.adb, a-strsea.ads, a-strunb.adb, a-strunb.ads, a-ststio.adb, a-stunau.adb, a-stunau.ads, a-stwibo.adb, a-stwibo.ads, a-stwifi.adb, a-stwima.adb, a-stwiun.adb, a-stwiun.ads, a-tags.adb, a-tags.ads, a-tasatt.adb, a-taside.adb, a-teioed.adb, a-textio.adb, a-textio.ads, a-tienau.adb, a-tifiio.adb, a-tiflau.adb, a-tiflio.adb, a-tigeau.adb, a-tigeau.ads, a-tiinau.adb, a-timoau.adb, a-tiocst.adb, a-tiocst.ads, atree.adb, atree.ads, a-witeio.adb, a-witeio.ads, a-wtcstr.adb, a-wtcstr.ads, a-wtdeio.adb, a-wtedit.adb, a-wtenau.adb, a-wtflau.adb, a-wtinau.adb, a-wtmoau.adb, bcheck.adb, binde.adb, bindgen.adb, bindusg.adb, checks.adb, checks.ads, cio.c, comperr.adb, comperr.ads, csets.adb, cstand.adb, cstreams.c, debug_a.adb, debug_a.ads, debug.adb, decl.c, einfo.adb, einfo.ads, errout.adb, errout.ads, eval_fat.adb, eval_fat.ads, exp_aggr.adb, expander.adb, expander.ads, exp_attr.adb, exp_ch11.adb, exp_ch13.adb, exp_ch2.adb, exp_ch3.adb, exp_ch3.ads, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_ch7.ads, exp_ch8.adb, exp_ch9.adb, exp_code.adb, exp_dbug.adb, exp_dbug.ads, exp_disp.adb, exp_dist.adb, expect.c, exp_fixd.adb, exp_imgv.adb, exp_intr.adb, exp_pakd.adb, exp_prag.adb, exp_strm.adb, exp_strm.ads, exp_tss.adb, exp_tss.ads, exp_util.adb, exp_util.ads, exp_vfpt.adb, fe.h, fmap.adb, fmap.ads, fname.adb, fname.ads, fname-uf.adb, fname-uf.ads, freeze.adb, freeze.ads, frontend.adb, g-awk.adb, g-awk.ads, g-busora.adb, g-busora.ads, g-busorg.adb, g-busorg.ads, g-casuti.adb, g-casuti.ads, g-catiio.adb, g-catiio.ads, g-cgi.adb, g-cgi.ads, g-cgicoo.adb, g-cgicoo.ads, g-cgideb.adb, g-cgideb.ads, g-comlin.adb, g-comlin.ads, g-crc32.adb, g-crc32.ads, g-debpoo.adb, g-debpoo.ads, g-debuti.adb, g-debuti.ads, g-diopit.adb, g-diopit.ads, g-dirope.adb, g-dirope.ads, g-dyntab.adb, g-dyntab.ads, g-except.ads, g-exctra.adb, g-exctra.ads, g-expect.adb, g-expect.ads, g-hesora.adb, g-hesora.ads, g-hesorg.adb, g-hesorg.ads, g-htable.adb, g-htable.ads, gigi.h, g-io.adb, g-io.ads, g-io_aux.adb, g-io_aux.ads, g-locfil.adb, g-locfil.ads, g-md5.adb, g-md5.ads, gmem.c, gnat1drv.adb, gnatbind.adb, gnatchop.adb, gnatcmd.adb, gnatfind.adb, gnatkr.adb, gnatlbr.adb, gnatlink.adb, gnatls.adb, gnatmake.adb, gnatmem.adb, gnatname.adb, gnatprep.adb, gnatprep.ads, gnatpsta.adb, gnatxref.adb, g-os_lib.adb, g-os_lib.ads, g-regexp.adb, g-regexp.ads, g-regist.adb, g-regist.ads, g-regpat.adb, g-regpat.ads, g-soccon.ads, g-socket.adb, g-socket.ads, g-socthi.adb, g-socthi.ads, g-soliop.ads, g-souinf.ads, g-speche.adb, g-speche.ads, g-spipat.adb, g-spipat.ads, g-spitbo.adb, g-spitbo.ads, g-sptabo.ads, g-sptain.ads, g-sptavs.ads, g-table.adb, g-table.ads, g-tasloc.adb, g-tasloc.ads, g-thread.adb, g-thread.ads, g-traceb.adb, g-traceb.ads, g-trasym.adb, g-trasym.ads, hostparm.ads, i-c.ads, i-cobol.adb, i-cpp.adb, i-cstrea.ads, i-cstrin.adb, i-cstrin.ads, impunit.adb, init.c, inline.adb, interfac.ads, i-pacdec.ads, itypes.adb, itypes.ads, i-vxwork.ads, lang.opt, lang-specs.h, layout.adb, lib.adb, lib.ads, lib-list.adb, lib-load.adb, lib-load.ads, lib-sort.adb, lib-util.adb, lib-writ.adb, lib-writ.ads, lib-xref.adb, lib-xref.ads, link.c, live.adb, make.adb, make.ads, Makefile.adalib, Makefile.in, Make-lang.in, makeusg.adb, mdll.adb, mdll-fil.adb, mdll-fil.ads, mdll-utl.adb, mdll-utl.ads, memroot.adb, memroot.ads, memtrack.adb, misc.c, mkdir.c, 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.adb, namet.ads, namet.h, nlists.ads, nlists.h, nmake.adt, opt.adb, opt.ads, osint.adb, osint.ads, osint-b.adb, osint-c.adb, par.adb, par-ch10.adb, par-ch11.adb, par-ch2.adb, par-ch3.adb, par-ch4.adb, par-ch5.adb, par-ch6.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, prj.adb, prj.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-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, raise.c, raise.h, repinfo.adb, repinfo.h, restrict.adb, restrict.ads, rident.ads, rtsfind.adb, rtsfind.ads, s-addima.ads, s-arit64.adb, s-assert.adb, s-assert.ads, s-atacco.adb, s-atacco.ads, s-auxdec.adb, s-auxdec.ads, s-bitops.adb, scans.ads, scn.adb, scn.ads, s-crc32.adb, s-crc32.ads, s-direio.adb, sem.adb, sem.ads, sem_aggr.adb, sem_attr.adb, sem_attr.ads, sem_case.adb, sem_case.ads, sem_cat.adb, sem_cat.ads, sem_ch10.adb, sem_ch11.adb, sem_ch12.adb, sem_ch12.ads, sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch3.ads, sem_ch4.adb, 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_disp.adb, sem_disp.ads, sem_dist.adb, sem_elab.adb, sem_eval.adb, sem_eval.ads, sem_intr.adb, sem_maps.adb, sem_mech.adb, sem_prag.adb, sem_prag.ads, sem_res.adb, sem_res.ads, sem_type.adb, sem_type.ads, sem_util.adb, sem_util.ads, sem_warn.adb, s-errrep.adb, s-errrep.ads, s-exctab.adb, s-exctab.ads, s-exnint.ads, s-exnllf.ads, s-exnlli.ads, s-expint.ads, s-explli.ads, s-expuns.ads, s-fatflt.ads, s-fatgen.adb, s-fatgen.ads, s-fatlfl.ads, s-fatllf.ads, s-fatsfl.ads, s-fileio.adb, s-fileio.ads, s-finimp.adb, s-finimp.ads, s-finroo.adb, s-finroo.ads, sfn_scan.adb, s-gloloc.adb, s-gloloc.ads, s-imgdec.adb, s-imgenu.adb, s-imgrea.adb, s-imgwch.adb, sinfo.adb, sinfo.ads, s-inmaop.ads, sinput.adb, sinput.ads, sinput-d.adb, sinput-l.adb, sinput-l.ads, sinput-p.adb, sinput-p.ads, s-interr.adb, s-interr.ads, s-intman.ads, s-maccod.ads, s-mastop.adb, s-mastop.ads, s-memory.adb, s-memory.ads, snames.adb, snames.ads, snames.h, s-osprim.ads, s-parame.ads, s-parint.ads, s-pooloc.adb, s-pooloc.ads, s-poosiz.adb, sprint.adb, s-proinf.ads, s-scaval.ads, s-secsta.adb, s-secsta.ads, s-sequio.adb, s-shasto.adb, s-shasto.ads, s-soflin.ads, s-stache.adb, s-stache.ads, s-stalib.adb, s-stalib.ads, s-stoele.ads, s-stopoo.ads, s-stratt.adb, s-stratt.ads, s-strops.adb, s-strops.ads, s-taasde.adb, s-taasde.ads, s-tadeca.adb, s-tadeca.ads, s-tadert.adb, s-tadert.ads, s-taenca.adb, s-taenca.ads, s-taprob.adb, s-taprob.ads, s-taprop.ads, s-tarest.adb, s-tarest.ads, s-tasdeb.adb, s-tasdeb.ads, s-tasinf.adb, s-tasinf.ads, s-tasini.adb, s-tasini.ads, s-taskin.adb, s-taskin.ads, s-tasque.adb, s-tasque.ads, s-tasren.adb, s-tasren.ads, s-tasres.ads, s-tassta.adb, s-tassta.ads, s-tasuti.adb, s-tasuti.ads, s-tataat.adb, s-tataat.ads, s-tpinop.adb, s-tpinop.ads, s-tpoben.adb, s-tpoben.ads, s-tpobop.adb, s-tpobop.ads, s-tposen.adb, s-tposen.ads, s-traceb.adb, s-traceb.ads, stringt.adb, stringt.ads, stringt.h, style.ads, stylesw.adb, stylesw.ads, s-unstyp.ads, s-vaflop.ads, s-valrea.adb, s-valuti.adb, s-vercon.adb, s-vmexta.adb, s-wchcnv.ads, s-wchcon.ads, s-widcha.adb, switch.adb, switch.ads, switch-b.adb, switch-c.adb, switch-m.adb, s-wwdcha.adb, s-wwdwch.adb, sysdep.c, system.ads, table.adb, table.ads, targparm.adb, targparm.ads, targtyps.c, tbuild.adb, tbuild.ads, tracebak.c, trans.c, tree_io.adb, treepr.adb, treeprs.adt, ttypes.ads, types.ads, types.h, uintp.adb, uintp.ads, uintp.h, uname.adb, urealp.adb, urealp.ads, urealp.h, usage.adb, utils2.c, utils.c, validsw.adb, validsw.ads, widechar.adb, xeinfo.adb, xnmake.adb, xref_lib.adb, xref_lib.ads, xr_tabls.adb, xr_tabls.ads, xtreeprs.adb, xsnames.adb, einfo.h, sinfo.h, treeprs.ads, nmake.ads, nmake.adb, gnatvsn.ads: Merge with ACT tree. * gnatvsn.adb: Rewritten in a simpler and more efficient way. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72751 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch9.adb')
-rw-r--r--gcc/ada/sem_ch9.adb298
1 files changed, 244 insertions, 54 deletions
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb
index 5c428aadda3..653774fdee1 100644
--- a/gcc/ada/sem_ch9.adb
+++ b/gcc/ada/sem_ch9.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -91,7 +91,7 @@ package body Sem_Ch9 is
Error_Msg_N ("expect task name for ABORT", T_Name);
return;
else
- Resolve (T_Name, Etype (T_Name));
+ Resolve (T_Name);
end if;
Next (T_Name);
@@ -113,12 +113,12 @@ package body Sem_Ch9 is
Analyze_List (Pragmas_Before (N));
end if;
- Analyze (Accept_Statement (N));
-
if Present (Condition (N)) then
Analyze_And_Resolve (Condition (N), Any_Boolean);
end if;
+ Analyze (Accept_Statement (N));
+
if Is_Non_Empty_List (Statements (N)) then
Analyze_Statements (Statements (N));
end if;
@@ -149,17 +149,21 @@ package body Sem_Ch9 is
-- local variable that renames it in the task body.
function Actual_Index_Type (E : Entity_Id) return Entity_Id is
- Typ : Entity_Id := Entry_Index_Type (E);
- Lo : Node_Id := Type_Low_Bound (Typ);
- Hi : Node_Id := Type_High_Bound (Typ);
+ Typ : constant Entity_Id := Entry_Index_Type (E);
+ Lo : constant Node_Id := Type_Low_Bound (Typ);
+ Hi : constant Node_Id := Type_High_Bound (Typ);
New_T : Entity_Id;
function Actual_Discriminant_Ref (Bound : Node_Id) return Node_Id;
-- If bound is discriminant reference, replace with corresponding
-- local variable of the same name.
+ -----------------------------
+ -- Actual_Discriminant_Ref --
+ -----------------------------
+
function Actual_Discriminant_Ref (Bound : Node_Id) return Node_Id is
- Typ : Entity_Id := Etype (Bound);
+ Typ : constant Entity_Id := Etype (Bound);
Ref : Node_Id;
begin
@@ -343,17 +347,6 @@ package body Sem_Ch9 is
Error_Msg_N ("invalid entry index in accept for simple entry", N);
end if;
- -- If statements are present, they must be analyzed in the context
- -- of the entry, so that references to formals are correctly resolved.
- -- We also have to add the declarations that are required by the
- -- expansion of the accept statement in this case if expansion active.
-
- -- In the case of a select alternative of a selective accept,
- -- the expander references the address declaration even if there
- -- is no statement list.
-
- Exp_Ch9.Expand_Accept_Declarations (N, Entry_Nam);
-
-- If label declarations present, analyze them. They are declared
-- in the enclosing task, but their enclosing scope is the entry itself,
-- so that goto's to the label are recognized as local to the accept.
@@ -380,12 +373,31 @@ package body Sem_Ch9 is
end;
end if;
- -- Set Not_Source_Assigned flag on all entry formals
+ -- If statements are present, they must be analyzed in the context
+ -- of the entry, so that references to formals are correctly resolved.
+ -- We also have to add the declarations that are required by the
+ -- expansion of the accept statement in this case if expansion active.
- E := First_Entity (Entry_Nam);
+ -- In the case of a select alternative of a selective accept,
+ -- the expander references the address declaration even if there
+ -- is no statement list.
+ -- We also need to create the renaming declarations for the local
+ -- variables that will replace references to the formals within
+ -- the accept.
+
+ Exp_Ch9.Expand_Accept_Declarations (N, Entry_Nam);
+ -- Set Never_Set_In_Source and clear Is_True_Constant/Current_Value
+ -- fields on all entry formals (this loop ignores all other entities).
+
+ E := First_Entity (Entry_Nam);
while Present (E) loop
- Set_Not_Source_Assigned (E, True);
+ if Is_Formal (E) then
+ Set_Never_Set_In_Source (E, True);
+ Set_Is_True_Constant (E, False);
+ Set_Current_Value (E, Empty);
+ end if;
+
Next_Entity (E);
end loop;
@@ -396,6 +408,7 @@ package body Sem_Ch9 is
Install_Declarations (Entry_Nam);
Set_Actual_Subtypes (N, Current_Scope);
+
Analyze (Stats);
Process_End_Label (Handled_Statement_Sequence (N), 't', Entry_Nam);
End_Scope;
@@ -418,9 +431,12 @@ package body Sem_Ch9 is
Check_Restriction (Max_Asynchronous_Select_Nesting, N);
Check_Restriction (No_Select_Statements, N);
- Analyze (Triggering_Alternative (N));
+ -- Analyze the statements. We analyze statements in the abortable part
+ -- first, because this is the section that is executed first, and that
+ -- way our remembering of saved values and checks is accurate.
Analyze_Statements (Statements (Abortable_Part (N)));
+ Analyze (Triggering_Alternative (N));
end Analyze_Asynchronous_Select;
------------------------------------
@@ -557,7 +573,65 @@ package body Sem_Ch9 is
then
Entry_Name := E;
Set_Convention (Id, Convention (E));
+ Set_Corresponding_Body (Parent (Entry_Name), Id);
Check_Fully_Conformant (Id, E, N);
+
+ if Ekind (Id) = E_Entry_Family then
+ if not Fully_Conformant_Discrete_Subtypes (
+ Discrete_Subtype_Definition (Parent (E)),
+ Discrete_Subtype_Definition
+ (Entry_Index_Specification (Formals)))
+ then
+ Error_Msg_N
+ ("index not fully conformant with previous declaration",
+ Discrete_Subtype_Definition
+ (Entry_Index_Specification (Formals)));
+
+ else
+ -- The elaboration of the entry body does not recompute
+ -- the bounds of the index, which may have side effects.
+ -- Inherit the bounds from the entry declaration. This
+ -- is critical if the entry has a per-object constraint.
+ -- If a bound is given by a discriminant, it must be
+ -- reanalyzed in order to capture the discriminal of the
+ -- current entry, rather than that of the protected type.
+
+ declare
+ Index_Spec : constant Node_Id :=
+ Entry_Index_Specification (Formals);
+
+ Def : constant Node_Id :=
+ New_Copy_Tree
+ (Discrete_Subtype_Definition (Parent (E)));
+
+ begin
+ if Nkind
+ (Original_Node
+ (Discrete_Subtype_Definition (Index_Spec))) = N_Range
+ then
+ Set_Etype (Def, Empty);
+ Set_Analyzed (Def, False);
+ Set_Discrete_Subtype_Definition (Index_Spec, Def);
+ Set_Analyzed (Low_Bound (Def), False);
+ Set_Analyzed (High_Bound (Def), False);
+
+ if Denotes_Discriminant (Low_Bound (Def)) then
+ Set_Entity (Low_Bound (Def), Empty);
+ end if;
+
+ if Denotes_Discriminant (High_Bound (Def)) then
+ Set_Entity (High_Bound (Def), Empty);
+ end if;
+
+ Analyze (Def);
+ Make_Index (Def, Index_Spec);
+ Set_Etype
+ (Defining_Identifier (Index_Spec), Etype (Def));
+ end if;
+ end;
+ end if;
+ end if;
+
exit;
end if;
@@ -603,7 +677,60 @@ package body Sem_Ch9 is
Analyze (Stats);
end if;
+ -- Check for unreferenced variables etc. Before the Check_References
+ -- call, we transfer Never_Set_In_Source and Referenced flags from
+ -- parameters in the spec to the corresponding entities in the body,
+ -- since we want the warnings on the body entities. Note that we do
+ -- not have to transfer Referenced_As_LHS, since that flag can only
+ -- be set for simple variables.
+
+ -- At the same time, we set the flags on the spec entities to suppress
+ -- any warnings on the spec formals, since we also scan the spec.
+
+ declare
+ E1 : Entity_Id;
+ E2 : Entity_Id;
+
+ begin
+ E1 := First_Entity (Entry_Name);
+ while Present (E1) loop
+ E2 := First_Entity (Id);
+ while Present (E2) loop
+ exit when Chars (E1) = Chars (E2);
+ Next_Entity (E2);
+ end loop;
+
+ -- If no matching body entity, then we already had
+ -- a detected error of some kind, so just forget
+ -- about worrying about these warnings.
+
+ if No (E2) then
+ goto Continue;
+ end if;
+
+ if Ekind (E1) = E_Out_Parameter then
+ Set_Never_Set_In_Source (E2, Never_Set_In_Source (E1));
+ Set_Never_Set_In_Source (E1, False);
+ end if;
+
+ Set_Referenced (E2, Referenced (E1));
+ Set_Referenced (E1);
+
+ <<Continue>>
+ Next_Entity (E1);
+ end loop;
+
+ Check_References (Id);
+ end;
+
+ -- We still need to check references for the spec, since objects
+ -- declared in the body are chained (in the First_Entity sense) to
+ -- the spec rather than the body in the case of entries.
+
Check_References (Entry_Name);
+
+ -- Process the end label, and terminate the scope
+
Process_End_Label (Handled_Statement_Sequence (N), 't', Entry_Name);
End_Scope;
@@ -640,7 +767,6 @@ package body Sem_Ch9 is
Process_Formals (Formals, Parent (N));
End_Scope;
end if;
-
end Analyze_Entry_Body_Formal_Part;
------------------------------------
@@ -648,6 +774,8 @@ package body Sem_Ch9 is
------------------------------------
procedure Analyze_Entry_Call_Alternative (N : Node_Id) is
+ Call : constant Node_Id := Entry_Call_Statement (N);
+
begin
Tasking_Used := True;
@@ -655,7 +783,17 @@ package body Sem_Ch9 is
Analyze_List (Pragmas_Before (N));
end if;
- Analyze (Entry_Call_Statement (N));
+ if Nkind (Call) = N_Attribute_Reference then
+
+ -- Possibly a stream attribute, but definitely illegal. Other
+ -- illegalitles, such as procedure calls, are diagnosed after
+ -- resolution.
+
+ Error_Msg_N ("entry call alternative requires an entry call", Call);
+ return;
+ end if;
+
+ Analyze (Call);
if Is_Non_Empty_List (Statements (N)) then
Analyze_Statements (Statements (N));
@@ -667,9 +805,9 @@ package body Sem_Ch9 is
-------------------------------
procedure Analyze_Entry_Declaration (N : Node_Id) is
- Id : Entity_Id := Defining_Identifier (N);
- D_Sdef : Node_Id := Discrete_Subtype_Definition (N);
- Formals : List_Id := Parameter_Specifications (N);
+ Formals : constant List_Id := Parameter_Specifications (N);
+ Id : constant Entity_Id := Defining_Identifier (N);
+ D_Sdef : constant Node_Id := Discrete_Subtype_Definition (N);
begin
Generate_Definition (Id);
@@ -699,7 +837,6 @@ package body Sem_Ch9 is
if Ekind (Id) = E_Entry then
New_Overloaded_Entity (Id);
end if;
-
end Analyze_Entry_Declaration;
---------------------------------------
@@ -717,16 +854,25 @@ package body Sem_Ch9 is
-- be knwown to routines that process entry families.
procedure Analyze_Entry_Index_Specification (N : Node_Id) is
- Iden : constant Node_Id := Defining_Identifier (N);
- Def : constant Node_Id := Discrete_Subtype_Definition (N);
- Loop_Id : Entity_Id :=
+ Iden : constant Node_Id := Defining_Identifier (N);
+ Def : constant Node_Id := Discrete_Subtype_Definition (N);
+ Loop_Id : constant Entity_Id :=
Make_Defining_Identifier (Sloc (N),
Chars => New_Internal_Name ('L'));
begin
Tasking_Used := True;
Analyze (Def);
- Make_Index (Def, N);
+
+ -- There is no elaboration of the entry index specification. Therefore,
+ -- if the index is a range, it is not resolved and expanded, but the
+ -- bounds are inherited from the entry declaration, and reanalyzed.
+ -- See Analyze_Entry_Body.
+
+ if Nkind (Def) /= N_Range then
+ Make_Index (Def, N);
+ end if;
+
Set_Ekind (Loop_Id, E_Loop);
Set_Scope (Loop_Id, Current_Scope);
New_Scope (Loop_Id);
@@ -875,6 +1021,11 @@ package body Sem_Ch9 is
Def_Id : constant Entity_Id := Defining_Identifier (N);
begin
+ if No_Run_Time_Mode then
+ Error_Msg_CRT ("protected type", N);
+ return;
+ end if;
+
Tasking_Used := True;
Check_Restriction (No_Protected_Types, N);
@@ -890,7 +1041,7 @@ package body Sem_Ch9 is
Set_Etype (T, T);
Set_Is_First_Subtype (T, True);
Set_Has_Delayed_Freeze (T, True);
- Set_Girder_Constraint (T, No_Elist);
+ Set_Stored_Constraint (T, No_Elist);
New_Scope (T);
if Present (Discriminant_Specifications (N)) then
@@ -946,7 +1097,6 @@ package body Sem_Ch9 is
Exp_Ch9.Expand_N_Protected_Type_Declaration (N);
Process_Full_View (N, T, Def_Id);
end if;
-
end Analyze_Protected_Type;
---------------------
@@ -997,9 +1147,9 @@ package body Sem_Ch9 is
-- the restrictions of 9.5.4(6).
if Present (Target_Obj) then
- -- Locate containing concurrent unit and determine
- -- enclosing entry body or outermost enclosing accept
- -- statement within the unit.
+
+ -- Locate containing concurrent unit and determine enclosing entry
+ -- body or outermost enclosing accept statement within the unit.
Outer_Ent := Empty;
for S in reverse 0 .. Scope_Stack.Last loop
@@ -1039,7 +1189,6 @@ package body Sem_Ch9 is
Entry_Id := Empty;
while Present (It.Nam) loop
-
if No (First_Formal (It.Nam))
or else Subtype_Conformant (Enclosing, It.Nam)
then
@@ -1107,34 +1256,51 @@ package body Sem_Ch9 is
if not Is_Entry (Entry_Id) then
Error_Msg_N ("expect entry name in requeue statement", Name (N));
elsif Ekind (Entry_Id) = E_Entry_Family
-
and then Nkind (Entry_Name) /= N_Indexed_Component
then
Error_Msg_N ("missing index for entry family component", Name (N));
else
Resolve_Entry (Name (N));
+ Generate_Reference (Entry_Id, Entry_Name);
if Present (First_Formal (Entry_Id)) then
Check_Subtype_Conformant (Enclosing, Entry_Id, Name (N));
- -- Mark any output parameters as assigned
+ -- Processing for parameters accessed by the requeue
declare
Ent : Entity_Id := First_Formal (Enclosing);
begin
while Present (Ent) loop
- if Ekind (Ent) = E_Out_Parameter then
- Set_Not_Source_Assigned (Ent, False);
+
+ -- For OUT or IN OUT parameter, the effect of the requeue
+ -- is to assign the parameter a value on exit from the
+ -- requeued body, so we can set it as source assigned.
+ -- We also clear the Is_True_Constant indication. We do
+ -- not need to clear Current_Value, since the effect of
+ -- the requeue is to perform an unconditional goto so
+ -- that any further references will not occur anyway.
+
+ if Ekind (Ent) = E_Out_Parameter
+ or else
+ Ekind (Ent) = E_In_Out_Parameter
+ then
+ Set_Never_Set_In_Source (Ent, False);
+ Set_Is_True_Constant (Ent, False);
end if;
+ -- For all parameters, the requeue acts as a reference,
+ -- since the value of the parameter is passed to the
+ -- new entry, so we want to suppress unreferenced warnings.
+
+ Set_Referenced (Ent);
Next_Formal (Ent);
end loop;
end;
end if;
end if;
-
end Analyze_Requeue;
------------------------------
@@ -1153,6 +1319,7 @@ package body Sem_Ch9 is
begin
Check_Restriction (No_Select_Statements, N);
+ Check_Restriction (Max_Select_Alternatives, N);
Tasking_Used := True;
Alt := First (Alts);
@@ -1163,8 +1330,8 @@ package body Sem_Ch9 is
if Nkind (Alt) = N_Delay_Alternative then
if Delay_Present then
- if (Relative_Present /=
- (Nkind (Delay_Statement (Alt)) = N_Delay_Relative_Statement))
+ if Relative_Present /=
+ (Nkind (Delay_Statement (Alt)) = N_Delay_Relative_Statement)
then
Error_Msg_N
("delay_until and delay_relative alternatives ", Alt);
@@ -1410,6 +1577,17 @@ package body Sem_Ch9 is
return;
end if;
+ if Has_Completion (Spec_Id)
+ and then Present (Corresponding_Body (Parent (Spec_Id)))
+ then
+ if Nkind (Parent (Spec_Id)) = N_Task_Type_Declaration then
+ Error_Msg_NE ("duplicate body for task type&", N, Spec_Id);
+
+ else
+ Error_Msg_NE ("duplicate body for task&", N, Spec_Id);
+ end if;
+ end if;
+
Ref_Id := Spec_Id;
Generate_Reference (Ref_Id, Body_Id, 'b', Set_Ref => False);
Style.Check_Identifier (Body_Id, Spec_Id);
@@ -1444,6 +1622,7 @@ package body Sem_Ch9 is
Analyze (Handled_Statement_Sequence (N));
Check_Completion (Body_Id);
Check_References (Body_Id);
+ Check_References (Spec_Id);
-- Check for entries with no corresponding accept
@@ -1510,7 +1689,6 @@ package body Sem_Ch9 is
begin
Tasking_Used := True;
- Check_Restriction (Max_Tasks, N);
Check_Restriction (No_Tasking, N);
T := Find_Type_Name (N);
Generate_Definition (T);
@@ -1526,7 +1704,7 @@ package body Sem_Ch9 is
Init_Size_Align (T);
Set_Etype (T, T);
Set_Has_Delayed_Freeze (T, True);
- Set_Girder_Constraint (T, No_Elist);
+ Set_Stored_Constraint (T, No_Elist);
New_Scope (T);
if Present (Discriminant_Specifications (N)) then
@@ -1599,7 +1777,8 @@ package body Sem_Ch9 is
------------------------------------
procedure Analyze_Triggering_Alternative (N : Node_Id) is
- Trigger : Node_Id := Triggering_Statement (N);
+ Trigger : constant Node_Id := Triggering_Statement (N);
+
begin
Tasking_Used := True;
@@ -1632,6 +1811,10 @@ package body Sem_Ch9 is
procedure Count (L : List_Id);
-- Count entries in given declaration list
+ -----------
+ -- Count --
+ -----------
+
procedure Count (L : List_Id) is
D : Node_Id;
@@ -1648,9 +1831,13 @@ package body Sem_Ch9 is
Discrete_Subtype_Definition (D);
begin
+ -- If not an entry family, then just one entry
+
if No (DSD) then
Ecount := Ecount + 1;
+ -- If entry family with static bounds, count entries
+
elsif Is_OK_Static_Subtype (Etype (DSD)) then
declare
Lo : constant Uint :=
@@ -1666,7 +1853,9 @@ package body Sem_Ch9 is
end if;
end;
- else
+ -- If entry family with non-static bounds, give error msg
+
+ elsif Restriction_Parameters (R) /= No_Uint then
Error_Msg_N
("static subtype required by Restriction pragma", DSD);
end if;
@@ -1680,10 +1869,11 @@ package body Sem_Ch9 is
-- Start of processing for Check_Max_Entries
begin
- if Restriction_Parameters (R) >= 0 then
- Ecount := Uint_0;
- Count (Visible_Declarations (Def));
- Count (Private_Declarations (Def));
+ Ecount := Uint_0;
+ Count (Visible_Declarations (Def));
+ Count (Private_Declarations (Def));
+
+ if Ecount > 0 then
Check_Restriction (R, Ecount, Def);
end if;
end Check_Max_Entries;