bcea76b65d
* 1aexcept.adb, 1aexcept.ads, 1ic.ads, 1ssecsta.adb, 1ssecsta.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, 4dintnam.ads, 4gintnam.ads, 4hexcpol.adb, 4hintnam.ads, 4lintnam.ads, 4mintnam.ads, 4nintnam.ads, 4ointnam.ads, 4onumaux.ads, 4pintnam.ads, 4rintnam.ads, 4sintnam.ads, 4uintnam.ads, 4vcaldel.adb, 4vcalend.adb, 4vcalend.ads, 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, 54osinte.ads, 5amastop.adb, 5aosinte.adb, 5aosinte.ads, 5asystem.ads, 5ataprop.adb, 5atasinf.ads, 5ataspri.ads, 5atpopsp.adb, 5avxwork.ads, 5bosinte.adb, 5bosinte.ads, 5bsystem.ads, 5cosinte.ads, 5dosinte.ads, 5esystem.ads, 5etpopse.adb, 5fintman.adb, 5fosinte.ads, 5fsystem.ads, 5ftaprop.adb, 5ftasinf.ads, 5ginterr.adb, 5gintman.adb, 5gmastop.adb, 5gosinte.ads, 5gproinf.adb, 5gproinf.ads, 5gsystem.ads, 5gtaprop.adb, 5gtasinf.adb, 5gtasinf.ads, 5gtpgetc.adb, 5hosinte.adb, 5hosinte.ads, 5hparame.ads, 5hsystem.ads, 5htaprop.adb, 5htaspri.ads, 5htraceb.adb, 5iosinte.adb, 5iosinte.ads, 5itaprop.adb, 5itaspri.ads, 5ksystem.ads, 5kvxwork.ads, 5lintman.adb, 5lml-tgt.adb, 5losinte.ads, 5lsystem.ads, 5mosinte.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, 5qosinte.adb, 5qosinte.ads, 5qstache.adb, 5qtaprop.adb, 5qtaspri.ads, 5rosinte.adb, 5rosinte.ads, 5rparame.adb, 5sintman.adb, 5sosinte.adb, 5sosinte.ads, 5sparame.adb, 5ssystem.ads, 5staprop.adb, 5stasinf.adb, 5stasinf.ads, 5staspri.ads, 5stpopse.adb, 5svxwork.ads, 5tosinte.ads, 5uintman.adb, 5uosinte.ads, 5vasthan.adb, 5vinmaop.adb, 5vinterr.adb, 5vintman.adb, 5vintman.ads, 5vmastop.adb, 5vosinte.adb, 5vosinte.ads, 5vosprim.adb, 5vosprim.ads, 5vparame.ads, 5vsystem.ads, 5vtaprop.adb, 5vtaspri.ads, 5vtpopde.adb, 5vtpopde.ads, 5vvaflop.adb, 5wgloloc.adb, 5wintman.adb, 5wmemory.adb, 5wosinte.ads, 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, 86numaux.adb, 86numaux.ads, 9drpc.adb, a-astaco.adb, a-astaco.ads, a-caldel.adb, a-caldel.ads, a-calend.adb, a-calend.ads, a-chahan.adb, a-chahan.ads, a-charac.ads, a-chlat1.ads, a-chlat9.ads, a-colien.adb, a-colien.ads, a-colire.adb, a-colire.ads, a-comlin.adb, a-comlin.ads, a-cwila1.ads, a-cwila9.ads, a-decima.adb, a-decima.ads, a-diocst.adb, a-diocst.ads, a-direio.adb, a-direio.ads, a-dynpri.adb, a-dynpri.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-flteio.ads, a-fwteio.ads, a-inteio.ads, a-interr.adb, a-interr.ads, a-intnam.ads, a-intsig.adb, a-intsig.ads, a-ioexce.ads, a-iwteio.ads, a-lfteio.ads, a-lfwtio.ads, a-liteio.ads, a-liwtio.ads, a-llftio.ads, a-llfwti.ads, a-llitio.ads, a-lliwti.ads, a-ncelfu.ads, a-ngcefu.adb, a-ngcefu.ads, a-ngcoty.adb, a-ngcoty.ads, a-ngelfu.adb, a-ngelfu.ads, a-nlcefu.ads, a-nlcoty.ads, a-nlelfu.ads, a-nllcef.ads, a-nllcty.ads, a-nllefu.ads, a-nscefu.ads, a-nscoty.ads, a-nselfu.ads, a-nucoty.ads, a-nudira.adb, a-nudira.ads, a-nuelfu.ads, a-nuflra.adb, a-nuflra.ads, a-numaux.ads, a-numeri.ads, a-reatim.adb, a-reatim.ads, a-retide.adb, a-retide.ads, a-sequio.adb, a-sequio.ads, a-sfteio.ads, a-sfwtio.ads, a-siocst.adb, a-siocst.ads, a-siteio.ads, a-siwtio.ads, a-ssicst.adb, a-ssicst.ads, a-ssitio.ads, a-ssiwti.ads, a-stmaco.ads, a-storio.adb, a-storio.ads, a-strbou.adb, a-strbou.ads, a-stream.ads, a-strfix.adb, a-strfix.ads, a-string.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-stwifi.ads, 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.adb, 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-titest.ads, a-unccon.ads, a-uncdea.ads, a-witeio.adb, a-witeio.ads, a-wtcoau.adb, a-wtcoau.ads, a-wtcoio.adb, a-wtcoio.ads, 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-wtinio.ads, a-wtmoau.adb, a-wtmoau.ads, a-wtmoio.adb, a-wtmoio.ads, a-wttest.adb, a-wttest.ads, ada-tree.h, ada.ads, ada.h, adadecode.c, adadecode.h, ali-util.adb, ali-util.ads, ali.adb, ali.ads, alloc.ads, argv.c, atree.adb, atree.ads, atree.h, aux-io.c, 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, calendar.ads, casing.adb, casing.ads, ceinfo.adb, checks.adb, checks.ads, cio.c, comperr.adb, comperr.ads, config-lang.in, csets.adb, csets.ads, csinfo.adb, cstand.adb, cstand.ads, cuintp.c, debug.adb, debug.ads, debug_a.adb, debug_a.ads, dec-io.adb, dec-io.ads, dec.ads, deftarg.c, directio.ads, einfo.adb, einfo.ads, 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, 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-awk.adb, g-awk.ads, g-busora.adb, g-busora.ads, g-busorg.adb, g-busorg.ads, g-calend.adb, g-calend.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-curexc.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-enblsp.adb, g-except.ads, g-exctra.adb, g-exctra.ads, g-expect.adb, g-expect.ads, g-flocon.ads, g-hesora.adb, g-hesora.ads, g-hesorg.adb, g-hesorg.ads, g-htable.adb, g-htable.ads, g-io.adb, g-io.ads, g-io_aux.adb, g-io_aux.ads, g-locfil.ads, g-md5.adb, g-md5.ads, g-moreex.adb, g-moreex.ads, g-os_lib.adb, g-os_lib.ads, g-regexp.adb, g-regexp.ads, 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, get_targ.adb, get_targ.ads, gnat-style.texi, gnat.ads, gnat1drv.adb, gnat1drv.ads, gnatbind.adb, gnatbind.ads, gnatbl.c, gnatchop.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, gnatpsta.adb, gnatvsn.adb, gnatvsn.ads, gnatxref.adb, hlo.adb, hlo.ads, hostparm.ads, i-c.adb, i-c.ads, 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-fortra.ads, i-os2err.ads, i-os2lib.adb, i-os2lib.ads, i-os2syn.ads, i-os2thr.ads, i-pacdec.adb, i-pacdec.ads, i-vxwork.ads, impunit.adb, impunit.ads, inline.adb, inline.ads, interfac.ads, ioexcept.ads, itypes.adb, itypes.ads, krunch.adb, krunch.ads, 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, live.adb, live.ads, machcode.ads, make.adb, make.ads, makeusg.adb, makeusg.ads, math_lib.adb, mdll-fil.adb, mdll-fil.ads, mdll-utl.adb, mdll-utl.ads, mdll.adb, mdll.ads, memroot.adb, memroot.ads, memtrack.adb, mlib-fil.adb, mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads, mlib-utl.adb, mlib-utl.ads, mlib.adb, mlib.ads, namet.adb, namet.ads, nlists.adb, nlists.ads, opt.adb, opt.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, 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-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, prj.adb, prj.ads, repinfo.adb, repinfo.ads, 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-atacco.ads, s-auxdec.adb, s-auxdec.ads, s-bitops.adb, s-bitops.ads, s-chepoo.ads, s-crc32.adb, s-crc32.ads, s-direio.adb, s-direio.ads, s-errrep.adb, s-errrep.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-gloloc.adb, s-gloloc.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-mastop.adb, s-mastop.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-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, s-traces.adb, s-traces.ads, s-tratas.adb, s-tratas.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, sequenio.ads, sfn_scan.adb, sfn_scan.ads, sinfo-cn.adb, sinfo-cn.ads, sinfo.adb, sinfo.ads, sinput-d.adb, sinput-d.ads, sinput-l.adb, sinput-l.ads, sinput-p.adb, sinput-p.ads, sinput.adb, sinput.ads, snames.adb, snames.ads, sprint.adb, sprint.ads, stand.adb, stand.ads, stringt.adb, stringt.ads, style.adb, style.ads, stylesw.adb, stylesw.ads, switch-b.adb, switch-b.ads, switch-c.adb, switch-c.ads, switch-m.adb, switch-m.ads, switch.adb, switch.ads, system.ads, table.adb, table.ads, targparm.adb, targparm.ads, tbuild.adb, tbuild.ads, text_io.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, ttypef.ads, ttypes.ads, types.adb, types.ads, uintp.adb, uintp.ads, uname.adb, uname.ads, unchconv.ads, unchdeal.ads, urealp.adb, urealp.ads, usage.adb, usage.ads, 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 : Merge header, formatting and other trivial changes from ACT. From-SVN: r66044
1730 lines
53 KiB
Ada
1730 lines
53 KiB
Ada
------------------------------------------------------------------------------
|
|
-- --
|
|
-- GNAT COMPILER COMPONENTS --
|
|
-- --
|
|
-- S E M _ C H 9 --
|
|
-- --
|
|
-- B o d y --
|
|
-- --
|
|
-- Copyright (C) 1992-2002, 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- --
|
|
-- ware Foundation; either version 2, or (at your option) any later ver- --
|
|
-- 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 --
|
|
-- Public License distributed with GNAT; see file COPYING. If not, write --
|
|
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
|
|
-- MA 02111-1307, USA. --
|
|
-- --
|
|
-- GNAT was originally developed by the GNAT team at New York University. --
|
|
-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
|
-- --
|
|
------------------------------------------------------------------------------
|
|
|
|
with Atree; use Atree;
|
|
with Checks; use Checks;
|
|
with Einfo; use Einfo;
|
|
with Errout; use Errout;
|
|
with Exp_Ch9;
|
|
with Elists; use Elists;
|
|
with Itypes; use Itypes;
|
|
with Lib.Xref; use Lib.Xref;
|
|
with Nlists; use Nlists;
|
|
with Nmake; use Nmake;
|
|
with Opt; use Opt;
|
|
with Restrict; use Restrict;
|
|
with Rtsfind; use Rtsfind;
|
|
with Sem; use Sem;
|
|
with Sem_Ch3; use Sem_Ch3;
|
|
with Sem_Ch5; use Sem_Ch5;
|
|
with Sem_Ch6; use Sem_Ch6;
|
|
with Sem_Ch8; use Sem_Ch8;
|
|
with Sem_Eval; use Sem_Eval;
|
|
with Sem_Res; use Sem_Res;
|
|
with Sem_Type; use Sem_Type;
|
|
with Sem_Util; use Sem_Util;
|
|
with Sem_Warn; use Sem_Warn;
|
|
with Snames; use Snames;
|
|
with Stand; use Stand;
|
|
with Sinfo; use Sinfo;
|
|
with Style;
|
|
with Tbuild; use Tbuild;
|
|
with Uintp; use Uintp;
|
|
|
|
package body Sem_Ch9 is
|
|
|
|
-----------------------
|
|
-- Local Subprograms --
|
|
-----------------------
|
|
|
|
procedure Check_Max_Entries (Def : Node_Id; R : Restriction_Parameter_Id);
|
|
-- Given either a protected definition or a task definition in Def, check
|
|
-- the corresponding restriction parameter identifier R, and if it is set,
|
|
-- count the entries (checking the static requirement), and compare with
|
|
-- the given maximum.
|
|
|
|
function Find_Concurrent_Spec (Body_Id : Entity_Id) return Entity_Id;
|
|
-- Find entity in corresponding task or protected declaration. Use full
|
|
-- view if first declaration was for an incomplete type.
|
|
|
|
procedure Install_Declarations (Spec : Entity_Id);
|
|
-- Utility to make visible in corresponding body the entities defined
|
|
-- in task, protected type declaration, or entry declaration.
|
|
|
|
-----------------------------
|
|
-- Analyze_Abort_Statement --
|
|
-----------------------------
|
|
|
|
procedure Analyze_Abort_Statement (N : Node_Id) is
|
|
T_Name : Node_Id;
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
T_Name := First (Names (N));
|
|
while Present (T_Name) loop
|
|
Analyze (T_Name);
|
|
|
|
if not Is_Task_Type (Etype (T_Name)) then
|
|
Error_Msg_N ("expect task name for ABORT", T_Name);
|
|
return;
|
|
else
|
|
Resolve (T_Name, Etype (T_Name));
|
|
end if;
|
|
|
|
Next (T_Name);
|
|
end loop;
|
|
|
|
Check_Restriction (No_Abort_Statements, N);
|
|
Check_Potentially_Blocking_Operation (N);
|
|
end Analyze_Abort_Statement;
|
|
|
|
--------------------------------
|
|
-- Analyze_Accept_Alternative --
|
|
--------------------------------
|
|
|
|
procedure Analyze_Accept_Alternative (N : Node_Id) is
|
|
begin
|
|
Tasking_Used := True;
|
|
|
|
if Present (Pragmas_Before (N)) then
|
|
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;
|
|
|
|
if Is_Non_Empty_List (Statements (N)) then
|
|
Analyze_Statements (Statements (N));
|
|
end if;
|
|
end Analyze_Accept_Alternative;
|
|
|
|
------------------------------
|
|
-- Analyze_Accept_Statement --
|
|
------------------------------
|
|
|
|
procedure Analyze_Accept_Statement (N : Node_Id) is
|
|
Nam : constant Entity_Id := Entry_Direct_Name (N);
|
|
Formals : constant List_Id := Parameter_Specifications (N);
|
|
Index : constant Node_Id := Entry_Index (N);
|
|
Stats : constant Node_Id := Handled_Statement_Sequence (N);
|
|
Ityp : Entity_Id;
|
|
Entry_Nam : Entity_Id;
|
|
E : Entity_Id;
|
|
Kind : Entity_Kind;
|
|
Task_Nam : Entity_Id;
|
|
|
|
-----------------------
|
|
-- Actual_Index_Type --
|
|
-----------------------
|
|
|
|
function Actual_Index_Type (E : Entity_Id) return Entity_Id;
|
|
-- If the bounds of an entry family depend on task discriminants,
|
|
-- create a new index type where a discriminant is replaced by the
|
|
-- 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);
|
|
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.
|
|
|
|
function Actual_Discriminant_Ref (Bound : Node_Id) return Node_Id is
|
|
Typ : Entity_Id := Etype (Bound);
|
|
Ref : Node_Id;
|
|
|
|
begin
|
|
if not Is_Entity_Name (Bound)
|
|
or else Ekind (Entity (Bound)) /= E_Discriminant
|
|
then
|
|
return Bound;
|
|
|
|
else
|
|
Ref := Make_Identifier (Sloc (N), Chars (Entity (Bound)));
|
|
Analyze (Ref);
|
|
Resolve (Ref, Typ);
|
|
return Ref;
|
|
end if;
|
|
end Actual_Discriminant_Ref;
|
|
|
|
-- Start of processing for Actual_Index_Type
|
|
|
|
begin
|
|
if not Has_Discriminants (Task_Nam)
|
|
or else (not Is_Entity_Name (Lo)
|
|
and then not Is_Entity_Name (Hi))
|
|
then
|
|
return Entry_Index_Type (E);
|
|
else
|
|
New_T := Create_Itype (Ekind (Typ), N);
|
|
Set_Etype (New_T, Base_Type (Typ));
|
|
Set_Size_Info (New_T, Typ);
|
|
Set_RM_Size (New_T, RM_Size (Typ));
|
|
Set_Scalar_Range (New_T,
|
|
Make_Range (Sloc (N),
|
|
Low_Bound => Actual_Discriminant_Ref (Lo),
|
|
High_Bound => Actual_Discriminant_Ref (Hi)));
|
|
|
|
return New_T;
|
|
end if;
|
|
end Actual_Index_Type;
|
|
|
|
-- Start of processing for Analyze_Accept_Statement
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
|
|
-- Entry name is initialized to Any_Id. It should get reset to the
|
|
-- matching entry entity. An error is signalled if it is not reset.
|
|
|
|
Entry_Nam := Any_Id;
|
|
|
|
for J in reverse 0 .. Scope_Stack.Last loop
|
|
Task_Nam := Scope_Stack.Table (J).Entity;
|
|
exit when Ekind (Etype (Task_Nam)) = E_Task_Type;
|
|
Kind := Ekind (Task_Nam);
|
|
|
|
if Kind /= E_Block and then Kind /= E_Loop
|
|
and then not Is_Entry (Task_Nam)
|
|
then
|
|
Error_Msg_N ("enclosing body of accept must be a task", N);
|
|
return;
|
|
end if;
|
|
end loop;
|
|
|
|
if Ekind (Etype (Task_Nam)) /= E_Task_Type then
|
|
Error_Msg_N ("invalid context for accept statement", N);
|
|
return;
|
|
end if;
|
|
|
|
-- In order to process the parameters, we create a defining
|
|
-- identifier that can be used as the name of the scope. The
|
|
-- name of the accept statement itself is not a defining identifier.
|
|
|
|
if Present (Index) then
|
|
Ityp := New_Internal_Entity
|
|
(E_Entry_Family, Current_Scope, Sloc (N), 'E');
|
|
else
|
|
Ityp := New_Internal_Entity
|
|
(E_Entry, Current_Scope, Sloc (N), 'E');
|
|
end if;
|
|
|
|
Set_Etype (Ityp, Standard_Void_Type);
|
|
Set_Accept_Address (Ityp, New_Elmt_List);
|
|
|
|
if Present (Formals) then
|
|
New_Scope (Ityp);
|
|
Process_Formals (Formals, N);
|
|
Create_Extra_Formals (Ityp);
|
|
End_Scope;
|
|
end if;
|
|
|
|
-- We set the default expressions processed flag because we don't
|
|
-- need default expression functions. This is really more like a
|
|
-- body entity than a spec entity anyway.
|
|
|
|
Set_Default_Expressions_Processed (Ityp);
|
|
|
|
E := First_Entity (Etype (Task_Nam));
|
|
|
|
while Present (E) loop
|
|
if Chars (E) = Chars (Nam)
|
|
and then (Ekind (E) = Ekind (Ityp))
|
|
and then Type_Conformant (Ityp, E)
|
|
then
|
|
Entry_Nam := E;
|
|
exit;
|
|
end if;
|
|
|
|
Next_Entity (E);
|
|
end loop;
|
|
|
|
if Entry_Nam = Any_Id then
|
|
Error_Msg_N ("no entry declaration matches accept statement", N);
|
|
return;
|
|
else
|
|
Set_Entity (Nam, Entry_Nam);
|
|
Generate_Reference (Entry_Nam, Nam, 'b', Set_Ref => False);
|
|
Style.Check_Identifier (Nam, Entry_Nam);
|
|
end if;
|
|
|
|
-- Verify that the entry is not hidden by a procedure declared in
|
|
-- the current block (pathological but possible).
|
|
|
|
if Current_Scope /= Task_Nam then
|
|
declare
|
|
E1 : Entity_Id;
|
|
|
|
begin
|
|
E1 := First_Entity (Current_Scope);
|
|
|
|
while Present (E1) loop
|
|
|
|
if Ekind (E1) = E_Procedure
|
|
and then Type_Conformant (E1, Entry_Nam)
|
|
then
|
|
Error_Msg_N ("entry name is not visible", N);
|
|
end if;
|
|
|
|
Next_Entity (E1);
|
|
end loop;
|
|
end;
|
|
end if;
|
|
|
|
Set_Convention (Ityp, Convention (Entry_Nam));
|
|
Check_Fully_Conformant (Ityp, Entry_Nam, N);
|
|
|
|
for J in reverse 0 .. Scope_Stack.Last loop
|
|
exit when Task_Nam = Scope_Stack.Table (J).Entity;
|
|
|
|
if Entry_Nam = Scope_Stack.Table (J).Entity then
|
|
Error_Msg_N ("duplicate accept statement for same entry", N);
|
|
end if;
|
|
|
|
end loop;
|
|
|
|
declare
|
|
P : Node_Id := N;
|
|
begin
|
|
loop
|
|
P := Parent (P);
|
|
case Nkind (P) is
|
|
when N_Task_Body | N_Compilation_Unit =>
|
|
exit;
|
|
when N_Asynchronous_Select =>
|
|
Error_Msg_N ("accept statements are not allowed within" &
|
|
" an asynchronous select inner" &
|
|
" to the enclosing task body", N);
|
|
exit;
|
|
when others =>
|
|
null;
|
|
end case;
|
|
end loop;
|
|
end;
|
|
|
|
if Ekind (E) = E_Entry_Family then
|
|
if No (Index) then
|
|
Error_Msg_N ("missing entry index in accept for entry family", N);
|
|
else
|
|
Analyze_And_Resolve (Index, Entry_Index_Type (E));
|
|
Apply_Range_Check (Index, Actual_Index_Type (E));
|
|
end if;
|
|
|
|
elsif Present (Index) then
|
|
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.
|
|
|
|
if Present (Declarations (N)) then
|
|
|
|
declare
|
|
Decl : Node_Id;
|
|
Id : Entity_Id;
|
|
|
|
begin
|
|
Decl := First (Declarations (N));
|
|
|
|
while Present (Decl) loop
|
|
Analyze (Decl);
|
|
|
|
pragma Assert
|
|
(Nkind (Decl) = N_Implicit_Label_Declaration);
|
|
|
|
Id := Defining_Identifier (Decl);
|
|
Set_Enclosing_Scope (Id, Entry_Nam);
|
|
Next (Decl);
|
|
end loop;
|
|
end;
|
|
end if;
|
|
|
|
-- Set Not_Source_Assigned flag on all entry formals
|
|
|
|
E := First_Entity (Entry_Nam);
|
|
|
|
while Present (E) loop
|
|
Set_Not_Source_Assigned (E, True);
|
|
Next_Entity (E);
|
|
end loop;
|
|
|
|
-- Analyze statements if present
|
|
|
|
if Present (Stats) then
|
|
New_Scope (Entry_Nam);
|
|
Install_Declarations (Entry_Nam);
|
|
|
|
Set_Actual_Subtypes (N, Current_Scope);
|
|
Analyze (Stats);
|
|
Process_End_Label (Handled_Statement_Sequence (N), 't', Entry_Nam);
|
|
End_Scope;
|
|
end if;
|
|
|
|
-- Some warning checks
|
|
|
|
Check_Potentially_Blocking_Operation (N);
|
|
Check_References (Entry_Nam, N);
|
|
Set_Entry_Accepted (Entry_Nam);
|
|
end Analyze_Accept_Statement;
|
|
|
|
---------------------------------
|
|
-- Analyze_Asynchronous_Select --
|
|
---------------------------------
|
|
|
|
procedure Analyze_Asynchronous_Select (N : Node_Id) is
|
|
begin
|
|
Tasking_Used := True;
|
|
Check_Restriction (Max_Asynchronous_Select_Nesting, N);
|
|
Check_Restriction (No_Select_Statements, N);
|
|
|
|
Analyze (Triggering_Alternative (N));
|
|
|
|
Analyze_Statements (Statements (Abortable_Part (N)));
|
|
end Analyze_Asynchronous_Select;
|
|
|
|
------------------------------------
|
|
-- Analyze_Conditional_Entry_Call --
|
|
------------------------------------
|
|
|
|
procedure Analyze_Conditional_Entry_Call (N : Node_Id) is
|
|
begin
|
|
Check_Restriction (No_Select_Statements, N);
|
|
Tasking_Used := True;
|
|
Analyze (Entry_Call_Alternative (N));
|
|
Analyze_Statements (Else_Statements (N));
|
|
end Analyze_Conditional_Entry_Call;
|
|
|
|
--------------------------------
|
|
-- Analyze_Delay_Alternative --
|
|
--------------------------------
|
|
|
|
procedure Analyze_Delay_Alternative (N : Node_Id) is
|
|
Expr : Node_Id;
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
Check_Restriction (No_Delay, N);
|
|
|
|
if Present (Pragmas_Before (N)) then
|
|
Analyze_List (Pragmas_Before (N));
|
|
end if;
|
|
|
|
if Nkind (Parent (N)) = N_Selective_Accept
|
|
or else Nkind (Parent (N)) = N_Timed_Entry_Call
|
|
then
|
|
Expr := Expression (Delay_Statement (N));
|
|
|
|
-- defer full analysis until the statement is expanded, to insure
|
|
-- that generated code does not move past the guard. The delay
|
|
-- expression is only evaluated if the guard is open.
|
|
|
|
if Nkind (Delay_Statement (N)) = N_Delay_Relative_Statement then
|
|
Pre_Analyze_And_Resolve (Expr, Standard_Duration);
|
|
|
|
else
|
|
Pre_Analyze_And_Resolve (Expr);
|
|
end if;
|
|
|
|
Check_Restriction (No_Fixed_Point, Expr);
|
|
else
|
|
Analyze (Delay_Statement (N));
|
|
end if;
|
|
|
|
if Present (Condition (N)) then
|
|
Analyze_And_Resolve (Condition (N), Any_Boolean);
|
|
end if;
|
|
|
|
if Is_Non_Empty_List (Statements (N)) then
|
|
Analyze_Statements (Statements (N));
|
|
end if;
|
|
end Analyze_Delay_Alternative;
|
|
|
|
----------------------------
|
|
-- Analyze_Delay_Relative --
|
|
----------------------------
|
|
|
|
procedure Analyze_Delay_Relative (N : Node_Id) is
|
|
E : constant Node_Id := Expression (N);
|
|
|
|
begin
|
|
Check_Restriction (No_Relative_Delay, N);
|
|
Tasking_Used := True;
|
|
Check_Restriction (No_Delay, N);
|
|
Check_Potentially_Blocking_Operation (N);
|
|
Analyze_And_Resolve (E, Standard_Duration);
|
|
Check_Restriction (No_Fixed_Point, E);
|
|
end Analyze_Delay_Relative;
|
|
|
|
-------------------------
|
|
-- Analyze_Delay_Until --
|
|
-------------------------
|
|
|
|
procedure Analyze_Delay_Until (N : Node_Id) is
|
|
E : constant Node_Id := Expression (N);
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
Check_Restriction (No_Delay, N);
|
|
Check_Potentially_Blocking_Operation (N);
|
|
Analyze (E);
|
|
|
|
if not Is_RTE (Base_Type (Etype (E)), RO_CA_Time) and then
|
|
not Is_RTE (Base_Type (Etype (E)), RO_RT_Time)
|
|
then
|
|
Error_Msg_N ("expect Time types for `DELAY UNTIL`", E);
|
|
end if;
|
|
end Analyze_Delay_Until;
|
|
|
|
------------------------
|
|
-- Analyze_Entry_Body --
|
|
------------------------
|
|
|
|
procedure Analyze_Entry_Body (N : Node_Id) is
|
|
Id : constant Entity_Id := Defining_Identifier (N);
|
|
Decls : constant List_Id := Declarations (N);
|
|
Stats : constant Node_Id := Handled_Statement_Sequence (N);
|
|
Formals : constant Node_Id := Entry_Body_Formal_Part (N);
|
|
P_Type : constant Entity_Id := Current_Scope;
|
|
Entry_Name : Entity_Id;
|
|
E : Entity_Id;
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
|
|
-- Entry_Name is initialized to Any_Id. It should get reset to the
|
|
-- matching entry entity. An error is signalled if it is not reset
|
|
|
|
Entry_Name := Any_Id;
|
|
|
|
Analyze (Formals);
|
|
|
|
if Present (Entry_Index_Specification (Formals)) then
|
|
Set_Ekind (Id, E_Entry_Family);
|
|
else
|
|
Set_Ekind (Id, E_Entry);
|
|
end if;
|
|
|
|
Set_Scope (Id, Current_Scope);
|
|
Set_Etype (Id, Standard_Void_Type);
|
|
Set_Accept_Address (Id, New_Elmt_List);
|
|
|
|
E := First_Entity (P_Type);
|
|
while Present (E) loop
|
|
if Chars (E) = Chars (Id)
|
|
and then (Ekind (E) = Ekind (Id))
|
|
and then Type_Conformant (Id, E)
|
|
then
|
|
Entry_Name := E;
|
|
Set_Convention (Id, Convention (E));
|
|
Check_Fully_Conformant (Id, E, N);
|
|
exit;
|
|
end if;
|
|
|
|
Next_Entity (E);
|
|
end loop;
|
|
|
|
if Entry_Name = Any_Id then
|
|
Error_Msg_N ("no entry declaration matches entry body", N);
|
|
return;
|
|
|
|
elsif Has_Completion (Entry_Name) then
|
|
Error_Msg_N ("duplicate entry body", N);
|
|
return;
|
|
|
|
else
|
|
Set_Has_Completion (Entry_Name);
|
|
Generate_Reference (Entry_Name, Id, 'b', Set_Ref => False);
|
|
Style.Check_Identifier (Id, Entry_Name);
|
|
end if;
|
|
|
|
Exp_Ch9.Expand_Entry_Barrier (N, Entry_Name);
|
|
New_Scope (Entry_Name);
|
|
|
|
Exp_Ch9.Expand_Entry_Body_Declarations (N);
|
|
Install_Declarations (Entry_Name);
|
|
Set_Actual_Subtypes (N, Current_Scope);
|
|
|
|
-- The entity for the protected subprogram corresponding to the entry
|
|
-- has been created. We retain the name of this entity in the entry
|
|
-- body, for use when the corresponding subprogram body is created.
|
|
-- Note that entry bodies have to corresponding_spec, and there is no
|
|
-- easy link back in the tree between the entry body and the entity for
|
|
-- the entry itself.
|
|
|
|
Set_Protected_Body_Subprogram (Id,
|
|
Protected_Body_Subprogram (Entry_Name));
|
|
|
|
if Present (Decls) then
|
|
Analyze_Declarations (Decls);
|
|
end if;
|
|
|
|
if Present (Stats) then
|
|
Analyze (Stats);
|
|
end if;
|
|
|
|
Check_References (Entry_Name);
|
|
Process_End_Label (Handled_Statement_Sequence (N), 't', Entry_Name);
|
|
End_Scope;
|
|
|
|
-- If this is an entry family, remove the loop created to provide
|
|
-- a scope for the entry index.
|
|
|
|
if Ekind (Id) = E_Entry_Family
|
|
and then Present (Entry_Index_Specification (Formals))
|
|
then
|
|
End_Scope;
|
|
end if;
|
|
|
|
end Analyze_Entry_Body;
|
|
|
|
------------------------------------
|
|
-- Analyze_Entry_Body_Formal_Part --
|
|
------------------------------------
|
|
|
|
procedure Analyze_Entry_Body_Formal_Part (N : Node_Id) is
|
|
Id : constant Entity_Id := Defining_Identifier (Parent (N));
|
|
Index : constant Node_Id := Entry_Index_Specification (N);
|
|
Formals : constant List_Id := Parameter_Specifications (N);
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
|
|
if Present (Index) then
|
|
Analyze (Index);
|
|
end if;
|
|
|
|
if Present (Formals) then
|
|
Set_Scope (Id, Current_Scope);
|
|
New_Scope (Id);
|
|
Process_Formals (Formals, Parent (N));
|
|
End_Scope;
|
|
end if;
|
|
|
|
end Analyze_Entry_Body_Formal_Part;
|
|
|
|
------------------------------------
|
|
-- Analyze_Entry_Call_Alternative --
|
|
------------------------------------
|
|
|
|
procedure Analyze_Entry_Call_Alternative (N : Node_Id) is
|
|
begin
|
|
Tasking_Used := True;
|
|
|
|
if Present (Pragmas_Before (N)) then
|
|
Analyze_List (Pragmas_Before (N));
|
|
end if;
|
|
|
|
Analyze (Entry_Call_Statement (N));
|
|
|
|
if Is_Non_Empty_List (Statements (N)) then
|
|
Analyze_Statements (Statements (N));
|
|
end if;
|
|
end Analyze_Entry_Call_Alternative;
|
|
|
|
-------------------------------
|
|
-- Analyze_Entry_Declaration --
|
|
-------------------------------
|
|
|
|
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);
|
|
|
|
begin
|
|
Generate_Definition (Id);
|
|
Tasking_Used := True;
|
|
|
|
if No (D_Sdef) then
|
|
Set_Ekind (Id, E_Entry);
|
|
else
|
|
Enter_Name (Id);
|
|
Set_Ekind (Id, E_Entry_Family);
|
|
Analyze (D_Sdef);
|
|
Make_Index (D_Sdef, N, Id);
|
|
end if;
|
|
|
|
Set_Etype (Id, Standard_Void_Type);
|
|
Set_Convention (Id, Convention_Entry);
|
|
Set_Accept_Address (Id, New_Elmt_List);
|
|
|
|
if Present (Formals) then
|
|
Set_Scope (Id, Current_Scope);
|
|
New_Scope (Id);
|
|
Process_Formals (Formals, N);
|
|
Create_Extra_Formals (Id);
|
|
End_Scope;
|
|
end if;
|
|
|
|
if Ekind (Id) = E_Entry then
|
|
New_Overloaded_Entity (Id);
|
|
end if;
|
|
|
|
end Analyze_Entry_Declaration;
|
|
|
|
---------------------------------------
|
|
-- Analyze_Entry_Index_Specification --
|
|
---------------------------------------
|
|
|
|
-- The defining_Identifier of the entry index specification is local
|
|
-- to the entry body, but must be available in the entry barrier,
|
|
-- which is evaluated outside of the entry body. The index is eventually
|
|
-- renamed as a run-time object, so is visibility is strictly a front-end
|
|
-- concern. In order to make it available to the barrier, we create
|
|
-- an additional scope, as for a loop, whose only declaration is the
|
|
-- index name. This loop is not attached to the tree and does not appear
|
|
-- as an entity local to the protected type, so its existence need only
|
|
-- 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 :=
|
|
Make_Defining_Identifier (Sloc (N),
|
|
Chars => New_Internal_Name ('L'));
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
Analyze (Def);
|
|
Make_Index (Def, N);
|
|
Set_Ekind (Loop_Id, E_Loop);
|
|
Set_Scope (Loop_Id, Current_Scope);
|
|
New_Scope (Loop_Id);
|
|
Enter_Name (Iden);
|
|
Set_Ekind (Iden, E_Entry_Index_Parameter);
|
|
Set_Etype (Iden, Etype (Def));
|
|
end Analyze_Entry_Index_Specification;
|
|
|
|
----------------------------
|
|
-- Analyze_Protected_Body --
|
|
----------------------------
|
|
|
|
procedure Analyze_Protected_Body (N : Node_Id) is
|
|
Body_Id : constant Entity_Id := Defining_Identifier (N);
|
|
Last_E : Entity_Id;
|
|
|
|
Spec_Id : Entity_Id;
|
|
-- This is initially the entity of the protected object or protected
|
|
-- type involved, but is replaced by the protected type always in the
|
|
-- case of a single protected declaration, since this is the proper
|
|
-- scope to be used.
|
|
|
|
Ref_Id : Entity_Id;
|
|
-- This is the entity of the protected object or protected type
|
|
-- involved, and is the entity used for cross-reference purposes
|
|
-- (it differs from Spec_Id in the case of a single protected
|
|
-- object, since Spec_Id is set to the protected type in this case).
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
Set_Ekind (Body_Id, E_Protected_Body);
|
|
Spec_Id := Find_Concurrent_Spec (Body_Id);
|
|
|
|
if Present (Spec_Id)
|
|
and then Ekind (Spec_Id) = E_Protected_Type
|
|
then
|
|
null;
|
|
|
|
elsif Present (Spec_Id)
|
|
and then Ekind (Etype (Spec_Id)) = E_Protected_Type
|
|
and then not Comes_From_Source (Etype (Spec_Id))
|
|
then
|
|
null;
|
|
|
|
else
|
|
Error_Msg_N ("missing specification for protected body", Body_Id);
|
|
return;
|
|
end if;
|
|
|
|
Ref_Id := Spec_Id;
|
|
Generate_Reference (Ref_Id, Body_Id, 'b', Set_Ref => False);
|
|
Style.Check_Identifier (Body_Id, Spec_Id);
|
|
|
|
-- The declarations are always attached to the type
|
|
|
|
if Ekind (Spec_Id) /= E_Protected_Type then
|
|
Spec_Id := Etype (Spec_Id);
|
|
end if;
|
|
|
|
New_Scope (Spec_Id);
|
|
Set_Corresponding_Spec (N, Spec_Id);
|
|
Set_Corresponding_Body (Parent (Spec_Id), Body_Id);
|
|
Set_Has_Completion (Spec_Id);
|
|
Install_Declarations (Spec_Id);
|
|
|
|
Exp_Ch9.Expand_Protected_Body_Declarations (N, Spec_Id);
|
|
|
|
Last_E := Last_Entity (Spec_Id);
|
|
|
|
Analyze_Declarations (Declarations (N));
|
|
|
|
-- For visibility purposes, all entities in the body are private.
|
|
-- Set First_Private_Entity accordingly, if there was no private
|
|
-- part in the protected declaration.
|
|
|
|
if No (First_Private_Entity (Spec_Id)) then
|
|
if Present (Last_E) then
|
|
Set_First_Private_Entity (Spec_Id, Next_Entity (Last_E));
|
|
else
|
|
Set_First_Private_Entity (Spec_Id, First_Entity (Spec_Id));
|
|
end if;
|
|
end if;
|
|
|
|
Check_Completion (Body_Id);
|
|
Check_References (Spec_Id);
|
|
Process_End_Label (N, 't', Ref_Id);
|
|
End_Scope;
|
|
end Analyze_Protected_Body;
|
|
|
|
----------------------------------
|
|
-- Analyze_Protected_Definition --
|
|
----------------------------------
|
|
|
|
procedure Analyze_Protected_Definition (N : Node_Id) is
|
|
E : Entity_Id;
|
|
L : Entity_Id;
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
Analyze_Declarations (Visible_Declarations (N));
|
|
|
|
if Present (Private_Declarations (N))
|
|
and then not Is_Empty_List (Private_Declarations (N))
|
|
then
|
|
L := Last_Entity (Current_Scope);
|
|
Analyze_Declarations (Private_Declarations (N));
|
|
|
|
if Present (L) then
|
|
Set_First_Private_Entity (Current_Scope, Next_Entity (L));
|
|
|
|
else
|
|
Set_First_Private_Entity (Current_Scope,
|
|
First_Entity (Current_Scope));
|
|
end if;
|
|
end if;
|
|
|
|
E := First_Entity (Current_Scope);
|
|
|
|
while Present (E) loop
|
|
|
|
if Ekind (E) = E_Function
|
|
or else Ekind (E) = E_Procedure
|
|
then
|
|
Set_Convention (E, Convention_Protected);
|
|
|
|
elsif Is_Task_Type (Etype (E))
|
|
or else Has_Task (Etype (E))
|
|
then
|
|
Set_Has_Task (Current_Scope);
|
|
end if;
|
|
|
|
Next_Entity (E);
|
|
end loop;
|
|
|
|
Check_Max_Entries (N, Max_Protected_Entries);
|
|
Process_End_Label (N, 'e', Current_Scope);
|
|
end Analyze_Protected_Definition;
|
|
|
|
----------------------------
|
|
-- Analyze_Protected_Type --
|
|
----------------------------
|
|
|
|
procedure Analyze_Protected_Type (N : Node_Id) is
|
|
E : Entity_Id;
|
|
T : Entity_Id;
|
|
Def_Id : constant Entity_Id := Defining_Identifier (N);
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
Check_Restriction (No_Protected_Types, N);
|
|
|
|
T := Find_Type_Name (N);
|
|
|
|
if Ekind (T) = E_Incomplete_Type then
|
|
T := Full_View (T);
|
|
Set_Completion_Referenced (T);
|
|
end if;
|
|
|
|
Set_Ekind (T, E_Protected_Type);
|
|
Init_Size_Align (T);
|
|
Set_Etype (T, T);
|
|
Set_Is_First_Subtype (T, True);
|
|
Set_Has_Delayed_Freeze (T, True);
|
|
Set_Girder_Constraint (T, No_Elist);
|
|
New_Scope (T);
|
|
|
|
if Present (Discriminant_Specifications (N)) then
|
|
if Has_Discriminants (T) then
|
|
|
|
-- Install discriminants. Also, verify conformance of
|
|
-- discriminants of previous and current view. ???
|
|
|
|
Install_Declarations (T);
|
|
else
|
|
Process_Discriminants (N);
|
|
end if;
|
|
end if;
|
|
|
|
Analyze (Protected_Definition (N));
|
|
|
|
-- Protected types with entries are controlled (because of the
|
|
-- Protection component if nothing else), same for any protected type
|
|
-- with interrupt handlers. Note that we need to analyze the protected
|
|
-- definition to set Has_Entries and such.
|
|
|
|
if (Abort_Allowed or else Restrictions (No_Entry_Queue) = False
|
|
or else Number_Entries (T) > 1)
|
|
and then
|
|
(Has_Entries (T)
|
|
or else Has_Interrupt_Handler (T)
|
|
or else Has_Attach_Handler (T))
|
|
then
|
|
Set_Has_Controlled_Component (T, True);
|
|
end if;
|
|
|
|
-- The Ekind of components is E_Void during analysis to detect
|
|
-- illegal uses. Now it can be set correctly.
|
|
|
|
E := First_Entity (Current_Scope);
|
|
|
|
while Present (E) loop
|
|
if Ekind (E) = E_Void then
|
|
Set_Ekind (E, E_Component);
|
|
Init_Component_Location (E);
|
|
end if;
|
|
|
|
Next_Entity (E);
|
|
end loop;
|
|
|
|
End_Scope;
|
|
|
|
if T /= Def_Id
|
|
and then Is_Private_Type (Def_Id)
|
|
and then Has_Discriminants (Def_Id)
|
|
and then Expander_Active
|
|
then
|
|
Exp_Ch9.Expand_N_Protected_Type_Declaration (N);
|
|
Process_Full_View (N, T, Def_Id);
|
|
end if;
|
|
|
|
end Analyze_Protected_Type;
|
|
|
|
---------------------
|
|
-- Analyze_Requeue --
|
|
---------------------
|
|
|
|
procedure Analyze_Requeue (N : Node_Id) is
|
|
Entry_Name : Node_Id := Name (N);
|
|
Entry_Id : Entity_Id;
|
|
Found : Boolean;
|
|
I : Interp_Index;
|
|
It : Interp;
|
|
Enclosing : Entity_Id;
|
|
Target_Obj : Node_Id := Empty;
|
|
Req_Scope : Entity_Id;
|
|
Outer_Ent : Entity_Id;
|
|
|
|
begin
|
|
Check_Restriction (No_Requeue, N);
|
|
Check_Unreachable_Code (N);
|
|
Tasking_Used := True;
|
|
|
|
Enclosing := Empty;
|
|
for J in reverse 0 .. Scope_Stack.Last loop
|
|
Enclosing := Scope_Stack.Table (J).Entity;
|
|
exit when Is_Entry (Enclosing);
|
|
|
|
if Ekind (Enclosing) /= E_Block
|
|
and then Ekind (Enclosing) /= E_Loop
|
|
then
|
|
Error_Msg_N ("requeue must appear within accept or entry body", N);
|
|
return;
|
|
end if;
|
|
end loop;
|
|
|
|
Analyze (Entry_Name);
|
|
|
|
if Etype (Entry_Name) = Any_Type then
|
|
return;
|
|
end if;
|
|
|
|
if Nkind (Entry_Name) = N_Selected_Component then
|
|
Target_Obj := Prefix (Entry_Name);
|
|
Entry_Name := Selector_Name (Entry_Name);
|
|
end if;
|
|
|
|
-- If an explicit target object is given then we have to check
|
|
-- 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.
|
|
|
|
Outer_Ent := Empty;
|
|
for S in reverse 0 .. Scope_Stack.Last loop
|
|
Req_Scope := Scope_Stack.Table (S).Entity;
|
|
|
|
exit when Ekind (Req_Scope) in Task_Kind
|
|
or else Ekind (Req_Scope) in Protected_Kind;
|
|
|
|
if Is_Entry (Req_Scope) then
|
|
Outer_Ent := Req_Scope;
|
|
end if;
|
|
end loop;
|
|
|
|
pragma Assert (Present (Outer_Ent));
|
|
|
|
-- Check that the accessibility level of the target object
|
|
-- is not greater or equal to the outermost enclosing accept
|
|
-- statement (or entry body) unless it is a parameter of the
|
|
-- innermost enclosing accept statement (or entry body).
|
|
|
|
if Object_Access_Level (Target_Obj) >= Scope_Depth (Outer_Ent)
|
|
and then
|
|
(not Is_Entity_Name (Target_Obj)
|
|
or else Ekind (Entity (Target_Obj)) not in Formal_Kind
|
|
or else Enclosing /= Scope (Entity (Target_Obj)))
|
|
then
|
|
Error_Msg_N
|
|
("target object has invalid level for requeue", Target_Obj);
|
|
end if;
|
|
end if;
|
|
|
|
-- Overloaded case, find right interpretation
|
|
|
|
if Is_Overloaded (Entry_Name) then
|
|
Get_First_Interp (Entry_Name, I, It);
|
|
Found := False;
|
|
Entry_Id := Empty;
|
|
|
|
while Present (It.Nam) loop
|
|
|
|
if No (First_Formal (It.Nam))
|
|
or else Subtype_Conformant (Enclosing, It.Nam)
|
|
then
|
|
if not Found then
|
|
Found := True;
|
|
Entry_Id := It.Nam;
|
|
else
|
|
Error_Msg_N ("ambiguous entry name in requeue", N);
|
|
return;
|
|
end if;
|
|
end if;
|
|
|
|
Get_Next_Interp (I, It);
|
|
end loop;
|
|
|
|
if not Found then
|
|
Error_Msg_N ("no entry matches context", N);
|
|
return;
|
|
else
|
|
Set_Entity (Entry_Name, Entry_Id);
|
|
end if;
|
|
|
|
-- Non-overloaded cases
|
|
|
|
-- For the case of a reference to an element of an entry family,
|
|
-- the Entry_Name is an indexed component.
|
|
|
|
elsif Nkind (Entry_Name) = N_Indexed_Component then
|
|
|
|
-- Requeue to an entry out of the body
|
|
|
|
if Nkind (Prefix (Entry_Name)) = N_Selected_Component then
|
|
Entry_Id := Entity (Selector_Name (Prefix (Entry_Name)));
|
|
|
|
-- Requeue from within the body itself
|
|
|
|
elsif Nkind (Prefix (Entry_Name)) = N_Identifier then
|
|
Entry_Id := Entity (Prefix (Entry_Name));
|
|
|
|
else
|
|
Error_Msg_N ("invalid entry_name specified", N);
|
|
return;
|
|
end if;
|
|
|
|
-- If we had a requeue of the form REQUEUE A (B), then the parser
|
|
-- accepted it (because it could have been a requeue on an entry
|
|
-- index. If A turns out not to be an entry family, then the analysis
|
|
-- of A (B) turned it into a function call.
|
|
|
|
elsif Nkind (Entry_Name) = N_Function_Call then
|
|
Error_Msg_N
|
|
("arguments not allowed in requeue statement",
|
|
First (Parameter_Associations (Entry_Name)));
|
|
return;
|
|
|
|
-- Normal case of no entry family, no argument
|
|
|
|
else
|
|
Entry_Id := Entity (Entry_Name);
|
|
end if;
|
|
|
|
-- Resolve entry, and check that it is subtype conformant with the
|
|
-- enclosing construct if this construct has formals (RM 9.5.4(5)).
|
|
|
|
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));
|
|
|
|
if Present (First_Formal (Entry_Id)) then
|
|
Check_Subtype_Conformant (Enclosing, Entry_Id, Name (N));
|
|
|
|
-- Mark any output parameters as assigned
|
|
|
|
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);
|
|
end if;
|
|
|
|
Next_Formal (Ent);
|
|
end loop;
|
|
end;
|
|
end if;
|
|
end if;
|
|
|
|
end Analyze_Requeue;
|
|
|
|
------------------------------
|
|
-- Analyze_Selective_Accept --
|
|
------------------------------
|
|
|
|
procedure Analyze_Selective_Accept (N : Node_Id) is
|
|
Alts : constant List_Id := Select_Alternatives (N);
|
|
Alt : Node_Id;
|
|
|
|
Accept_Present : Boolean := False;
|
|
Terminate_Present : Boolean := False;
|
|
Delay_Present : Boolean := False;
|
|
Relative_Present : Boolean := False;
|
|
Alt_Count : Uint := Uint_0;
|
|
|
|
begin
|
|
Check_Restriction (No_Select_Statements, N);
|
|
Tasking_Used := True;
|
|
|
|
Alt := First (Alts);
|
|
while Present (Alt) loop
|
|
Alt_Count := Alt_Count + 1;
|
|
Analyze (Alt);
|
|
|
|
if Nkind (Alt) = N_Delay_Alternative then
|
|
if Delay_Present then
|
|
|
|
if (Relative_Present /=
|
|
(Nkind (Delay_Statement (Alt)) = N_Delay_Relative_Statement))
|
|
then
|
|
Error_Msg_N
|
|
("delay_until and delay_relative alternatives ", Alt);
|
|
Error_Msg_N
|
|
("\cannot appear in the same selective_wait", Alt);
|
|
end if;
|
|
|
|
else
|
|
Delay_Present := True;
|
|
Relative_Present :=
|
|
Nkind (Delay_Statement (Alt)) = N_Delay_Relative_Statement;
|
|
end if;
|
|
|
|
elsif Nkind (Alt) = N_Terminate_Alternative then
|
|
if Terminate_Present then
|
|
Error_Msg_N ("Only one terminate alternative allowed", N);
|
|
else
|
|
Terminate_Present := True;
|
|
Check_Restriction (No_Terminate_Alternatives, N);
|
|
end if;
|
|
|
|
elsif Nkind (Alt) = N_Accept_Alternative then
|
|
Accept_Present := True;
|
|
|
|
-- Check for duplicate accept
|
|
|
|
declare
|
|
Alt1 : Node_Id;
|
|
Stm : constant Node_Id := Accept_Statement (Alt);
|
|
EDN : constant Node_Id := Entry_Direct_Name (Stm);
|
|
Ent : Entity_Id;
|
|
|
|
begin
|
|
if Nkind (EDN) = N_Identifier
|
|
and then No (Condition (Alt))
|
|
and then Present (Entity (EDN)) -- defend against junk
|
|
and then Ekind (Entity (EDN)) = E_Entry
|
|
then
|
|
Ent := Entity (EDN);
|
|
|
|
Alt1 := First (Alts);
|
|
while Alt1 /= Alt loop
|
|
if Nkind (Alt1) = N_Accept_Alternative
|
|
and then No (Condition (Alt1))
|
|
then
|
|
declare
|
|
Stm1 : constant Node_Id := Accept_Statement (Alt1);
|
|
EDN1 : constant Node_Id := Entry_Direct_Name (Stm1);
|
|
|
|
begin
|
|
if Nkind (EDN1) = N_Identifier then
|
|
if Entity (EDN1) = Ent then
|
|
Error_Msg_Sloc := Sloc (Stm1);
|
|
Error_Msg_N
|
|
("?accept duplicates one on line#", Stm);
|
|
exit;
|
|
end if;
|
|
end if;
|
|
end;
|
|
end if;
|
|
|
|
Next (Alt1);
|
|
end loop;
|
|
end if;
|
|
end;
|
|
end if;
|
|
|
|
Next (Alt);
|
|
end loop;
|
|
|
|
Check_Restriction (Max_Select_Alternatives, Alt_Count, N);
|
|
Check_Potentially_Blocking_Operation (N);
|
|
|
|
if Terminate_Present and Delay_Present then
|
|
Error_Msg_N ("at most one of terminate or delay alternative", N);
|
|
|
|
elsif not Accept_Present then
|
|
Error_Msg_N
|
|
("select must contain at least one accept alternative", N);
|
|
end if;
|
|
|
|
if Present (Else_Statements (N)) then
|
|
if Terminate_Present or Delay_Present then
|
|
Error_Msg_N ("else part not allowed with other alternatives", N);
|
|
end if;
|
|
|
|
Analyze_Statements (Else_Statements (N));
|
|
end if;
|
|
end Analyze_Selective_Accept;
|
|
|
|
------------------------------
|
|
-- Analyze_Single_Protected --
|
|
------------------------------
|
|
|
|
procedure Analyze_Single_Protected (N : Node_Id) is
|
|
Loc : constant Source_Ptr := Sloc (N);
|
|
Id : constant Node_Id := Defining_Identifier (N);
|
|
T : Entity_Id;
|
|
T_Decl : Node_Id;
|
|
O_Decl : Node_Id;
|
|
O_Name : constant Entity_Id := New_Copy (Id);
|
|
|
|
begin
|
|
Generate_Definition (Id);
|
|
Tasking_Used := True;
|
|
|
|
-- The node is rewritten as a protected type declaration,
|
|
-- in exact analogy with what is done with single tasks.
|
|
|
|
T :=
|
|
Make_Defining_Identifier (Sloc (Id),
|
|
New_External_Name (Chars (Id), 'T'));
|
|
|
|
T_Decl :=
|
|
Make_Protected_Type_Declaration (Loc,
|
|
Defining_Identifier => T,
|
|
Protected_Definition => Relocate_Node (Protected_Definition (N)));
|
|
|
|
O_Decl :=
|
|
Make_Object_Declaration (Loc,
|
|
Defining_Identifier => O_Name,
|
|
Object_Definition => Make_Identifier (Loc, Chars (T)));
|
|
|
|
Rewrite (N, T_Decl);
|
|
Insert_After (N, O_Decl);
|
|
Mark_Rewrite_Insertion (O_Decl);
|
|
|
|
-- Enter names of type and object before analysis, because the name
|
|
-- of the object may be used in its own body.
|
|
|
|
Enter_Name (T);
|
|
Set_Ekind (T, E_Protected_Type);
|
|
Set_Etype (T, T);
|
|
|
|
Enter_Name (O_Name);
|
|
Set_Ekind (O_Name, E_Variable);
|
|
Set_Etype (O_Name, T);
|
|
|
|
-- Instead of calling Analyze on the new node, call directly
|
|
-- the proper analysis procedure. Otherwise the node would be
|
|
-- expanded twice, with disastrous result.
|
|
|
|
Analyze_Protected_Type (N);
|
|
|
|
end Analyze_Single_Protected;
|
|
|
|
-------------------------
|
|
-- Analyze_Single_Task --
|
|
-------------------------
|
|
|
|
procedure Analyze_Single_Task (N : Node_Id) is
|
|
Loc : constant Source_Ptr := Sloc (N);
|
|
Id : constant Node_Id := Defining_Identifier (N);
|
|
T : Entity_Id;
|
|
T_Decl : Node_Id;
|
|
O_Decl : Node_Id;
|
|
O_Name : constant Entity_Id := New_Copy (Id);
|
|
|
|
begin
|
|
Generate_Definition (Id);
|
|
Tasking_Used := True;
|
|
|
|
-- The node is rewritten as a task type declaration, followed
|
|
-- by an object declaration of that anonymous task type.
|
|
|
|
T :=
|
|
Make_Defining_Identifier (Sloc (Id),
|
|
New_External_Name (Chars (Id), Suffix => "TK"));
|
|
|
|
T_Decl :=
|
|
Make_Task_Type_Declaration (Loc,
|
|
Defining_Identifier => T,
|
|
Task_Definition => Relocate_Node (Task_Definition (N)));
|
|
|
|
O_Decl :=
|
|
Make_Object_Declaration (Loc,
|
|
Defining_Identifier => O_Name,
|
|
Object_Definition => Make_Identifier (Loc, Chars (T)));
|
|
|
|
Rewrite (N, T_Decl);
|
|
Insert_After (N, O_Decl);
|
|
Mark_Rewrite_Insertion (O_Decl);
|
|
|
|
-- Enter names of type and object before analysis, because the name
|
|
-- of the object may be used in its own body.
|
|
|
|
Enter_Name (T);
|
|
Set_Ekind (T, E_Task_Type);
|
|
Set_Etype (T, T);
|
|
|
|
Enter_Name (O_Name);
|
|
Set_Ekind (O_Name, E_Variable);
|
|
Set_Etype (O_Name, T);
|
|
|
|
-- Instead of calling Analyze on the new node, call directly
|
|
-- the proper analysis procedure. Otherwise the node would be
|
|
-- expanded twice, with disastrous result.
|
|
|
|
Analyze_Task_Type (N);
|
|
|
|
end Analyze_Single_Task;
|
|
|
|
-----------------------
|
|
-- Analyze_Task_Body --
|
|
-----------------------
|
|
|
|
procedure Analyze_Task_Body (N : Node_Id) is
|
|
Body_Id : constant Entity_Id := Defining_Identifier (N);
|
|
Last_E : Entity_Id;
|
|
|
|
Spec_Id : Entity_Id;
|
|
-- This is initially the entity of the task or task type involved,
|
|
-- but is replaced by the task type always in the case of a single
|
|
-- task declaration, since this is the proper scope to be used.
|
|
|
|
Ref_Id : Entity_Id;
|
|
-- This is the entity of the task or task type, and is the entity
|
|
-- used for cross-reference purposes (it differs from Spec_Id in
|
|
-- the case of a single task, since Spec_Id is set to the task type)
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
Set_Ekind (Body_Id, E_Task_Body);
|
|
Set_Scope (Body_Id, Current_Scope);
|
|
Spec_Id := Find_Concurrent_Spec (Body_Id);
|
|
|
|
-- The spec is either a task type declaration, or a single task
|
|
-- declaration for which we have created an anonymous type.
|
|
|
|
if Present (Spec_Id)
|
|
and then Ekind (Spec_Id) = E_Task_Type
|
|
then
|
|
null;
|
|
|
|
elsif Present (Spec_Id)
|
|
and then Ekind (Etype (Spec_Id)) = E_Task_Type
|
|
and then not Comes_From_Source (Etype (Spec_Id))
|
|
then
|
|
null;
|
|
|
|
else
|
|
Error_Msg_N ("missing specification for task body", Body_Id);
|
|
return;
|
|
end if;
|
|
|
|
Ref_Id := Spec_Id;
|
|
Generate_Reference (Ref_Id, Body_Id, 'b', Set_Ref => False);
|
|
Style.Check_Identifier (Body_Id, Spec_Id);
|
|
|
|
-- Deal with case of body of single task (anonymous type was created)
|
|
|
|
if Ekind (Spec_Id) = E_Variable then
|
|
Spec_Id := Etype (Spec_Id);
|
|
end if;
|
|
|
|
New_Scope (Spec_Id);
|
|
Set_Corresponding_Spec (N, Spec_Id);
|
|
Set_Corresponding_Body (Parent (Spec_Id), Body_Id);
|
|
Set_Has_Completion (Spec_Id);
|
|
Install_Declarations (Spec_Id);
|
|
Last_E := Last_Entity (Spec_Id);
|
|
|
|
Analyze_Declarations (Declarations (N));
|
|
|
|
-- For visibility purposes, all entities in the body are private.
|
|
-- Set First_Private_Entity accordingly, if there was no private
|
|
-- part in the protected declaration.
|
|
|
|
if No (First_Private_Entity (Spec_Id)) then
|
|
if Present (Last_E) then
|
|
Set_First_Private_Entity (Spec_Id, Next_Entity (Last_E));
|
|
else
|
|
Set_First_Private_Entity (Spec_Id, First_Entity (Spec_Id));
|
|
end if;
|
|
end if;
|
|
|
|
Analyze (Handled_Statement_Sequence (N));
|
|
Check_Completion (Body_Id);
|
|
Check_References (Body_Id);
|
|
|
|
-- Check for entries with no corresponding accept
|
|
|
|
declare
|
|
Ent : Entity_Id;
|
|
|
|
begin
|
|
Ent := First_Entity (Spec_Id);
|
|
|
|
while Present (Ent) loop
|
|
if Is_Entry (Ent)
|
|
and then not Entry_Accepted (Ent)
|
|
and then Comes_From_Source (Ent)
|
|
then
|
|
Error_Msg_NE ("no accept for entry &?", N, Ent);
|
|
end if;
|
|
|
|
Next_Entity (Ent);
|
|
end loop;
|
|
end;
|
|
|
|
Process_End_Label (Handled_Statement_Sequence (N), 't', Ref_Id);
|
|
End_Scope;
|
|
end Analyze_Task_Body;
|
|
|
|
-----------------------------
|
|
-- Analyze_Task_Definition --
|
|
-----------------------------
|
|
|
|
procedure Analyze_Task_Definition (N : Node_Id) is
|
|
L : Entity_Id;
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
|
|
if Present (Visible_Declarations (N)) then
|
|
Analyze_Declarations (Visible_Declarations (N));
|
|
end if;
|
|
|
|
if Present (Private_Declarations (N)) then
|
|
L := Last_Entity (Current_Scope);
|
|
Analyze_Declarations (Private_Declarations (N));
|
|
|
|
if Present (L) then
|
|
Set_First_Private_Entity
|
|
(Current_Scope, Next_Entity (L));
|
|
else
|
|
Set_First_Private_Entity
|
|
(Current_Scope, First_Entity (Current_Scope));
|
|
end if;
|
|
end if;
|
|
|
|
Check_Max_Entries (N, Max_Task_Entries);
|
|
Process_End_Label (N, 'e', Current_Scope);
|
|
end Analyze_Task_Definition;
|
|
|
|
-----------------------
|
|
-- Analyze_Task_Type --
|
|
-----------------------
|
|
|
|
procedure Analyze_Task_Type (N : Node_Id) is
|
|
T : Entity_Id;
|
|
Def_Id : constant Entity_Id := Defining_Identifier (N);
|
|
|
|
begin
|
|
Tasking_Used := True;
|
|
Check_Restriction (Max_Tasks, N);
|
|
Check_Restriction (No_Tasking, N);
|
|
T := Find_Type_Name (N);
|
|
Generate_Definition (T);
|
|
|
|
if Ekind (T) = E_Incomplete_Type then
|
|
T := Full_View (T);
|
|
Set_Completion_Referenced (T);
|
|
end if;
|
|
|
|
Set_Ekind (T, E_Task_Type);
|
|
Set_Is_First_Subtype (T, True);
|
|
Set_Has_Task (T, True);
|
|
Init_Size_Align (T);
|
|
Set_Etype (T, T);
|
|
Set_Has_Delayed_Freeze (T, True);
|
|
Set_Girder_Constraint (T, No_Elist);
|
|
New_Scope (T);
|
|
|
|
if Present (Discriminant_Specifications (N)) then
|
|
if Ada_83 and then Comes_From_Source (N) then
|
|
Error_Msg_N ("(Ada 83) task discriminant not allowed!", N);
|
|
end if;
|
|
|
|
if Has_Discriminants (T) then
|
|
|
|
-- Install discriminants. Also, verify conformance of
|
|
-- discriminants of previous and current view. ???
|
|
|
|
Install_Declarations (T);
|
|
else
|
|
Process_Discriminants (N);
|
|
end if;
|
|
end if;
|
|
|
|
if Present (Task_Definition (N)) then
|
|
Analyze_Task_Definition (Task_Definition (N));
|
|
end if;
|
|
|
|
if not Is_Library_Level_Entity (T) then
|
|
Check_Restriction (No_Task_Hierarchy, N);
|
|
end if;
|
|
|
|
End_Scope;
|
|
|
|
if T /= Def_Id
|
|
and then Is_Private_Type (Def_Id)
|
|
and then Has_Discriminants (Def_Id)
|
|
and then Expander_Active
|
|
then
|
|
Exp_Ch9.Expand_N_Task_Type_Declaration (N);
|
|
Process_Full_View (N, T, Def_Id);
|
|
end if;
|
|
end Analyze_Task_Type;
|
|
|
|
-----------------------------------
|
|
-- Analyze_Terminate_Alternative --
|
|
-----------------------------------
|
|
|
|
procedure Analyze_Terminate_Alternative (N : Node_Id) is
|
|
begin
|
|
Tasking_Used := True;
|
|
|
|
if Present (Pragmas_Before (N)) then
|
|
Analyze_List (Pragmas_Before (N));
|
|
end if;
|
|
|
|
if Present (Condition (N)) then
|
|
Analyze_And_Resolve (Condition (N), Any_Boolean);
|
|
end if;
|
|
end Analyze_Terminate_Alternative;
|
|
|
|
------------------------------
|
|
-- Analyze_Timed_Entry_Call --
|
|
------------------------------
|
|
|
|
procedure Analyze_Timed_Entry_Call (N : Node_Id) is
|
|
begin
|
|
Check_Restriction (No_Select_Statements, N);
|
|
Tasking_Used := True;
|
|
Analyze (Entry_Call_Alternative (N));
|
|
Analyze (Delay_Alternative (N));
|
|
end Analyze_Timed_Entry_Call;
|
|
|
|
------------------------------------
|
|
-- Analyze_Triggering_Alternative --
|
|
------------------------------------
|
|
|
|
procedure Analyze_Triggering_Alternative (N : Node_Id) is
|
|
Trigger : Node_Id := Triggering_Statement (N);
|
|
begin
|
|
Tasking_Used := True;
|
|
|
|
if Present (Pragmas_Before (N)) then
|
|
Analyze_List (Pragmas_Before (N));
|
|
end if;
|
|
|
|
Analyze (Trigger);
|
|
if Comes_From_Source (Trigger)
|
|
and then Nkind (Trigger) /= N_Delay_Until_Statement
|
|
and then Nkind (Trigger) /= N_Delay_Relative_Statement
|
|
and then Nkind (Trigger) /= N_Entry_Call_Statement
|
|
then
|
|
Error_Msg_N
|
|
("triggering statement must be delay or entry call", Trigger);
|
|
end if;
|
|
|
|
if Is_Non_Empty_List (Statements (N)) then
|
|
Analyze_Statements (Statements (N));
|
|
end if;
|
|
end Analyze_Triggering_Alternative;
|
|
|
|
-----------------------
|
|
-- Check_Max_Entries --
|
|
-----------------------
|
|
|
|
procedure Check_Max_Entries (Def : Node_Id; R : Restriction_Parameter_Id) is
|
|
Ecount : Uint;
|
|
|
|
procedure Count (L : List_Id);
|
|
-- Count entries in given declaration list
|
|
|
|
procedure Count (L : List_Id) is
|
|
D : Node_Id;
|
|
|
|
begin
|
|
if No (L) then
|
|
return;
|
|
end if;
|
|
|
|
D := First (L);
|
|
while Present (D) loop
|
|
if Nkind (D) = N_Entry_Declaration then
|
|
declare
|
|
DSD : constant Node_Id :=
|
|
Discrete_Subtype_Definition (D);
|
|
|
|
begin
|
|
if No (DSD) then
|
|
Ecount := Ecount + 1;
|
|
|
|
elsif Is_OK_Static_Subtype (Etype (DSD)) then
|
|
declare
|
|
Lo : constant Uint :=
|
|
Expr_Value
|
|
(Type_Low_Bound (Etype (DSD)));
|
|
Hi : constant Uint :=
|
|
Expr_Value
|
|
(Type_High_Bound (Etype (DSD)));
|
|
|
|
begin
|
|
if Hi >= Lo then
|
|
Ecount := Ecount + Hi - Lo + 1;
|
|
end if;
|
|
end;
|
|
|
|
else
|
|
Error_Msg_N
|
|
("static subtype required by Restriction pragma", DSD);
|
|
end if;
|
|
end;
|
|
end if;
|
|
|
|
Next (D);
|
|
end loop;
|
|
end Count;
|
|
|
|
-- 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));
|
|
Check_Restriction (R, Ecount, Def);
|
|
end if;
|
|
end Check_Max_Entries;
|
|
|
|
--------------------------
|
|
-- Find_Concurrent_Spec --
|
|
--------------------------
|
|
|
|
function Find_Concurrent_Spec (Body_Id : Entity_Id) return Entity_Id is
|
|
Spec_Id : Entity_Id := Current_Entity_In_Scope (Body_Id);
|
|
|
|
begin
|
|
-- The type may have been given by an incomplete type declaration.
|
|
-- Find full view now.
|
|
|
|
if Present (Spec_Id) and then Ekind (Spec_Id) = E_Incomplete_Type then
|
|
Spec_Id := Full_View (Spec_Id);
|
|
end if;
|
|
|
|
return Spec_Id;
|
|
end Find_Concurrent_Spec;
|
|
|
|
--------------------------
|
|
-- Install_Declarations --
|
|
--------------------------
|
|
|
|
procedure Install_Declarations (Spec : Entity_Id) is
|
|
E : Entity_Id;
|
|
Prev : Entity_Id;
|
|
|
|
begin
|
|
E := First_Entity (Spec);
|
|
|
|
while Present (E) loop
|
|
Prev := Current_Entity (E);
|
|
Set_Current_Entity (E);
|
|
Set_Is_Immediately_Visible (E);
|
|
Set_Homonym (E, Prev);
|
|
Next_Entity (E);
|
|
end loop;
|
|
end Install_Declarations;
|
|
|
|
end Sem_Ch9;
|