2020-06-02 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * ada_get_targ.adb: Bump copyright year. * adabkend.adb: Likewise. * adabkend.ads: Likewise. * adadecode.c: Likewise. * adadecode.h: Likewise. * adaint.c: Likewise. * adaint.h: Likewise. * affinity.c: Likewise. * ali-util.adb: Likewise. * ali-util.ads: Likewise. * ali.adb: Likewise. * ali.ads: Likewise. * alloc.ads: Likewise. * argv-lynxos178-raven-cert.c: Likewise. * argv.c: Likewise. * aspects.adb: Likewise. * aspects.ads: Likewise. * atree.adb: Likewise. * atree.ads: Likewise. * atree.h: Likewise. * aux-io.c: Likewise. * back_end.adb: Likewise. * back_end.ads: Likewise. * bcheck.adb: Likewise. * bcheck.ads: Likewise. * binde.adb: Likewise. * binde.ads: Likewise. * binderr.adb: Likewise. * binderr.ads: Likewise. * bindgen.adb: Likewise. * bindgen.ads: Likewise. * bindo-augmentors.adb: Likewise. * bindo-augmentors.ads: Likewise. * bindo-builders.adb: Likewise. * bindo-builders.ads: Likewise. * bindo-diagnostics.adb: Likewise. * bindo-diagnostics.ads: Likewise. * bindo-elaborators.adb: Likewise. * bindo-elaborators.ads: Likewise. * bindo-graphs.adb: Likewise. * bindo-graphs.ads: Likewise. * bindo-units.adb: Likewise. * bindo-units.ads: Likewise. * bindo-validators.adb: Likewise. * bindo-validators.ads: Likewise. * bindo-writers.adb: Likewise. * bindo-writers.ads: Likewise. * bindo.adb: Likewise. * bindo.ads: Likewise. * bindusg.adb: Likewise. * bindusg.ads: Likewise. * butil.adb: Likewise. * butil.ads: Likewise. * cal.c: Likewise. * casing.adb: Likewise. * casing.ads: Likewise. * ceinfo.adb: Likewise. * checks.adb: Likewise. * checks.ads: Likewise. * cio.c: Likewise. * clean.adb: Likewise. * clean.ads: Likewise. * comperr.adb: Likewise. * comperr.ads: Likewise. * contracts.adb: Likewise. * contracts.ads: Likewise. * csets.adb: Likewise. * csets.ads: Likewise. * csinfo.adb: Likewise. * cstand.adb: Likewise. * cstand.ads: Likewise. * cstreams.c: Likewise. * ctrl_c.c: Likewise. * debug.adb: Likewise. * debug.ads: Likewise. * debug_a.adb: Likewise. * debug_a.ads: Likewise. * einfo.adb: Likewise. * einfo.ads: Likewise. * elists.adb: Likewise. * elists.ads: Likewise. * elists.h: Likewise. * env.c: Likewise. * env.h: Likewise. * err_vars.ads: Likewise. * errno.c: Likewise. * errout.adb: Likewise. * errout.ads: Likewise. * erroutc.adb: Likewise. * erroutc.ads: Likewise. * errutil.adb: Likewise. * errutil.ads: Likewise. * eval_fat.adb: Likewise. * eval_fat.ads: Likewise. * exit.c: Likewise. * exp_aggr.adb: Likewise. * exp_aggr.ads: Likewise. * exp_atag.adb: Likewise. * exp_atag.ads: Likewise. * exp_attr.adb: Likewise. * exp_attr.ads: Likewise. * exp_cg.adb: Likewise. * exp_cg.ads: Likewise. * exp_ch10.ads: Likewise. * exp_ch11.adb: Likewise. * exp_ch11.ads: Likewise. * exp_ch12.adb: Likewise. * exp_ch12.ads: Likewise. * exp_ch13.adb: Likewise. * exp_ch13.ads: Likewise. * exp_ch2.adb: Likewise. * exp_ch2.ads: Likewise. * exp_ch3.adb: Likewise. * exp_ch3.ads: Likewise. * exp_ch4.adb: Likewise. * exp_ch4.ads: Likewise. * exp_ch5.adb: Likewise. * exp_ch5.ads: Likewise. * exp_ch6.adb: Likewise. * exp_ch6.ads: Likewise. * exp_ch7.adb: Likewise. * exp_ch7.ads: Likewise. * exp_ch8.adb: Likewise. * exp_ch8.ads: Likewise. * exp_ch9.adb: Likewise. * exp_ch9.ads: Likewise. * exp_code.adb: Likewise. * exp_code.ads: Likewise. * exp_dbug.adb: Likewise. * exp_dbug.ads: Likewise. * exp_disp.adb: Likewise. * exp_disp.ads: Likewise. * exp_dist.adb: Likewise. * exp_dist.ads: Likewise. * exp_fixd.adb: Likewise. * exp_fixd.ads: Likewise. * exp_imgv.adb: Likewise. * exp_imgv.ads: Likewise. * exp_intr.adb: Likewise. * exp_intr.ads: Likewise. * exp_pakd.adb: Likewise. * exp_pakd.ads: Likewise. * exp_prag.adb: Likewise. * exp_prag.ads: Likewise. * exp_sel.adb: Likewise. * exp_sel.ads: Likewise. * exp_smem.adb: Likewise. * exp_smem.ads: Likewise. * exp_spark.adb: Likewise. * exp_spark.ads: Likewise. * exp_strm.adb: Likewise. * exp_strm.ads: Likewise. * exp_tss.adb: Likewise. * exp_tss.ads: Likewise. * exp_unst.adb: Likewise. * exp_unst.ads: Likewise. * exp_util.adb: Likewise. * exp_util.ads: Likewise. * expander.adb: Likewise. * expander.ads: Likewise. * expect.c: Likewise. * fe.h: Likewise. * final.c: Likewise. * fmap.adb: Likewise. * fmap.ads: Likewise. * fname-sf.adb: Likewise. * fname-sf.ads: Likewise. * fname-uf.adb: Likewise. * fname-uf.ads: Likewise. * fname.adb: Likewise. * fname.ads: Likewise. * freeze.adb: Likewise. * freeze.ads: Likewise. * frontend.adb: Likewise. * frontend.ads: Likewise. * get_scos.adb: Likewise. * get_scos.ads: Likewise. * get_targ.adb: Likewise. * get_targ.ads: Likewise. * ghost.adb: Likewise. * ghost.ads: Likewise. * gnat1drv.adb: Likewise. * gnat1drv.ads: Likewise. * gnatbind.adb: Likewise. * gnatbind.ads: Likewise. * gnatchop.adb: Likewise. * gnatclean.adb: Likewise. * gnatcmd.adb: Likewise. * gnatcmd.ads: Likewise. * gnatdll.adb: Likewise. * gnatfind.adb: Likewise. * gnatkr.adb: Likewise. * gnatkr.ads: Likewise. * gnatlink.adb: Likewise. * gnatlink.ads: Likewise. * gnatls.adb: Likewise. * gnatls.ads: Likewise. * gnatmake.adb: Likewise. * gnatmake.ads: Likewise. * gnatname.adb: Likewise. * gnatname.ads: Likewise. * gnatprep.adb: Likewise. * gnatprep.ads: Likewise. * gnatvsn.adb: Likewise. * gnatxref.adb: Likewise. * gprep.adb: Likewise. * gprep.ads: Likewise. * gsocket.h: Likewise. * hostparm.ads: Likewise. * impunit.adb: Likewise. * impunit.ads: Likewise. * indepsw-aix.adb: Likewise. * indepsw-darwin.adb: Likewise. * indepsw-gnu.adb: Likewise. * indepsw.adb: Likewise. * indepsw.ads: Likewise. * init.c: Likewise. * initialize.c: Likewise. * inline.adb: Likewise. * inline.ads: Likewise. * itypes.adb: Likewise. * itypes.ads: Likewise. * krunch.adb: Likewise. * krunch.ads: Likewise. * layout.adb: Likewise. * layout.ads: Likewise. * lib-list.adb: Likewise. * lib-load.adb: Likewise. * lib-load.ads: Likewise. * lib-sort.adb: Likewise. * lib-util.adb: Likewise. * lib-util.ads: Likewise. * lib-writ.adb: Likewise. * lib-writ.ads: Likewise. * lib-xref-spark_specific.adb: Likewise. * lib-xref.adb: Likewise. * lib-xref.ads: Likewise. * lib.adb: Likewise. * lib.ads: Likewise. * libgnarl/a-astaco.adb: Likewise. * libgnarl/a-dispat.adb: Likewise. * libgnarl/a-dynpri.adb: Likewise. * libgnarl/a-etgrbu.ads: Likewise. * libgnarl/a-exetim__darwin.adb: Likewise. * libgnarl/a-exetim__default.ads: Likewise. * libgnarl/a-exetim__mingw.adb: Likewise. * libgnarl/a-exetim__mingw.ads: Likewise. * libgnarl/a-exetim__posix.adb: Likewise. * libgnarl/a-interr.adb: Likewise. * libgnarl/a-interr.ads: Likewise. * libgnarl/a-intnam.ads: Likewise. * libgnarl/a-intnam__aix.ads: Likewise. * libgnarl/a-intnam__darwin.ads: Likewise. * libgnarl/a-intnam__dragonfly.ads: Likewise. * libgnarl/a-intnam__dummy.ads: Likewise. * libgnarl/a-intnam__freebsd.ads: Likewise. * libgnarl/a-intnam__hpux.ads: Likewise. * libgnarl/a-intnam__linux.ads: Likewise. * libgnarl/a-intnam__lynxos.ads: Likewise. * libgnarl/a-intnam__mingw.ads: Likewise. * libgnarl/a-intnam__qnx.ads: Likewise. * libgnarl/a-intnam__rtems.ads: Likewise. * libgnarl/a-intnam__solaris.ads: Likewise. * libgnarl/a-intnam__vxworks.ads: Likewise. * libgnarl/a-reatim.adb: Likewise. * libgnarl/a-reatim.ads: Likewise. * libgnarl/a-retide.adb: Likewise. * libgnarl/a-retide.ads: Likewise. * libgnarl/a-rttiev.adb: Likewise. * libgnarl/a-rttiev.ads: Likewise. * libgnarl/a-synbar.adb: Likewise. * libgnarl/a-synbar.ads: Likewise. * libgnarl/a-synbar__posix.adb: Likewise. * libgnarl/a-synbar__posix.ads: Likewise. * libgnarl/a-sytaco.adb: Likewise. * libgnarl/a-sytaco.ads: Likewise. * libgnarl/a-tasatt.adb: Likewise. * libgnarl/a-tasatt.ads: Likewise. * libgnarl/a-taside.adb: Likewise. * libgnarl/a-taside.ads: Likewise. * libgnarl/a-taster.adb: Likewise. * libgnarl/g-boubuf.adb: Likewise. * libgnarl/g-boubuf.ads: Likewise. * libgnarl/g-boumai.ads: Likewise. * libgnarl/g-semaph.adb: Likewise. * libgnarl/g-semaph.ads: Likewise. * libgnarl/g-signal.adb: Likewise. * libgnarl/g-signal.ads: Likewise. * libgnarl/g-tastus.ads: Likewise. * libgnarl/g-thread.adb: Likewise. * libgnarl/g-thread.ads: Likewise. * libgnarl/i-vxinco.adb: Likewise. * libgnarl/i-vxinco.ads: Likewise. * libgnarl/s-inmaop.ads: Likewise. * libgnarl/s-inmaop__dummy.adb: Likewise. * libgnarl/s-inmaop__posix.adb: Likewise. * libgnarl/s-inmaop__vxworks.adb: Likewise. * libgnarl/s-interr.adb: Likewise. * libgnarl/s-interr.ads: Likewise. * libgnarl/s-interr__dummy.adb: Likewise. * libgnarl/s-interr__hwint.adb: Likewise. * libgnarl/s-interr__sigaction.adb: Likewise. * libgnarl/s-interr__vxworks.adb: Likewise. * libgnarl/s-intman.ads: Likewise. * libgnarl/s-intman__android.adb: Likewise. * libgnarl/s-intman__dummy.adb: Likewise. * libgnarl/s-intman__lynxos.adb: Likewise. * libgnarl/s-intman__mingw.adb: Likewise. * libgnarl/s-intman__posix.adb: Likewise. * libgnarl/s-intman__qnx.adb: Likewise. * libgnarl/s-intman__solaris.adb: Likewise. * libgnarl/s-intman__susv3.adb: Likewise. * libgnarl/s-intman__vxworks.adb: Likewise. * libgnarl/s-intman__vxworks.ads: Likewise. * libgnarl/s-linux.ads: Likewise. * libgnarl/s-linux__alpha.ads: Likewise. * libgnarl/s-linux__android.ads: Likewise. * libgnarl/s-linux__hppa.ads: Likewise. * libgnarl/s-linux__mips.ads: Likewise. * libgnarl/s-linux__riscv.ads: Likewise. * libgnarl/s-linux__sparc.ads: Likewise. * libgnarl/s-linux__x32.ads: Likewise. * libgnarl/s-mudido.adb: Likewise. * libgnarl/s-mudido__affinity.adb: Likewise. * libgnarl/s-osinte__aix.adb: Likewise. * libgnarl/s-osinte__aix.ads: Likewise. * libgnarl/s-osinte__android.adb: Likewise. * libgnarl/s-osinte__android.ads: Likewise. * libgnarl/s-osinte__darwin.adb: Likewise. * libgnarl/s-osinte__darwin.ads: Likewise. * libgnarl/s-osinte__dragonfly.adb: Likewise. * libgnarl/s-osinte__dragonfly.ads: Likewise. * libgnarl/s-osinte__dummy.ads: Likewise. * libgnarl/s-osinte__freebsd.adb: Likewise. * libgnarl/s-osinte__freebsd.ads: Likewise. * libgnarl/s-osinte__gnu.adb: Likewise. * libgnarl/s-osinte__gnu.ads: Likewise. * libgnarl/s-osinte__hpux-dce.adb: Likewise. * libgnarl/s-osinte__hpux-dce.ads: Likewise. * libgnarl/s-osinte__hpux.ads: Likewise. * libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise. * libgnarl/s-osinte__linux.ads: Likewise. * libgnarl/s-osinte__lynxos178.adb: Likewise. * libgnarl/s-osinte__lynxos178e.ads: Likewise. * libgnarl/s-osinte__mingw.ads: Likewise. * libgnarl/s-osinte__posix.adb: Likewise. * libgnarl/s-osinte__qnx.adb: Likewise. * libgnarl/s-osinte__qnx.ads: Likewise. * libgnarl/s-osinte__rtems.adb: Likewise. * libgnarl/s-osinte__rtems.ads: Likewise. * libgnarl/s-osinte__solaris.adb: Likewise. * libgnarl/s-osinte__solaris.ads: Likewise. * libgnarl/s-osinte__vxworks.adb: Likewise. * libgnarl/s-osinte__vxworks.ads: Likewise. * libgnarl/s-osinte__x32.adb: Likewise. * libgnarl/s-proinf.adb: Likewise. * libgnarl/s-proinf.ads: Likewise. * libgnarl/s-qnx.ads: Likewise. * libgnarl/s-solita.adb: Likewise. * libgnarl/s-solita.ads: Likewise. * libgnarl/s-stusta.adb: Likewise. * libgnarl/s-stusta.ads: Likewise. * libgnarl/s-taasde.adb: Likewise. * libgnarl/s-taasde.ads: Likewise. * libgnarl/s-tadeca.adb: Likewise. * libgnarl/s-tadeca.ads: Likewise. * libgnarl/s-tadert.adb: Likewise. * libgnarl/s-tadert.ads: Likewise. * libgnarl/s-taenca.adb: Likewise. * libgnarl/s-taenca.ads: Likewise. * libgnarl/s-taprob.adb: Likewise. * libgnarl/s-taprob.ads: Likewise. * libgnarl/s-taprop.ads: Likewise. * libgnarl/s-taprop__dummy.adb: Likewise. * libgnarl/s-taprop__hpux-dce.adb: Likewise. * libgnarl/s-taprop__linux.adb: Likewise. * libgnarl/s-taprop__mingw.adb: Likewise. * libgnarl/s-taprop__posix.adb: Likewise. * libgnarl/s-taprop__qnx.adb: Likewise. * libgnarl/s-taprop__solaris.adb: Likewise. * libgnarl/s-taprop__vxworks.adb: Likewise. * libgnarl/s-tarest.adb: Likewise. * libgnarl/s-tarest.ads: Likewise. * libgnarl/s-tasdeb.adb: Likewise. * libgnarl/s-tasdeb.ads: Likewise. * libgnarl/s-tasinf.adb: Likewise. * libgnarl/s-tasinf.ads: Likewise. * libgnarl/s-tasinf__linux.adb: Likewise. * libgnarl/s-tasinf__linux.ads: Likewise. * libgnarl/s-tasinf__mingw.adb: Likewise. * libgnarl/s-tasinf__mingw.ads: Likewise. * libgnarl/s-tasinf__solaris.adb: Likewise. * libgnarl/s-tasinf__solaris.ads: Likewise. * libgnarl/s-tasinf__vxworks.ads: Likewise. * libgnarl/s-tasini.adb: Likewise. * libgnarl/s-tasini.ads: Likewise. * libgnarl/s-taskin.adb: Likewise. * libgnarl/s-taskin.ads: Likewise. * libgnarl/s-taspri__dummy.ads: Likewise. * libgnarl/s-taspri__hpux-dce.ads: Likewise. * libgnarl/s-taspri__lynxos.ads: Likewise. * libgnarl/s-taspri__mingw.ads: Likewise. * libgnarl/s-taspri__posix-noaltstack.ads: Likewise. * libgnarl/s-taspri__posix.ads: Likewise. * libgnarl/s-taspri__solaris.ads: Likewise. * libgnarl/s-taspri__vxworks.ads: Likewise. * libgnarl/s-tasque.adb: Likewise. * libgnarl/s-tasque.ads: Likewise. * libgnarl/s-tasren.adb: Likewise. * libgnarl/s-tasren.ads: Likewise. * libgnarl/s-tasres.ads: Likewise. * libgnarl/s-tassta.adb: Likewise. * libgnarl/s-tassta.ads: Likewise. * libgnarl/s-tasuti.adb: Likewise. * libgnarl/s-tasuti.ads: Likewise. * libgnarl/s-tataat.adb: Likewise. * libgnarl/s-tataat.ads: Likewise. * libgnarl/s-tpinop.adb: Likewise. * libgnarl/s-tpinop.ads: Likewise. * libgnarl/s-tpoaal.adb: Likewise. * libgnarl/s-tpoben.adb: Likewise. * libgnarl/s-tpoben.ads: Likewise. * libgnarl/s-tpobmu.adb: Likewise. * libgnarl/s-tpobmu.ads: Likewise. * libgnarl/s-tpobop.adb: Likewise. * libgnarl/s-tpobop.ads: Likewise. * libgnarl/s-tpopmo.adb: Likewise. * libgnarl/s-tpopsp__posix-foreign.adb: Likewise. * libgnarl/s-tpopsp__posix.adb: Likewise. * libgnarl/s-tpopsp__solaris.adb: Likewise. * libgnarl/s-tpopsp__tls.adb: Likewise. * libgnarl/s-tpopsp__vxworks-rtp.adb: Likewise. * libgnarl/s-tpopsp__vxworks-tls.adb: Likewise. * libgnarl/s-tpopsp__vxworks.adb: Likewise. * libgnarl/s-tporft.adb: Likewise. * libgnarl/s-tposen.adb: Likewise. * libgnarl/s-tposen.ads: Likewise. * libgnarl/s-vxwext.adb: Likewise. * libgnarl/s-vxwext.ads: Likewise. * libgnarl/s-vxwext__kernel-smp.adb: Likewise. * libgnarl/s-vxwext__kernel.adb: Likewise. * libgnarl/s-vxwext__kernel.ads: Likewise. * libgnarl/s-vxwext__noints.adb: Likewise. * libgnarl/s-vxwext__rtp-smp.adb: Likewise. * libgnarl/s-vxwext__rtp.adb: Likewise. * libgnarl/s-vxwext__rtp.ads: Likewise. * libgnarl/s-vxwext__vthreads.ads: Likewise. * libgnarl/s-vxwork__aarch64.ads: Likewise. * libgnarl/s-vxwork__arm.ads: Likewise. * libgnarl/s-vxwork__ppc.ads: Likewise. * libgnarl/s-vxwork__x86.ads: Likewise. * libgnarl/thread.c: Likewise. * libgnat/a-assert.adb: Likewise. * libgnat/a-assert.ads: Likewise. * libgnat/a-btgbso.adb: Likewise. * libgnat/a-btgbso.ads: Likewise. * libgnat/a-calari.adb: Likewise. * libgnat/a-calari.ads: Likewise. * libgnat/a-calcon.adb: Likewise. * libgnat/a-calcon.ads: Likewise. * libgnat/a-caldel.adb: Likewise. * libgnat/a-caldel.ads: Likewise. * libgnat/a-calend.adb: Likewise. * libgnat/a-calend.ads: Likewise. * libgnat/a-calfor.adb: Likewise. * libgnat/a-calfor.ads: Likewise. * libgnat/a-catizo.adb: Likewise. * libgnat/a-cbdlli.adb: Likewise. * libgnat/a-cbdlli.ads: Likewise. * libgnat/a-cbhama.adb: Likewise. * libgnat/a-cbhama.ads: Likewise. * libgnat/a-cbhase.adb: Likewise. * libgnat/a-cbhase.ads: Likewise. * libgnat/a-cbmutr.adb: Likewise. * libgnat/a-cbmutr.ads: Likewise. * libgnat/a-cborma.adb: Likewise. * libgnat/a-cborma.ads: Likewise. * libgnat/a-cborse.adb: Likewise. * libgnat/a-cborse.ads: Likewise. * libgnat/a-cbprqu.adb: Likewise. * libgnat/a-cbprqu.ads: Likewise. * libgnat/a-cbsyqu.adb: Likewise. * libgnat/a-cbsyqu.ads: Likewise. * libgnat/a-cdlili.adb: Likewise. * libgnat/a-cdlili.ads: Likewise. * libgnat/a-cfdlli.adb: Likewise. * libgnat/a-cfdlli.ads: Likewise. * libgnat/a-cfhama.adb: Likewise. * libgnat/a-cfhama.ads: Likewise. * libgnat/a-cfhase.adb: Likewise. * libgnat/a-cfhase.ads: Likewise. * libgnat/a-cfinve.adb: Likewise. * libgnat/a-cfinve.ads: Likewise. * libgnat/a-cforma.adb: Likewise. * libgnat/a-cforma.ads: Likewise. * libgnat/a-cforse.adb: Likewise. * libgnat/a-cforse.ads: Likewise. * libgnat/a-cgaaso.adb: Likewise. * libgnat/a-cgaaso.ads: Likewise. * libgnat/a-cgarso.adb: Likewise. * libgnat/a-cgcaso.adb: Likewise. * libgnat/a-chacon.adb: Likewise. * libgnat/a-chacon.ads: Likewise. * libgnat/a-chahan.adb: Likewise. * libgnat/a-chahan.ads: Likewise. * libgnat/a-chlat9.ads: Likewise. * libgnat/a-chtgbk.adb: Likewise. * libgnat/a-chtgbk.ads: Likewise. * libgnat/a-chtgbo.adb: Likewise. * libgnat/a-chtgbo.ads: Likewise. * libgnat/a-chtgke.adb: Likewise. * libgnat/a-chtgke.ads: Likewise. * libgnat/a-chtgop.adb: Likewise. * libgnat/a-chtgop.ads: Likewise. * libgnat/a-chzla1.ads: Likewise. * libgnat/a-chzla9.ads: Likewise. * libgnat/a-cidlli.adb: Likewise. * libgnat/a-cidlli.ads: Likewise. * libgnat/a-cihama.adb: Likewise. * libgnat/a-cihama.ads: Likewise. * libgnat/a-cihase.adb: Likewise. * libgnat/a-cihase.ads: Likewise. * libgnat/a-cimutr.adb: Likewise. * libgnat/a-cimutr.ads: Likewise. * libgnat/a-ciorma.adb: Likewise. * libgnat/a-ciorma.ads: Likewise. * libgnat/a-ciormu.adb: Likewise. * libgnat/a-ciormu.ads: Likewise. * libgnat/a-ciorse.adb: Likewise. * libgnat/a-ciorse.ads: Likewise. * libgnat/a-clrefi.adb: Likewise. * libgnat/a-clrefi.ads: Likewise. * libgnat/a-coboho.adb: Likewise. * libgnat/a-coboho.ads: Likewise. * libgnat/a-cobove.adb: Likewise. * libgnat/a-cobove.ads: Likewise. * libgnat/a-cofove.adb: Likewise. * libgnat/a-cofove.ads: Likewise. * libgnat/a-cofuba.adb: Likewise. * libgnat/a-cofuba.ads: Likewise. * libgnat/a-cofuma.adb: Likewise. * libgnat/a-cofuma.ads: Likewise. * libgnat/a-cofuse.adb: Likewise. * libgnat/a-cofuse.ads: Likewise. * libgnat/a-cofuve.adb: Likewise. * libgnat/a-cofuve.ads: Likewise. * libgnat/a-cogeso.adb: Likewise. * libgnat/a-cogeso.ads: Likewise. * libgnat/a-cohama.adb: Likewise. * libgnat/a-cohama.ads: Likewise. * libgnat/a-cohase.adb: Likewise. * libgnat/a-cohase.ads: Likewise. * libgnat/a-cohata.ads: Likewise. * libgnat/a-coinho.adb: Likewise. * libgnat/a-coinho.ads: Likewise. * libgnat/a-coinho__shared.adb: Likewise. * libgnat/a-coinho__shared.ads: Likewise. * libgnat/a-coinve.adb: Likewise. * libgnat/a-coinve.ads: Likewise. * libgnat/a-colien.adb: Likewise. * libgnat/a-colien.ads: Likewise. * libgnat/a-colire.adb: Likewise. * libgnat/a-colire.ads: Likewise. * libgnat/a-comlin.adb: Likewise. * libgnat/a-comlin.ads: Likewise. * libgnat/a-comutr.adb: Likewise. * libgnat/a-comutr.ads: Likewise. * libgnat/a-conhel.adb: Likewise. * libgnat/a-conhel.ads: Likewise. * libgnat/a-convec.adb: Likewise. * libgnat/a-convec.ads: Likewise. * libgnat/a-coorma.adb: Likewise. * libgnat/a-coorma.ads: Likewise. * libgnat/a-coormu.adb: Likewise. * libgnat/a-coormu.ads: Likewise. * libgnat/a-coorse.adb: Likewise. * libgnat/a-coorse.ads: Likewise. * libgnat/a-coprnu.adb: Likewise. * libgnat/a-coprnu.ads: Likewise. * libgnat/a-crbltr.ads: Likewise. * libgnat/a-crbtgk.adb: Likewise. * libgnat/a-crbtgk.ads: Likewise. * libgnat/a-crbtgo.adb: Likewise. * libgnat/a-crbtgo.ads: Likewise. * libgnat/a-crdlli.adb: Likewise. * libgnat/a-crdlli.ads: Likewise. * libgnat/a-csquin.ads: Likewise. * libgnat/a-cuprqu.adb: Likewise. * libgnat/a-cuprqu.ads: Likewise. * libgnat/a-cusyqu.adb: Likewise. * libgnat/a-cusyqu.ads: Likewise. * libgnat/a-cwila1.ads: Likewise. * libgnat/a-cwila9.ads: Likewise. * libgnat/a-decima.adb: Likewise. * libgnat/a-decima.ads: Likewise. * libgnat/a-dhfina.adb: Likewise. * libgnat/a-dhfina.ads: Likewise. * libgnat/a-diocst.adb: Likewise. * libgnat/a-diocst.ads: Likewise. * libgnat/a-direct.adb: Likewise. * libgnat/a-direct.ads: Likewise. * libgnat/a-direio.adb: Likewise. * libgnat/a-direio.ads: Likewise. * libgnat/a-dirval.adb: Likewise. * libgnat/a-dirval.ads: Likewise. * libgnat/a-dirval__mingw.adb: Likewise. * libgnat/a-einuoc.adb: Likewise. * libgnat/a-einuoc.ads: Likewise. * libgnat/a-elchha.adb: Likewise. * libgnat/a-elchha.ads: Likewise. * libgnat/a-elchha__vxworks-ppc-full.adb: Likewise. * libgnat/a-envvar.adb: Likewise. * libgnat/a-excach.adb: Likewise. * libgnat/a-except.adb: Likewise. * libgnat/a-except.ads: Likewise. * libgnat/a-excpol.adb: Likewise. * libgnat/a-excpol__abort.adb: Likewise. * libgnat/a-exctra.adb: Likewise. * libgnat/a-exctra.ads: Likewise. * libgnat/a-exexda.adb: Likewise. * libgnat/a-exexpr.adb: Likewise. * libgnat/a-exextr.adb: Likewise. * libgnat/a-exstat.adb: Likewise. * libgnat/a-finali.adb: Likewise. * libgnat/a-finali.ads: Likewise. * libgnat/a-locale.adb: Likewise. * libgnat/a-locale.ads: Likewise. * libgnat/a-nbnbin.adb: Likewise. * libgnat/a-nbnbin__gmp.adb: Likewise. * libgnat/a-nbnbre.adb: Likewise. * libgnat/a-ngcefu.adb: Likewise. * libgnat/a-ngcoar.adb: Likewise. * libgnat/a-ngcoty.adb: Likewise. * libgnat/a-ngcoty.ads: Likewise. * libgnat/a-ngelfu.adb: Likewise. * libgnat/a-ngelfu.ads: Likewise. * libgnat/a-ngrear.adb: Likewise. * libgnat/a-ngrear.ads: Likewise. * libgnat/a-nudira.adb: Likewise. * libgnat/a-nudira.ads: Likewise. * libgnat/a-nuflra.adb: Likewise. * libgnat/a-nuflra.ads: Likewise. * libgnat/a-numaux.ads: Likewise. * libgnat/a-numaux__darwin.adb: Likewise. * libgnat/a-numaux__darwin.ads: Likewise. * libgnat/a-numaux__libc-x86.ads: Likewise. * libgnat/a-numaux__vxworks.ads: Likewise. * libgnat/a-numaux__x86.adb: Likewise. * libgnat/a-numaux__x86.ads: Likewise. * libgnat/a-rbtgbk.adb: Likewise. * libgnat/a-rbtgbk.ads: Likewise. * libgnat/a-rbtgbo.adb: Likewise. * libgnat/a-rbtgbo.ads: Likewise. * libgnat/a-rbtgso.adb: Likewise. * libgnat/a-rbtgso.ads: Likewise. * libgnat/a-sbecin.adb: Likewise. * libgnat/a-sbecin.ads: Likewise. * libgnat/a-sbhcin.adb: Likewise. * libgnat/a-sbhcin.ads: Likewise. * libgnat/a-sblcin.adb: Likewise. * libgnat/a-sblcin.ads: Likewise. * libgnat/a-secain.adb: Likewise. * libgnat/a-secain.ads: Likewise. * libgnat/a-sequio.adb: Likewise. * libgnat/a-sequio.ads: Likewise. * libgnat/a-sfecin.ads: Likewise. * libgnat/a-sfhcin.ads: Likewise. * libgnat/a-sflcin.ads: Likewise. * libgnat/a-shcain.adb: Likewise. * libgnat/a-shcain.ads: Likewise. * libgnat/a-siocst.adb: Likewise. * libgnat/a-siocst.ads: Likewise. * libgnat/a-slcain.adb: Likewise. * libgnat/a-slcain.ads: Likewise. * libgnat/a-ssicst.adb: Likewise. * libgnat/a-ssicst.ads: Likewise. * libgnat/a-stboha.adb: Likewise. * libgnat/a-stmaco.ads: Likewise. * libgnat/a-storio.adb: Likewise. * libgnat/a-strbou.adb: Likewise. * libgnat/a-strbou.ads: Likewise. * libgnat/a-stream.adb: Likewise. * libgnat/a-stream.ads: Likewise. * libgnat/a-strfix.adb: Likewise. * libgnat/a-strhas.adb: Likewise. * libgnat/a-strmap.adb: Likewise. * libgnat/a-strmap.ads: Likewise. * libgnat/a-strsea.adb: Likewise. * libgnat/a-strsea.ads: Likewise. * libgnat/a-strsup.adb: Likewise. * libgnat/a-strsup.ads: Likewise. * libgnat/a-strunb.adb: Likewise. * libgnat/a-strunb.ads: Likewise. * libgnat/a-strunb__shared.adb: Likewise. * libgnat/a-strunb__shared.ads: Likewise. * libgnat/a-ststio.adb: Likewise. * libgnat/a-ststio.ads: Likewise. * libgnat/a-stunau.adb: Likewise. * libgnat/a-stunau.ads: Likewise. * libgnat/a-stunau__shared.adb: Likewise. * libgnat/a-stunha.adb: Likewise. * libgnat/a-stuten.adb: Likewise. * libgnat/a-stwibo.adb: Likewise. * libgnat/a-stwibo.ads: Likewise. * libgnat/a-stwifi.adb: Likewise. * libgnat/a-stwiha.adb: Likewise. * libgnat/a-stwima.adb: Likewise. * libgnat/a-stwima.ads: Likewise. * libgnat/a-stwise.adb: Likewise. * libgnat/a-stwise.ads: Likewise. * libgnat/a-stwisu.adb: Likewise. * libgnat/a-stwisu.ads: Likewise. * libgnat/a-stwiun.adb: Likewise. * libgnat/a-stwiun.ads: Likewise. * libgnat/a-stwiun__shared.adb: Likewise. * libgnat/a-stwiun__shared.ads: Likewise. * libgnat/a-stzbou.adb: Likewise. * libgnat/a-stzbou.ads: Likewise. * libgnat/a-stzfix.adb: Likewise. * libgnat/a-stzhas.adb: Likewise. * libgnat/a-stzmap.adb: Likewise. * libgnat/a-stzmap.ads: Likewise. * libgnat/a-stzsea.adb: Likewise. * libgnat/a-stzsea.ads: Likewise. * libgnat/a-stzsup.adb: Likewise. * libgnat/a-stzsup.ads: Likewise. * libgnat/a-stzunb.adb: Likewise. * libgnat/a-stzunb.ads: Likewise. * libgnat/a-stzunb__shared.adb: Likewise. * libgnat/a-stzunb__shared.ads: Likewise. * libgnat/a-suecin.adb: Likewise. * libgnat/a-suecin.ads: Likewise. * libgnat/a-suenco.adb: Likewise. * libgnat/a-suenst.adb: Likewise. * libgnat/a-suewst.adb: Likewise. * libgnat/a-suezst.adb: Likewise. * libgnat/a-suhcin.adb: Likewise. * libgnat/a-suhcin.ads: Likewise. * libgnat/a-sulcin.adb: Likewise. * libgnat/a-sulcin.ads: Likewise. * libgnat/a-suteio.adb: Likewise. * libgnat/a-suteio.ads: Likewise. * libgnat/a-suteio__shared.adb: Likewise. * libgnat/a-swbwha.adb: Likewise. * libgnat/a-swmwco.ads: Likewise. * libgnat/a-swunau.adb: Likewise. * libgnat/a-swunau.ads: Likewise. * libgnat/a-swunau__shared.adb: Likewise. * libgnat/a-swuwha.adb: Likewise. * libgnat/a-swuwti.adb: Likewise. * libgnat/a-swuwti.ads: Likewise. * libgnat/a-swuwti__shared.adb: Likewise. * libgnat/a-szbzha.adb: Likewise. * libgnat/a-szmzco.ads: Likewise. * libgnat/a-szunau.adb: Likewise. * libgnat/a-szunau.ads: Likewise. * libgnat/a-szunau__shared.adb: Likewise. * libgnat/a-szuzha.adb: Likewise. * libgnat/a-szuzti.adb: Likewise. * libgnat/a-szuzti.ads: Likewise. * libgnat/a-szuzti__shared.adb: Likewise. * libgnat/a-tags.adb: Likewise. * libgnat/a-tags.ads: Likewise. * libgnat/a-teioed.adb: Likewise. * libgnat/a-teioed.ads: Likewise. * libgnat/a-textio.adb: Likewise. * libgnat/a-textio.ads: Likewise. * libgnat/a-tiboio.adb: Likewise. * libgnat/a-ticoau.adb: Likewise. * libgnat/a-ticoau.ads: Likewise. * libgnat/a-ticoio.adb: Likewise. * libgnat/a-ticoio.ads: Likewise. * libgnat/a-tideau.adb: Likewise. * libgnat/a-tideau.ads: Likewise. * libgnat/a-tideio.adb: Likewise. * libgnat/a-tideio.ads: Likewise. * libgnat/a-tienau.adb: Likewise. * libgnat/a-tienau.ads: Likewise. * libgnat/a-tienio.adb: Likewise. * libgnat/a-tifiio.adb: Likewise. * libgnat/a-tiflau.adb: Likewise. * libgnat/a-tiflau.ads: Likewise. * libgnat/a-tiflio.adb: Likewise. * libgnat/a-tiflio.ads: Likewise. * libgnat/a-tigeau.adb: Likewise. * libgnat/a-tigeau.ads: Likewise. * libgnat/a-tigeli.adb: Likewise. * libgnat/a-tiinau.adb: Likewise. * libgnat/a-tiinau.ads: Likewise. * libgnat/a-tiinio.adb: Likewise. * libgnat/a-tiinio.ads: Likewise. * libgnat/a-timoau.adb: Likewise. * libgnat/a-timoau.ads: Likewise. * libgnat/a-timoio.adb: Likewise. * libgnat/a-timoio.ads: Likewise. * libgnat/a-tiocst.adb: Likewise. * libgnat/a-tiocst.ads: Likewise. * libgnat/a-tirsfi.adb: Likewise. * libgnat/a-tirsfi.ads: Likewise. * libgnat/a-titest.adb: Likewise. * libgnat/a-undesu.adb: Likewise. * libgnat/a-wichha.adb: Likewise. * libgnat/a-wichun.adb: Likewise. * libgnat/a-wichun.ads: Likewise. * libgnat/a-witeio.adb: Likewise. * libgnat/a-witeio.ads: Likewise. * libgnat/a-wrstfi.adb: Likewise. * libgnat/a-wrstfi.ads: Likewise. * libgnat/a-wtcoau.adb: Likewise. * libgnat/a-wtcoau.ads: Likewise. * libgnat/a-wtcoio.adb: Likewise. * libgnat/a-wtcstr.adb: Likewise. * libgnat/a-wtcstr.ads: Likewise. * libgnat/a-wtdeau.adb: Likewise. * libgnat/a-wtdeau.ads: Likewise. * libgnat/a-wtdeio.adb: Likewise. * libgnat/a-wtedit.adb: Likewise. * libgnat/a-wtedit.ads: Likewise. * libgnat/a-wtenau.adb: Likewise. * libgnat/a-wtenau.ads: Likewise. * libgnat/a-wtenio.adb: Likewise. * libgnat/a-wtfiio.adb: Likewise. * libgnat/a-wtflau.adb: Likewise. * libgnat/a-wtflau.ads: Likewise. * libgnat/a-wtflio.adb: Likewise. * libgnat/a-wtgeau.adb: Likewise. * libgnat/a-wtgeau.ads: Likewise. * libgnat/a-wtinau.adb: Likewise. * libgnat/a-wtinau.ads: Likewise. * libgnat/a-wtinio.adb: Likewise. * libgnat/a-wtmoau.adb: Likewise. * libgnat/a-wtmoau.ads: Likewise. * libgnat/a-wtmoio.adb: Likewise. * libgnat/a-wtmoio.ads: Likewise. * libgnat/a-wttest.adb: Likewise. * libgnat/a-wwboio.adb: Likewise. * libgnat/a-zchhan.adb: Likewise. * libgnat/a-zchuni.adb: Likewise. * libgnat/a-zchuni.ads: Likewise. * libgnat/a-zrstfi.adb: Likewise. * libgnat/a-zrstfi.ads: Likewise. * libgnat/a-ztcoau.adb: Likewise. * libgnat/a-ztcoio.adb: Likewise. * libgnat/a-ztcstr.adb: Likewise. * libgnat/a-ztcstr.ads: Likewise. * libgnat/a-ztdeau.adb: Likewise. * libgnat/a-ztdeau.ads: Likewise. * libgnat/a-ztdeio.adb: Likewise. * libgnat/a-ztedit.adb: Likewise. * libgnat/a-ztedit.ads: Likewise. * libgnat/a-ztenau.adb: Likewise. * libgnat/a-ztenau.ads: Likewise. * libgnat/a-ztenio.adb: Likewise. * libgnat/a-ztexio.adb: Likewise. * libgnat/a-ztexio.ads: Likewise. * libgnat/a-ztfiio.adb: Likewise. * libgnat/a-ztflau.adb: Likewise. * libgnat/a-ztflau.ads: Likewise. * libgnat/a-ztflio.adb: Likewise. * libgnat/a-ztgeau.adb: Likewise. * libgnat/a-ztgeau.ads: Likewise. * libgnat/a-ztinau.adb: Likewise. * libgnat/a-ztinau.ads: Likewise. * libgnat/a-ztinio.adb: Likewise. * libgnat/a-ztmoau.adb: Likewise. * libgnat/a-ztmoau.ads: Likewise. * libgnat/a-ztmoio.adb: Likewise. * libgnat/a-zttest.adb: Likewise. * libgnat/a-zzboio.adb: Likewise. * libgnat/g-allein.ads: Likewise. * libgnat/g-alleve.adb: Likewise. * libgnat/g-alleve.ads: Likewise. * libgnat/g-alleve__hard.adb: Likewise. * libgnat/g-alleve__hard.ads: Likewise. * libgnat/g-altcon.adb: Likewise. * libgnat/g-altcon.ads: Likewise. * libgnat/g-altive.ads: Likewise. * libgnat/g-alveop.adb: Likewise. * libgnat/g-alveop.ads: Likewise. * libgnat/g-alvety.ads: Likewise. * libgnat/g-alvevi.ads: Likewise. * libgnat/g-arrspl.adb: Likewise. * libgnat/g-arrspl.ads: Likewise. * libgnat/g-awk.adb: Likewise. * libgnat/g-awk.ads: Likewise. * libgnat/g-binenv.adb: Likewise. * libgnat/g-binenv.ads: Likewise. * libgnat/g-brapre.ads: Likewise. * libgnat/g-bubsor.adb: Likewise. * libgnat/g-bubsor.ads: Likewise. * libgnat/g-busora.adb: Likewise. * libgnat/g-busora.ads: Likewise. * libgnat/g-busorg.adb: Likewise. * libgnat/g-busorg.ads: Likewise. * libgnat/g-byorma.adb: Likewise. * libgnat/g-byorma.ads: Likewise. * libgnat/g-bytswa.adb: Likewise. * libgnat/g-bytswa.ads: Likewise. * libgnat/g-calend.adb: Likewise. * libgnat/g-calend.ads: Likewise. * libgnat/g-casuti.adb: Likewise. * libgnat/g-casuti.ads: Likewise. * libgnat/g-catiio.adb: Likewise. * libgnat/g-catiio.ads: Likewise. * libgnat/g-cgi.adb: Likewise. * libgnat/g-cgi.ads: Likewise. * libgnat/g-cgicoo.adb: Likewise. * libgnat/g-cgicoo.ads: Likewise. * libgnat/g-cgideb.adb: Likewise. * libgnat/g-cgideb.ads: Likewise. * libgnat/g-comlin.adb: Likewise. * libgnat/g-comlin.ads: Likewise. * libgnat/g-comver.adb: Likewise. * libgnat/g-comver.ads: Likewise. * libgnat/g-cppexc.adb: Likewise. * libgnat/g-cppexc.ads: Likewise. * libgnat/g-crc32.adb: Likewise. * libgnat/g-crc32.ads: Likewise. * libgnat/g-ctrl_c.adb: Likewise. * libgnat/g-ctrl_c.ads: Likewise. * libgnat/g-curexc.ads: Likewise. * libgnat/g-debpoo.adb: Likewise. * libgnat/g-debpoo.ads: Likewise. * libgnat/g-debuti.adb: Likewise. * libgnat/g-debuti.ads: Likewise. * libgnat/g-decstr.adb: Likewise. * libgnat/g-decstr.ads: Likewise. * libgnat/g-deutst.ads: Likewise. * libgnat/g-diopit.adb: Likewise. * libgnat/g-diopit.ads: Likewise. * libgnat/g-dirope.adb: Likewise. * libgnat/g-dirope.ads: Likewise. * libgnat/g-dynhta.adb: Likewise. * libgnat/g-dynhta.ads: Likewise. * libgnat/g-dyntab.adb: Likewise. * libgnat/g-dyntab.ads: Likewise. * libgnat/g-eacodu.adb: Likewise. * libgnat/g-encstr.adb: Likewise. * libgnat/g-encstr.ads: Likewise. * libgnat/g-enutst.ads: Likewise. * libgnat/g-excact.adb: Likewise. * libgnat/g-excact.ads: Likewise. * libgnat/g-except.ads: Likewise. * libgnat/g-exctra.adb: Likewise. * libgnat/g-exctra.ads: Likewise. * libgnat/g-expect.adb: Likewise. * libgnat/g-expect.ads: Likewise. * libgnat/g-exptty.adb: Likewise. * libgnat/g-exptty.ads: Likewise. * libgnat/g-flocon.ads: Likewise. * libgnat/g-forstr.adb: Likewise. * libgnat/g-forstr.ads: Likewise. * libgnat/g-graphs.adb: Likewise. * libgnat/g-graphs.ads: Likewise. * libgnat/g-heasor.adb: Likewise. * libgnat/g-heasor.ads: Likewise. * libgnat/g-hesora.adb: Likewise. * libgnat/g-hesora.ads: Likewise. * libgnat/g-hesorg.adb: Likewise. * libgnat/g-hesorg.ads: Likewise. * libgnat/g-htable.adb: Likewise. * libgnat/g-htable.ads: Likewise. * libgnat/g-io-put__vxworks.adb: Likewise. * libgnat/g-io.adb: Likewise. * libgnat/g-io.ads: Likewise. * libgnat/g-io_aux.adb: Likewise. * libgnat/g-io_aux.ads: Likewise. * libgnat/g-lists.adb: Likewise. * libgnat/g-lists.ads: Likewise. * libgnat/g-locfil.adb: Likewise. * libgnat/g-locfil.ads: Likewise. * libgnat/g-mbdira.adb: Likewise. * libgnat/g-mbdira.ads: Likewise. * libgnat/g-mbflra.adb: Likewise. * libgnat/g-mbflra.ads: Likewise. * libgnat/g-md5.adb: Likewise. * libgnat/g-md5.ads: Likewise. * libgnat/g-memdum.adb: Likewise. * libgnat/g-memdum.ads: Likewise. * libgnat/g-moreex.adb: Likewise. * libgnat/g-moreex.ads: Likewise. * libgnat/g-os_lib.adb: Likewise. * libgnat/g-os_lib.ads: Likewise. * libgnat/g-pehage.adb: Likewise. * libgnat/g-pehage.ads: Likewise. * libgnat/g-rannum.adb: Likewise. * libgnat/g-rannum.ads: Likewise. * libgnat/g-regexp.adb: Likewise. * libgnat/g-regexp.ads: Likewise. * libgnat/g-regist.adb: Likewise. * libgnat/g-regist.ads: Likewise. * libgnat/g-regpat.adb: Likewise. * libgnat/g-regpat.ads: Likewise. * libgnat/g-rewdat.adb: Likewise. * libgnat/g-rewdat.ads: Likewise. * libgnat/g-sechas.adb: Likewise. * libgnat/g-sechas.ads: Likewise. * libgnat/g-sehamd.adb: Likewise. * libgnat/g-sehamd.ads: Likewise. * libgnat/g-sehash.adb: Likewise. * libgnat/g-sehash.ads: Likewise. * libgnat/g-sercom.adb: Likewise. * libgnat/g-sercom.ads: Likewise. * libgnat/g-sercom__linux.adb: Likewise. * libgnat/g-sercom__mingw.adb: Likewise. * libgnat/g-sestin.ads: Likewise. * libgnat/g-sets.adb: Likewise. * libgnat/g-sets.ads: Likewise. * libgnat/g-sha1.adb: Likewise. * libgnat/g-sha1.ads: Likewise. * libgnat/g-sha224.ads: Likewise. * libgnat/g-sha256.ads: Likewise. * libgnat/g-sha384.ads: Likewise. * libgnat/g-sha512.ads: Likewise. * libgnat/g-shsh32.adb: Likewise. * libgnat/g-shsh32.ads: Likewise. * libgnat/g-shsh64.adb: Likewise. * libgnat/g-shsh64.ads: Likewise. * libgnat/g-shshco.adb: Likewise. * libgnat/g-shshco.ads: Likewise. * libgnat/g-soccon.ads: Likewise. * libgnat/g-socket.adb: Likewise. * libgnat/g-socket.ads: Likewise. * libgnat/g-socket__dummy.adb: Likewise. * libgnat/g-socket__dummy.ads: Likewise. * libgnat/g-socthi.adb: Likewise. * libgnat/g-socthi.ads: Likewise. * libgnat/g-socthi__dummy.adb: Likewise. * libgnat/g-socthi__dummy.ads: Likewise. * libgnat/g-socthi__mingw.adb: Likewise. * libgnat/g-socthi__mingw.ads: Likewise. * libgnat/g-socthi__vxworks.adb: Likewise. * libgnat/g-socthi__vxworks.ads: Likewise. * libgnat/g-soliop.ads: Likewise. * libgnat/g-soliop__lynxos.ads: Likewise. * libgnat/g-soliop__mingw.ads: Likewise. * libgnat/g-soliop__qnx.ads: Likewise. * libgnat/g-soliop__solaris.ads: Likewise. * libgnat/g-sothco.adb: Likewise. * libgnat/g-sothco.ads: Likewise. * libgnat/g-sothco__dummy.adb: Likewise. * libgnat/g-sothco__dummy.ads: Likewise. * libgnat/g-souinf.ads: Likewise. * libgnat/g-spchge.adb: Likewise. * libgnat/g-spchge.ads: Likewise. * libgnat/g-speche.adb: Likewise. * libgnat/g-speche.ads: Likewise. * libgnat/g-spipat.adb: Likewise. * libgnat/g-spipat.ads: Likewise. * libgnat/g-spitbo.adb: Likewise. * libgnat/g-spitbo.ads: Likewise. * libgnat/g-sptabo.ads: Likewise. * libgnat/g-sptain.ads: Likewise. * libgnat/g-sptavs.ads: Likewise. * libgnat/g-sse.ads: Likewise. * libgnat/g-ssvety.ads: Likewise. * libgnat/g-sthcso.adb: Likewise. * libgnat/g-stheme.adb: Likewise. * libgnat/g-strhas.ads: Likewise. * libgnat/g-string.adb: Likewise. * libgnat/g-string.ads: Likewise. * libgnat/g-strspl.ads: Likewise. * libgnat/g-stseme.adb: Likewise. * libgnat/g-stsifd__sockets.adb: Likewise. * libgnat/g-table.adb: Likewise. * libgnat/g-table.ads: Likewise. * libgnat/g-tasloc.adb: Likewise. * libgnat/g-tasloc.ads: Likewise. * libgnat/g-timsta.adb: Likewise. * libgnat/g-timsta.ads: Likewise. * libgnat/g-traceb.adb: Likewise. * libgnat/g-traceb.ads: Likewise. * libgnat/g-trasym.adb: Likewise. * libgnat/g-trasym.ads: Likewise. * libgnat/g-tty.adb: Likewise. * libgnat/g-tty.ads: Likewise. * libgnat/g-u3spch.adb: Likewise. * libgnat/g-u3spch.ads: Likewise. * libgnat/g-utf_32.adb: Likewise. * libgnat/g-utf_32.ads: Likewise. * libgnat/g-wispch.adb: Likewise. * libgnat/g-wispch.ads: Likewise. * libgnat/g-wistsp.ads: Likewise. * libgnat/g-zspche.adb: Likewise. * libgnat/g-zspche.ads: Likewise. * libgnat/g-zstspl.ads: Likewise. * libgnat/gnat.ads: Likewise. * libgnat/i-c.adb: Likewise. * libgnat/i-cexten.ads: Likewise. * libgnat/i-cobol.adb: Likewise. * libgnat/i-cobol.ads: Likewise. * libgnat/i-cpoint.adb: Likewise. * libgnat/i-cpoint.ads: Likewise. * libgnat/i-cstrea.adb: Likewise. * libgnat/i-cstrea.ads: Likewise. * libgnat/i-cstrin.adb: Likewise. * libgnat/i-cstrin.ads: Likewise. * libgnat/i-fortra.adb: Likewise. * libgnat/i-pacdec.adb: Likewise. * libgnat/i-pacdec.ads: Likewise. * libgnat/i-vxwoio.adb: Likewise. * libgnat/i-vxwoio.ads: Likewise. * libgnat/i-vxwork.ads: Likewise. * libgnat/i-vxwork__x86.ads: Likewise. * libgnat/interfac.ads: Likewise. * libgnat/memtrack.adb: Likewise. * libgnat/s-addima.adb: Likewise. * libgnat/s-addima.ads: Likewise. * libgnat/s-addope.adb: Likewise. * libgnat/s-addope.ads: Likewise. * libgnat/s-aotase.adb: Likewise. * libgnat/s-aotase.ads: Likewise. * libgnat/s-arit64.adb: Likewise. * libgnat/s-arit64.ads: Likewise. * libgnat/s-assert.adb: Likewise. * libgnat/s-assert.ads: Likewise. * libgnat/s-atacco.adb: Likewise. * libgnat/s-atacco.ads: Likewise. * libgnat/s-atocou.adb: Likewise. * libgnat/s-atocou.ads: Likewise. * libgnat/s-atocou__builtin.adb: Likewise. * libgnat/s-atocou__x86.adb: Likewise. * libgnat/s-atoope.ads: Likewise. * libgnat/s-atopar.adb: Likewise. * libgnat/s-atopar.ads: Likewise. * libgnat/s-atopex.adb: Likewise. * libgnat/s-atopex.ads: Likewise. * libgnat/s-atopri.adb: Likewise. * libgnat/s-atopri.ads: Likewise. * libgnat/s-auxdec.adb: Likewise. * libgnat/s-auxdec.ads: Likewise. * libgnat/s-bignum.adb: Likewise. * libgnat/s-bignum.ads: Likewise. * libgnat/s-bitfie.ads: Likewise. * libgnat/s-bitops.adb: Likewise. * libgnat/s-bitops.ads: Likewise. * libgnat/s-bituti.adb: Likewise. * libgnat/s-bituti.ads: Likewise. * libgnat/s-boarop.ads: Likewise. * libgnat/s-boustr.adb: Likewise. * libgnat/s-boustr.ads: Likewise. * libgnat/s-bytswa.ads: Likewise. * libgnat/s-carsi8.adb: Likewise. * libgnat/s-carsi8.ads: Likewise. * libgnat/s-carun8.adb: Likewise. * libgnat/s-carun8.ads: Likewise. * libgnat/s-casi16.adb: Likewise. * libgnat/s-casi16.ads: Likewise. * libgnat/s-casi32.adb: Likewise. * libgnat/s-casi32.ads: Likewise. * libgnat/s-casi64.adb: Likewise. * libgnat/s-casi64.ads: Likewise. * libgnat/s-casuti.adb: Likewise. * libgnat/s-casuti.ads: Likewise. * libgnat/s-caun16.adb: Likewise. * libgnat/s-caun16.ads: Likewise. * libgnat/s-caun32.adb: Likewise. * libgnat/s-caun32.ads: Likewise. * libgnat/s-caun64.adb: Likewise. * libgnat/s-caun64.ads: Likewise. * libgnat/s-chepoo.ads: Likewise. * libgnat/s-commun.adb: Likewise. * libgnat/s-commun.ads: Likewise. * libgnat/s-conca2.adb: Likewise. * libgnat/s-conca2.ads: Likewise. * libgnat/s-conca3.adb: Likewise. * libgnat/s-conca3.ads: Likewise. * libgnat/s-conca4.adb: Likewise. * libgnat/s-conca4.ads: Likewise. * libgnat/s-conca5.adb: Likewise. * libgnat/s-conca5.ads: Likewise. * libgnat/s-conca6.adb: Likewise. * libgnat/s-conca6.ads: Likewise. * libgnat/s-conca7.adb: Likewise. * libgnat/s-conca7.ads: Likewise. * libgnat/s-conca8.adb: Likewise. * libgnat/s-conca8.ads: Likewise. * libgnat/s-conca9.adb: Likewise. * libgnat/s-conca9.ads: Likewise. * libgnat/s-crc32.adb: Likewise. * libgnat/s-crc32.ads: Likewise. * libgnat/s-crtl.ads: Likewise. * libgnat/s-dfmkio.ads: Likewise. * libgnat/s-dfmopr.ads: Likewise. * libgnat/s-dgmgop.ads: Likewise. * libgnat/s-diflio.adb: Likewise. * libgnat/s-diflio.ads: Likewise. * libgnat/s-diflmk.ads: Likewise. * libgnat/s-digemk.ads: Likewise. * libgnat/s-diinio.adb: Likewise. * libgnat/s-diinio.ads: Likewise. * libgnat/s-dilomk.ads: Likewise. * libgnat/s-dim.ads: Likewise. * libgnat/s-dimkio.ads: Likewise. * libgnat/s-dimmks.ads: Likewise. * libgnat/s-direio.adb: Likewise. * libgnat/s-direio.ads: Likewise. * libgnat/s-dlmkio.ads: Likewise. * libgnat/s-dlmopr.ads: Likewise. * libgnat/s-dmotpr.ads: Likewise. * libgnat/s-dsaser.ads: Likewise. * libgnat/s-dwalin.adb: Likewise. * libgnat/s-dwalin.ads: Likewise. * libgnat/s-elaall.adb: Likewise. * libgnat/s-elaall.ads: Likewise. * libgnat/s-excdeb.adb: Likewise. * libgnat/s-excdeb.ads: Likewise. * libgnat/s-except.adb: Likewise. * libgnat/s-except.ads: Likewise. * libgnat/s-excmac__arm.adb: Likewise. * libgnat/s-excmac__arm.ads: Likewise. * libgnat/s-excmac__gcc.adb: Likewise. * libgnat/s-excmac__gcc.ads: Likewise. * libgnat/s-exctab.adb: Likewise. * libgnat/s-exctab.ads: Likewise. * libgnat/s-exctra.adb: Likewise. * libgnat/s-exctra.ads: Likewise. * libgnat/s-exnint.adb: Likewise. * libgnat/s-exnint.ads: Likewise. * libgnat/s-exnllf.adb: Likewise. * libgnat/s-exnllf.ads: Likewise. * libgnat/s-exnlli.adb: Likewise. * libgnat/s-exnlli.ads: Likewise. * libgnat/s-expint.adb: Likewise. * libgnat/s-expint.ads: Likewise. * libgnat/s-explli.adb: Likewise. * libgnat/s-explli.ads: Likewise. * libgnat/s-expllu.adb: Likewise. * libgnat/s-expllu.ads: Likewise. * libgnat/s-expmod.adb: Likewise. * libgnat/s-expmod.ads: Likewise. * libgnat/s-expuns.adb: Likewise. * libgnat/s-expuns.ads: Likewise. * libgnat/s-fatflt.ads: Likewise. * libgnat/s-fatgen.adb: Likewise. * libgnat/s-fatgen.ads: Likewise. * libgnat/s-fatlfl.ads: Likewise. * libgnat/s-fatllf.ads: Likewise. * libgnat/s-fatsfl.ads: Likewise. * libgnat/s-ficobl.ads: Likewise. * libgnat/s-filatt.ads: Likewise. * libgnat/s-fileio.adb: Likewise. * libgnat/s-fileio.ads: Likewise. * libgnat/s-finmas.adb: Likewise. * libgnat/s-finmas.ads: Likewise. * libgnat/s-finroo.adb: Likewise. * libgnat/s-finroo.ads: Likewise. * libgnat/s-flocon.adb: Likewise. * libgnat/s-flocon.ads: Likewise. * libgnat/s-flocon__none.adb: Likewise. * libgnat/s-fore.adb: Likewise. * libgnat/s-fore.ads: Likewise. * libgnat/s-gearop.adb: Likewise. * libgnat/s-gearop.ads: Likewise. * libgnat/s-genbig.adb: Likewise. * libgnat/s-genbig.ads: Likewise. * libgnat/s-geveop.adb: Likewise. * libgnat/s-geveop.ads: Likewise. * libgnat/s-gloloc.adb: Likewise. * libgnat/s-gloloc.ads: Likewise. * libgnat/s-gloloc__mingw.adb: Likewise. * libgnat/s-htable.adb: Likewise. * libgnat/s-htable.ads: Likewise. * libgnat/s-imenne.adb: Likewise. * libgnat/s-imenne.ads: Likewise. * libgnat/s-imgbiu.adb: Likewise. * libgnat/s-imgbiu.ads: Likewise. * libgnat/s-imgboo.adb: Likewise. * libgnat/s-imgboo.ads: Likewise. * libgnat/s-imgcha.adb: Likewise. * libgnat/s-imgcha.ads: Likewise. * libgnat/s-imgdec.adb: Likewise. * libgnat/s-imgdec.ads: Likewise. * libgnat/s-imgenu.adb: Likewise. * libgnat/s-imgenu.ads: Likewise. * libgnat/s-imgint.adb: Likewise. * libgnat/s-imgint.ads: Likewise. * libgnat/s-imgllb.adb: Likewise. * libgnat/s-imgllb.ads: Likewise. * libgnat/s-imglld.adb: Likewise. * libgnat/s-imglld.ads: Likewise. * libgnat/s-imglli.adb: Likewise. * libgnat/s-imglli.ads: Likewise. * libgnat/s-imgllu.adb: Likewise. * libgnat/s-imgllu.ads: Likewise. * libgnat/s-imgllw.adb: Likewise. * libgnat/s-imgllw.ads: Likewise. * libgnat/s-imgrea.adb: Likewise. * libgnat/s-imgrea.ads: Likewise. * libgnat/s-imguns.adb: Likewise. * libgnat/s-imguns.ads: Likewise. * libgnat/s-imgwch.adb: Likewise. * libgnat/s-imgwch.ads: Likewise. * libgnat/s-imgwiu.adb: Likewise. * libgnat/s-imgwiu.ads: Likewise. * libgnat/s-io.adb: Likewise. * libgnat/s-io.ads: Likewise. * libgnat/s-llflex.ads: Likewise. * libgnat/s-maccod.ads: Likewise. * libgnat/s-mantis.adb: Likewise. * libgnat/s-mantis.ads: Likewise. * libgnat/s-mastop.adb: Likewise. * libgnat/s-mastop.ads: Likewise. * libgnat/s-memcop.ads: Likewise. * libgnat/s-memory.adb: Likewise. * libgnat/s-memory.ads: Likewise. * libgnat/s-mmap.adb: Likewise. * libgnat/s-mmap.ads: Likewise. * libgnat/s-mmauni__long.ads: Likewise. * libgnat/s-mmosin__mingw.adb: Likewise. * libgnat/s-mmosin__mingw.ads: Likewise. * libgnat/s-mmosin__unix.adb: Likewise. * libgnat/s-mmosin__unix.ads: Likewise. * libgnat/s-multip.adb: Likewise. * libgnat/s-objrea.adb: Likewise. * libgnat/s-objrea.ads: Likewise. * libgnat/s-optide.adb: Likewise. * libgnat/s-os_lib.adb: Likewise. * libgnat/s-os_lib.ads: Likewise. * libgnat/s-osprim.ads: Likewise. * libgnat/s-osprim__darwin.adb: Likewise. * libgnat/s-osprim__lynxos.ads: Likewise. * libgnat/s-osprim__mingw.adb: Likewise. * libgnat/s-osprim__posix.adb: Likewise. * libgnat/s-osprim__posix2008.adb: Likewise. * libgnat/s-osprim__rtems.adb: Likewise. * libgnat/s-osprim__solaris.adb: Likewise. * libgnat/s-osprim__unix.adb: Likewise. * libgnat/s-osprim__vxworks.adb: Likewise. * libgnat/s-osprim__x32.adb: Likewise. * libgnat/s-osvers__vxworks-653.ads: Likewise. * libgnat/s-pack03.adb: Likewise. * libgnat/s-pack03.ads: Likewise. * libgnat/s-pack05.adb: Likewise. * libgnat/s-pack05.ads: Likewise. * libgnat/s-pack06.adb: Likewise. * libgnat/s-pack06.ads: Likewise. * libgnat/s-pack07.adb: Likewise. * libgnat/s-pack07.ads: Likewise. * libgnat/s-pack09.adb: Likewise. * libgnat/s-pack09.ads: Likewise. * libgnat/s-pack10.adb: Likewise. * libgnat/s-pack10.ads: Likewise. * libgnat/s-pack11.adb: Likewise. * libgnat/s-pack11.ads: Likewise. * libgnat/s-pack12.adb: Likewise. * libgnat/s-pack12.ads: Likewise. * libgnat/s-pack13.adb: Likewise. * libgnat/s-pack13.ads: Likewise. * libgnat/s-pack14.adb: Likewise. * libgnat/s-pack14.ads: Likewise. * libgnat/s-pack15.adb: Likewise. * libgnat/s-pack15.ads: Likewise. * libgnat/s-pack17.adb: Likewise. * libgnat/s-pack17.ads: Likewise. * libgnat/s-pack18.adb: Likewise. * libgnat/s-pack18.ads: Likewise. * libgnat/s-pack19.adb: Likewise. * libgnat/s-pack19.ads: Likewise. * libgnat/s-pack20.adb: Likewise. * libgnat/s-pack20.ads: Likewise. * libgnat/s-pack21.adb: Likewise. * libgnat/s-pack21.ads: Likewise. * libgnat/s-pack22.adb: Likewise. * libgnat/s-pack22.ads: Likewise. * libgnat/s-pack23.adb: Likewise. * libgnat/s-pack23.ads: Likewise. * libgnat/s-pack24.adb: Likewise. * libgnat/s-pack24.ads: Likewise. * libgnat/s-pack25.adb: Likewise. * libgnat/s-pack25.ads: Likewise. * libgnat/s-pack26.adb: Likewise. * libgnat/s-pack26.ads: Likewise. * libgnat/s-pack27.adb: Likewise. * libgnat/s-pack27.ads: Likewise. * libgnat/s-pack28.adb: Likewise. * libgnat/s-pack28.ads: Likewise. * libgnat/s-pack29.adb: Likewise. * libgnat/s-pack29.ads: Likewise. * libgnat/s-pack30.adb: Likewise. * libgnat/s-pack30.ads: Likewise. * libgnat/s-pack31.adb: Likewise. * libgnat/s-pack31.ads: Likewise. * libgnat/s-pack33.adb: Likewise. * libgnat/s-pack33.ads: Likewise. * libgnat/s-pack34.adb: Likewise. * libgnat/s-pack34.ads: Likewise. * libgnat/s-pack35.adb: Likewise. * libgnat/s-pack35.ads: Likewise. * libgnat/s-pack36.adb: Likewise. * libgnat/s-pack36.ads: Likewise. * libgnat/s-pack37.adb: Likewise. * libgnat/s-pack37.ads: Likewise. * libgnat/s-pack38.adb: Likewise. * libgnat/s-pack38.ads: Likewise. * libgnat/s-pack39.adb: Likewise. * libgnat/s-pack39.ads: Likewise. * libgnat/s-pack40.adb: Likewise. * libgnat/s-pack40.ads: Likewise. * libgnat/s-pack41.adb: Likewise. * libgnat/s-pack41.ads: Likewise. * libgnat/s-pack42.adb: Likewise. * libgnat/s-pack42.ads: Likewise. * libgnat/s-pack43.adb: Likewise. * libgnat/s-pack43.ads: Likewise. * libgnat/s-pack44.adb: Likewise. * libgnat/s-pack44.ads: Likewise. * libgnat/s-pack45.adb: Likewise. * libgnat/s-pack45.ads: Likewise. * libgnat/s-pack46.adb: Likewise. * libgnat/s-pack46.ads: Likewise. * libgnat/s-pack47.adb: Likewise. * libgnat/s-pack47.ads: Likewise. * libgnat/s-pack48.adb: Likewise. * libgnat/s-pack48.ads: Likewise. * libgnat/s-pack49.adb: Likewise. * libgnat/s-pack49.ads: Likewise. * libgnat/s-pack50.adb: Likewise. * libgnat/s-pack50.ads: Likewise. * libgnat/s-pack51.adb: Likewise. * libgnat/s-pack51.ads: Likewise. * libgnat/s-pack52.adb: Likewise. * libgnat/s-pack52.ads: Likewise. * libgnat/s-pack53.adb: Likewise. * libgnat/s-pack53.ads: Likewise. * libgnat/s-pack54.adb: Likewise. * libgnat/s-pack54.ads: Likewise. * libgnat/s-pack55.adb: Likewise. * libgnat/s-pack55.ads: Likewise. * libgnat/s-pack56.adb: Likewise. * libgnat/s-pack56.ads: Likewise. * libgnat/s-pack57.adb: Likewise. * libgnat/s-pack57.ads: Likewise. * libgnat/s-pack58.adb: Likewise. * libgnat/s-pack58.ads: Likewise. * libgnat/s-pack59.adb: Likewise. * libgnat/s-pack59.ads: Likewise. * libgnat/s-pack60.adb: Likewise. * libgnat/s-pack60.ads: Likewise. * libgnat/s-pack61.adb: Likewise. * libgnat/s-pack61.ads: Likewise. * libgnat/s-pack62.adb: Likewise. * libgnat/s-pack62.ads: Likewise. * libgnat/s-pack63.adb: Likewise. * libgnat/s-pack63.ads: Likewise. * libgnat/s-parame.adb: Likewise. * libgnat/s-parame.ads: Likewise. * libgnat/s-parame__ae653.ads: Likewise. * libgnat/s-parame__hpux.ads: Likewise. * libgnat/s-parame__rtems.adb: Likewise. * libgnat/s-parame__vxworks.adb: Likewise. * libgnat/s-parame__vxworks.ads: Likewise. * libgnat/s-parint.adb: Likewise. * libgnat/s-parint.ads: Likewise. * libgnat/s-pooglo.adb: Likewise. * libgnat/s-pooglo.ads: Likewise. * libgnat/s-pooloc.adb: Likewise. * libgnat/s-pooloc.ads: Likewise. * libgnat/s-poosiz.adb: Likewise. * libgnat/s-poosiz.ads: Likewise. * libgnat/s-powtab.ads: Likewise. * libgnat/s-purexc.ads: Likewise. * libgnat/s-rannum.adb: Likewise. * libgnat/s-rannum.ads: Likewise. * libgnat/s-ransee.adb: Likewise. * libgnat/s-ransee.ads: Likewise. * libgnat/s-regexp.adb: Likewise. * libgnat/s-regexp.ads: Likewise. * libgnat/s-regpat.adb: Likewise. * libgnat/s-regpat.ads: Likewise. * libgnat/s-resfil.adb: Likewise. * libgnat/s-resfil.ads: Likewise. * libgnat/s-restri.adb: Likewise. * libgnat/s-restri.ads: Likewise. * libgnat/s-rident.ads: Likewise. * libgnat/s-rpc.adb: Likewise. * libgnat/s-rpc.ads: Likewise. * libgnat/s-scaval.adb: Likewise. * libgnat/s-scaval.ads: Likewise. * libgnat/s-secsta.adb: Likewise. * libgnat/s-secsta.ads: Likewise. * libgnat/s-sequio.adb: Likewise. * libgnat/s-sequio.ads: Likewise. * libgnat/s-shasto.adb: Likewise. * libgnat/s-shasto.ads: Likewise. * libgnat/s-soflin.adb: Likewise. * libgnat/s-soflin.ads: Likewise. * libgnat/s-soliin.adb: Likewise. * libgnat/s-soliin.ads: Likewise. * libgnat/s-sopco3.adb: Likewise. * libgnat/s-sopco3.ads: Likewise. * libgnat/s-sopco4.adb: Likewise. * libgnat/s-sopco4.ads: Likewise. * libgnat/s-sopco5.adb: Likewise. * libgnat/s-sopco5.ads: Likewise. * libgnat/s-spsufi.adb: Likewise. * libgnat/s-spsufi.ads: Likewise. * libgnat/s-stache.adb: Likewise. * libgnat/s-stache.ads: Likewise. * libgnat/s-stalib.adb: Likewise. * libgnat/s-stalib.ads: Likewise. * libgnat/s-stausa.adb: Likewise. * libgnat/s-stausa.ads: Likewise. * libgnat/s-stchop.adb: Likewise. * libgnat/s-stchop.ads: Likewise. * libgnat/s-stchop__limit.ads: Likewise. * libgnat/s-stchop__rtems.adb: Likewise. * libgnat/s-stchop__vxworks.adb: Likewise. * libgnat/s-stoele.adb: Likewise. * libgnat/s-stoele.ads: Likewise. * libgnat/s-stopoo.adb: Likewise. * libgnat/s-stopoo.ads: Likewise. * libgnat/s-stposu.adb: Likewise. * libgnat/s-stposu.ads: Likewise. * libgnat/s-stratt.adb: Likewise. * libgnat/s-stratt.ads: Likewise. * libgnat/s-stratt__xdr.adb: Likewise. * libgnat/s-strcom.adb: Likewise. * libgnat/s-strcom.ads: Likewise. * libgnat/s-strhas.adb: Likewise. * libgnat/s-strhas.ads: Likewise. * libgnat/s-string.adb: Likewise. * libgnat/s-string.ads: Likewise. * libgnat/s-strops.adb: Likewise. * libgnat/s-strops.ads: Likewise. * libgnat/s-ststop.adb: Likewise. * libgnat/s-ststop.ads: Likewise. * libgnat/s-tasloc.adb: Likewise. * libgnat/s-tasloc.ads: Likewise. * libgnat/s-thread.ads: Likewise. * libgnat/s-thread__ae653.adb: Likewise. * libgnat/s-traceb.adb: Likewise. * libgnat/s-traceb.ads: Likewise. * libgnat/s-traceb__hpux.adb: Likewise. * libgnat/s-traceb__mastop.adb: Likewise. * libgnat/s-traent.adb: Likewise. * libgnat/s-traent.ads: Likewise. * libgnat/s-trasym.adb: Likewise. * libgnat/s-trasym.ads: Likewise. * libgnat/s-trasym__dwarf.adb: Likewise. * libgnat/s-tsmona.adb: Likewise. * libgnat/s-tsmona__linux.adb: Likewise. * libgnat/s-tsmona__mingw.adb: Likewise. * libgnat/s-unstyp.ads: Likewise. * libgnat/s-utf_32.adb: Likewise. * libgnat/s-utf_32.ads: Likewise. * libgnat/s-valboo.adb: Likewise. * libgnat/s-valboo.ads: Likewise. * libgnat/s-valcha.adb: Likewise. * libgnat/s-valcha.ads: Likewise. * libgnat/s-valdec.adb: Likewise. * libgnat/s-valdec.ads: Likewise. * libgnat/s-valenu.adb: Likewise. * libgnat/s-valenu.ads: Likewise. * libgnat/s-valint.adb: Likewise. * libgnat/s-valint.ads: Likewise. * libgnat/s-vallld.adb: Likewise. * libgnat/s-vallld.ads: Likewise. * libgnat/s-vallli.adb: Likewise. * libgnat/s-vallli.ads: Likewise. * libgnat/s-valllu.adb: Likewise. * libgnat/s-valllu.ads: Likewise. * libgnat/s-valrea.adb: Likewise. * libgnat/s-valrea.ads: Likewise. * libgnat/s-valuns.adb: Likewise. * libgnat/s-valuns.ads: Likewise. * libgnat/s-valuti.adb: Likewise. * libgnat/s-valuti.ads: Likewise. * libgnat/s-valwch.adb: Likewise. * libgnat/s-valwch.ads: Likewise. * libgnat/s-veboop.adb: Likewise. * libgnat/s-veboop.ads: Likewise. * libgnat/s-vector.ads: Likewise. * libgnat/s-vercon.adb: Likewise. * libgnat/s-vercon.ads: Likewise. * libgnat/s-wchcnv.adb: Likewise. * libgnat/s-wchcnv.ads: Likewise. * libgnat/s-wchcon.adb: Likewise. * libgnat/s-wchcon.ads: Likewise. * libgnat/s-wchjis.adb: Likewise. * libgnat/s-wchjis.ads: Likewise. * libgnat/s-wchstw.adb: Likewise. * libgnat/s-wchstw.ads: Likewise. * libgnat/s-wchwts.adb: Likewise. * libgnat/s-wchwts.ads: Likewise. * libgnat/s-widboo.adb: Likewise. * libgnat/s-widboo.ads: Likewise. * libgnat/s-widcha.adb: Likewise. * libgnat/s-widcha.ads: Likewise. * libgnat/s-widenu.adb: Likewise. * libgnat/s-widenu.ads: Likewise. * libgnat/s-widlli.adb: Likewise. * libgnat/s-widlli.ads: Likewise. * libgnat/s-widllu.adb: Likewise. * libgnat/s-widllu.ads: Likewise. * libgnat/s-widwch.adb: Likewise. * libgnat/s-widwch.ads: Likewise. * libgnat/s-win32.ads: Likewise. * libgnat/s-winext.ads: Likewise. * libgnat/s-wwdcha.adb: Likewise. * libgnat/s-wwdcha.ads: Likewise. * libgnat/s-wwdenu.adb: Likewise. * libgnat/s-wwdenu.ads: Likewise. * libgnat/s-wwdwch.adb: Likewise. * libgnat/s-wwdwch.ads: Likewise. * libgnat/system-aix.ads: Likewise. * libgnat/system-darwin-arm.ads: Likewise. * libgnat/system-darwin-ppc.ads: Likewise. * libgnat/system-darwin-x86.ads: Likewise. * libgnat/system-djgpp.ads: Likewise. * libgnat/system-dragonfly-x86_64.ads: Likewise. * libgnat/system-freebsd.ads: Likewise. * libgnat/system-hpux-ia64.ads: Likewise. * libgnat/system-hpux.ads: Likewise. * libgnat/system-linux-alpha.ads: Likewise. * libgnat/system-linux-arm.ads: Likewise. * libgnat/system-linux-hppa.ads: Likewise. * libgnat/system-linux-ia64.ads: Likewise. * libgnat/system-linux-m68k.ads: Likewise. * libgnat/system-linux-mips.ads: Likewise. * libgnat/system-linux-ppc.ads: Likewise. * libgnat/system-linux-riscv.ads: Likewise. * libgnat/system-linux-s390.ads: Likewise. * libgnat/system-linux-sh4.ads: Likewise. * libgnat/system-linux-sparc.ads: Likewise. * libgnat/system-linux-x86.ads: Likewise. * libgnat/system-lynxos178-ppc.ads: Likewise. * libgnat/system-lynxos178-x86.ads: Likewise. * libgnat/system-mingw.ads: Likewise. * libgnat/system-qnx-aarch64.ads: Likewise. * libgnat/system-rtems.ads: Likewise. * libgnat/system-solaris-sparc.ads: Likewise. * libgnat/system-solaris-x86.ads: Likewise. * libgnat/system-vxworks-arm-rtp-smp.ads: Likewise. * libgnat/system-vxworks-arm-rtp.ads: Likewise. * libgnat/system-vxworks-arm.ads: Likewise. * libgnat/system-vxworks-e500-kernel.ads: Likewise. * libgnat/system-vxworks-e500-rtp-smp.ads: Likewise. * libgnat/system-vxworks-e500-rtp.ads: Likewise. * libgnat/system-vxworks-e500-vthread.ads: Likewise. * libgnat/system-vxworks-ppc-kernel.ads: Likewise. * libgnat/system-vxworks-ppc-ravenscar.ads: Likewise. * libgnat/system-vxworks-ppc-rtp-smp.ads: Likewise. * libgnat/system-vxworks-ppc-rtp.ads: Likewise. * libgnat/system-vxworks-ppc-vthread.ads: Likewise. * libgnat/system-vxworks-ppc.ads: Likewise. * libgnat/system-vxworks-x86-kernel.ads: Likewise. * libgnat/system-vxworks-x86-rtp-smp.ads: Likewise. * libgnat/system-vxworks-x86-rtp.ads: Likewise. * libgnat/system-vxworks-x86-vthread.ads: Likewise. * libgnat/system-vxworks-x86.ads: Likewise. * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-aarch64.ads: Likewise. * libgnat/system-vxworks7-arm-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-arm.ads: Likewise. * libgnat/system-vxworks7-e500-kernel.ads: Likewise. * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-e500-rtp.ads: Likewise. * libgnat/system-vxworks7-ppc-kernel.ads: Likewise. * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-ppc-rtp.ads: Likewise. * libgnat/system-vxworks7-ppc64-kernel.ads: Likewise. * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-x86-kernel.ads: Likewise. * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-x86-rtp.ads: Likewise. * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise. * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise. * libgnat/system.ads: Likewise. * link.c: Likewise. * live.adb: Likewise. * live.ads: Likewise. * locales.c: Likewise. * make.adb: Likewise. * make.ads: Likewise. * make_util.adb: Likewise. * make_util.ads: Likewise. * makeusg.adb: Likewise. * makeusg.ads: Likewise. * mdll-fil.adb: Likewise. * mdll-fil.ads: Likewise. * mdll-utl.adb: Likewise. * mdll-utl.ads: Likewise. * mdll.adb: Likewise. * mdll.ads: Likewise. * mingw32.h: Likewise. * mkdir.c: Likewise. * namet-sp.adb: Likewise. * namet-sp.ads: Likewise. * namet.adb: Likewise. * namet.ads: Likewise. * namet.h: Likewise. * nlists.adb: Likewise. * nlists.ads: Likewise. * nlists.h: Likewise. * opt.adb: Likewise. * opt.ads: Likewise. * osint-b.adb: Likewise. * osint-b.ads: Likewise. * osint-c.adb: Likewise. * osint-c.ads: Likewise. * osint-l.adb: Likewise. * osint-l.ads: Likewise. * osint-m.adb: Likewise. * osint-m.ads: Likewise. * osint.adb: Likewise. * osint.ads: Likewise. * output.adb: Likewise. * output.ads: Likewise. * par-ch10.adb: Likewise. * par-ch11.adb: Likewise. * par-ch12.adb: Likewise. * par-ch13.adb: Likewise. * par-ch2.adb: Likewise. * par-ch3.adb: Likewise. * par-ch4.adb: Likewise. * par-ch5.adb: Likewise. * par-ch6.adb: Likewise. * par-ch7.adb: Likewise. * par-ch8.adb: Likewise. * par-ch9.adb: Likewise. * par-endh.adb: Likewise. * par-labl.adb: Likewise. * par-load.adb: Likewise. * par-prag.adb: Likewise. * par-sync.adb: Likewise. * par-tchk.adb: Likewise. * par-util.adb: Likewise. * par.adb: Likewise. * par.ads: Likewise. * par_sco.adb: Likewise. * par_sco.ads: Likewise. * pprint.adb: Likewise. * pprint.ads: Likewise. * prep.adb: Likewise. * prep.ads: Likewise. * prepcomp.adb: Likewise. * prepcomp.ads: Likewise. * put_scos.adb: Likewise. * put_scos.ads: Likewise. * raise-gcc.c: Likewise. * raise.c: Likewise. * raise.h: Likewise. * repinfo-input.adb: Likewise. * repinfo-input.ads: Likewise. * repinfo.adb: Likewise. * repinfo.ads: Likewise. * repinfo.h: Likewise. * restrict.adb: Likewise. * restrict.ads: Likewise. * rident.ads: Likewise. * rtfinal.c: Likewise. * rtinit.c: Likewise. * rtsfind.adb: Likewise. * rtsfind.ads: Likewise. * runtime.h: Likewise. * s-oscons-tmplt.c: Likewise. * sa_messages.adb: Likewise. * sa_messages.ads: Likewise. * scans.adb: Likewise. * scans.ads: Likewise. * scil_ll.adb: Likewise. * scil_ll.ads: Likewise. * scn.adb: Likewise. * scn.ads: Likewise. * scng.adb: Likewise. * scng.ads: Likewise. * scos.adb: Likewise. * scos.ads: Likewise. * scos.h: Likewise. * sdefault.ads: Likewise. * seh_init.c: Likewise. * sem.adb: Likewise. * sem.ads: Likewise. * sem_aggr.adb: Likewise. * sem_aggr.ads: Likewise. * sem_attr.adb: Likewise. * sem_attr.ads: Likewise. * sem_aux.adb: Likewise. * sem_aux.ads: Likewise. * sem_case.adb: Likewise. * sem_case.ads: Likewise. * sem_cat.adb: Likewise. * sem_cat.ads: Likewise. * sem_ch10.adb: Likewise. * sem_ch10.ads: Likewise. * sem_ch11.adb: Likewise. * sem_ch11.ads: Likewise. * sem_ch12.adb: Likewise. * sem_ch12.ads: Likewise. * sem_ch13.adb: Likewise. * sem_ch13.ads: Likewise. * sem_ch2.adb: Likewise. * sem_ch2.ads: Likewise. * sem_ch3.adb: Likewise. * sem_ch3.ads: Likewise. * sem_ch4.adb: Likewise. * sem_ch4.ads: Likewise. * sem_ch5.adb: Likewise. * sem_ch5.ads: Likewise. * sem_ch6.adb: Likewise. * sem_ch6.ads: Likewise. * sem_ch7.adb: Likewise. * sem_ch7.ads: Likewise. * sem_ch8.adb: Likewise. * sem_ch8.ads: Likewise. * sem_ch9.adb: Likewise. * sem_ch9.ads: Likewise. * sem_dim.adb: Likewise. * sem_dim.ads: Likewise. * sem_disp.adb: Likewise. * sem_disp.ads: Likewise. * sem_dist.adb: Likewise. * sem_dist.ads: Likewise. * sem_elab.adb: Likewise. * sem_elab.ads: Likewise. * sem_elim.adb: Likewise. * sem_elim.ads: Likewise. * sem_eval.adb: Likewise. * sem_eval.ads: Likewise. * sem_intr.adb: Likewise. * sem_intr.ads: Likewise. * sem_mech.adb: Likewise. * sem_mech.ads: Likewise. * sem_prag.adb: Likewise. * sem_prag.ads: Likewise. * sem_res.adb: Likewise. * sem_res.ads: Likewise. * sem_scil.adb: Likewise. * sem_scil.ads: Likewise. * sem_smem.adb: Likewise. * sem_smem.ads: Likewise. * sem_type.adb: Likewise. * sem_type.ads: Likewise. * sem_util.adb: Likewise. * sem_util.ads: Likewise. * sem_warn.adb: Likewise. * sem_warn.ads: Likewise. * set_targ.adb: Likewise. * set_targ.ads: Likewise. * sfn_scan.adb: Likewise. * sfn_scan.ads: Likewise. * sigtramp-armdroid.c: Likewise. * sigtramp-ios.c: Likewise. * sigtramp-qnx.c: Likewise. * sigtramp-vxworks.c: Likewise. * sigtramp.h: Likewise. * sinfo-cn.adb: Likewise. * sinfo-cn.ads: Likewise. * sinfo.adb: Likewise. * sinfo.ads: Likewise. * sinput-c.adb: Likewise. * sinput-c.ads: Likewise. * sinput-d.adb: Likewise. * sinput-d.ads: Likewise. * sinput-l.adb: Likewise. * sinput-l.ads: Likewise. * sinput.adb: Likewise. * sinput.ads: Likewise. * socket.c: Likewise. * spark_xrefs.adb: Likewise. * spark_xrefs.ads: Likewise. * sprint.adb: Likewise. * sprint.ads: Likewise. * stand.adb: Likewise. * stand.ads: Likewise. * stringt.adb: Likewise. * stringt.ads: Likewise. * stringt.h: Likewise. * style.adb: Likewise. * style.ads: Likewise. * styleg.adb: Likewise. * styleg.ads: Likewise. * stylesw.adb: Likewise. * stylesw.ads: Likewise. * switch-b.adb: Likewise. * switch-b.ads: Likewise. * switch-c.adb: Likewise. * switch-c.ads: Likewise. * switch-m.adb: Likewise. * switch-m.ads: Likewise. * switch.adb: Likewise. * switch.ads: Likewise. * symbols.adb: Likewise. * symbols.ads: Likewise. * sysdep.c: Likewise. * table.adb: Likewise. * table.ads: Likewise. * targext.c: Likewise. * targparm.adb: Likewise. * targparm.ads: Likewise. * tbuild.adb: Likewise. * tbuild.ads: Likewise. * tempdir.adb: Likewise. * tempdir.ads: Likewise. * terminals.c: Likewise. * tracebak.c: Likewise. * tree_gen.adb: Likewise. * tree_gen.ads: Likewise. * tree_in.adb: Likewise. * tree_in.ads: Likewise. * tree_io.adb: Likewise. * tree_io.ads: Likewise. * treepr.adb: Likewise. * treepr.ads: Likewise. * ttypes.ads: Likewise. * types.adb: Likewise. * types.ads: Likewise. * types.h: Likewise. * uintp.adb: Likewise. * uintp.ads: Likewise. * uintp.h: Likewise. * uname.adb: Likewise. * uname.ads: Likewise. * urealp.adb: Likewise. * urealp.ads: Likewise. * urealp.h: Likewise. * usage.adb: Likewise. * usage.ads: Likewise. * validsw.adb: Likewise. * validsw.ads: Likewise. * warnsw.adb: Likewise. * warnsw.ads: Likewise. * widechar.adb: Likewise. * widechar.ads: Likewise. * xeinfo.adb: Likewise. * xnmake.adb: Likewise. * xoscons.adb: Likewise. * xr_tabls.adb: Likewise. * xr_tabls.ads: Likewise. * xref_lib.adb: Likewise. * xref_lib.ads: Likewise. * xsinfo.adb: Likewise. * xsnamest.adb: Likewise. * xtreeprs.adb: Likewise. * xutil.adb: Likewise. * xutil.ads: Likewise.
3147 lines
107 KiB
Ada
3147 lines
107 KiB
Ada
------------------------------------------------------------------------------
|
|
-- --
|
|
-- GNAT COMPILER COMPONENTS --
|
|
-- --
|
|
-- B I N D E --
|
|
-- --
|
|
-- B o d y --
|
|
-- --
|
|
-- Copyright (C) 1992-2020, 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 3, 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 COPYING3. If not, go to --
|
|
-- http://www.gnu.org/licenses for a complete copy of the license. --
|
|
-- --
|
|
-- GNAT was originally developed by the GNAT team at New York University. --
|
|
-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
|
-- --
|
|
------------------------------------------------------------------------------
|
|
|
|
with Binderr; use Binderr;
|
|
with Butil; use Butil;
|
|
with Debug; use Debug;
|
|
with Fname; use Fname;
|
|
with Opt; use Opt;
|
|
with Osint;
|
|
with Output; use Output;
|
|
with Table;
|
|
with Types; use Types;
|
|
|
|
with System.Case_Util; use System.Case_Util;
|
|
with System.HTable;
|
|
|
|
package body Binde is
|
|
use Unit_Id_Tables;
|
|
|
|
-- We now have Elab_New, a new elaboration-order algorithm.
|
|
--
|
|
-- However, any change to elaboration order can break some programs.
|
|
-- Therefore, we are keeping the old algorithm in place, to be selected
|
|
-- by switches.
|
|
--
|
|
-- The new algorithm has the following interesting properties:
|
|
--
|
|
-- * The static and dynamic models use the same elaboration order. The
|
|
-- static model might get an error, but if it does not, it will use
|
|
-- the same order as the dynamic model.
|
|
--
|
|
-- * Each SCC (see below) is elaborated together; that is, units from
|
|
-- different SCCs are not interspersed.
|
|
--
|
|
-- * In particular, this implies that if an SCC contains just a spec and
|
|
-- the corresponding body, and nothing else, the body will be
|
|
-- elaborated immediately after the spec. This is expected to result
|
|
-- in a better elaboration order for most programs, because in this
|
|
-- case, a call from outside the library unit cannot get ABE.
|
|
--
|
|
-- * Pragmas Elaborate_All (explicit and implicit) are ignored. Instead,
|
|
-- we behave as if every legal pragma Elaborate_All were present. That
|
|
-- is, if it would be legal to have "pragma Elaborate_All(Y);" on X,
|
|
-- then we behave as if such a pragma exists, even if it does not.
|
|
|
|
Do_Old : constant Boolean := False;
|
|
Do_New : constant Boolean := True;
|
|
-- True to enable the old and new algorithms, respectively. Used for
|
|
-- debugging/experimentation.
|
|
|
|
Doing_New : Boolean := False;
|
|
-- True if we are currently doing the new algorithm. Print certain
|
|
-- messages only when doing the "new" elab order algorithm, so we don't get
|
|
-- duplicates. And use different heuristics in Better_Choice_Optimistic.
|
|
|
|
-- The following data structures are used to represent the graph that is
|
|
-- used to determine the elaboration order (using a topological sort).
|
|
|
|
-- The following structures are used to record successors. If B is a
|
|
-- successor of A in this table, it means that A must be elaborated before
|
|
-- B is elaborated. For example, if Y (body) says "with X;", then Y (body)
|
|
-- will be a successor of X (spec), and X (spec) will be a predecessor of
|
|
-- Y (body).
|
|
--
|
|
-- Note that we store the successors of each unit explicitly. We don't
|
|
-- store the predecessors, but we store a count of them.
|
|
--
|
|
-- The basic algorithm is to first compute a directed graph of units (type
|
|
-- Unit_Node_Record, below), with successors as edges. A unit is "ready"
|
|
-- (to be chosen as the next to be elaborated) if it has no predecessors
|
|
-- that have not yet been chosen. We use heuristics to decide which of the
|
|
-- ready units should be elaborated next, and "choose" that one (which
|
|
-- means we append it to the elaboration-order table).
|
|
|
|
type Successor_Id is new Nat;
|
|
-- Identification of single successor entry
|
|
|
|
No_Successor : constant Successor_Id := 0;
|
|
-- Used to indicate end of list of successors
|
|
|
|
type Elab_All_Id is new Nat;
|
|
-- Identification of Elab_All entry link
|
|
|
|
No_Elab_All_Link : constant Elab_All_Id := 0;
|
|
-- Used to indicate end of list
|
|
|
|
-- Succ_Reason indicates the reason for a particular elaboration link
|
|
|
|
type Succ_Reason is
|
|
(Withed,
|
|
-- After directly with's Before, so the spec of Before must be
|
|
-- elaborated before After is elaborated.
|
|
|
|
Forced,
|
|
-- Before and After come from a pair of lines in the forced-elaboration-
|
|
-- order file.
|
|
|
|
Elab,
|
|
-- After directly mentions Before in a pragma Elaborate, so the body of
|
|
-- Before must be elaborated before After is elaborated.
|
|
|
|
Elab_All,
|
|
-- After either mentions Before directly in a pragma Elaborate_All, or
|
|
-- mentions a third unit, X, which itself requires that Before be
|
|
-- elaborated before unit X is elaborated. The Elab_All_Link list traces
|
|
-- the dependencies in the latter case.
|
|
|
|
Elab_All_Desirable,
|
|
-- This is just like Elab_All, except that the Elaborate_All was not
|
|
-- explicitly present in the source, but rather was created by the front
|
|
-- end, which decided that it was "desirable".
|
|
|
|
Elab_Desirable,
|
|
-- This is just like Elab, except that the Elaborate was not explicitly
|
|
-- present in the source, but rather was created by the front end, which
|
|
-- decided that it was "desirable".
|
|
|
|
Spec_First);
|
|
-- After is a body, and Before is the corresponding spec
|
|
|
|
-- Successor_Link contains the information for one link
|
|
|
|
type Successor_Link is record
|
|
Before : Unit_Id;
|
|
-- Predecessor unit
|
|
|
|
After : Unit_Id;
|
|
-- Successor unit
|
|
|
|
Next : Successor_Id;
|
|
-- Next successor on this list
|
|
|
|
Reason : Succ_Reason;
|
|
-- Reason for this link
|
|
|
|
Elab_Body : Boolean;
|
|
-- Set True if this link is needed for the special Elaborate_Body
|
|
-- processing described below.
|
|
|
|
Reason_Unit : Unit_Id;
|
|
-- For Reason = Elab, or Elab_All or Elab_Desirable, records the unit
|
|
-- containing the pragma leading to the link.
|
|
|
|
Elab_All_Link : Elab_All_Id;
|
|
-- If Reason = Elab_All or Elab_Desirable, then this points to the
|
|
-- first element in a list of Elab_All entries that record the with
|
|
-- chain resulting in this particular dependency.
|
|
end record;
|
|
|
|
-- Note on handling of Elaborate_Body. Basically, if we have a pragma
|
|
-- Elaborate_Body in a unit, it means that the spec and body have to be
|
|
-- handled as a single entity from the point of view of determining an
|
|
-- elaboration order. What we do is to essentially remove the body from
|
|
-- consideration completely, and transfer all its links (other than the
|
|
-- spec link) to the spec. Then when the spec gets chosen, we choose the
|
|
-- body right afterwards. We mark the links that get moved from the body to
|
|
-- the spec by setting their Elab_Body flag True, so that we can understand
|
|
-- what is going on.
|
|
|
|
Succ_First : constant := 1;
|
|
|
|
package Succ is new Table.Table
|
|
(Table_Component_Type => Successor_Link,
|
|
Table_Index_Type => Successor_Id,
|
|
Table_Low_Bound => Succ_First,
|
|
Table_Initial => 500,
|
|
Table_Increment => 200,
|
|
Table_Name => "Succ");
|
|
|
|
-- For the case of Elaborate_All, the following table is used to record
|
|
-- chains of with relationships that lead to the Elab_All link. These are
|
|
-- used solely for diagnostic purposes
|
|
|
|
type Elab_All_Entry is record
|
|
Needed_By : Unit_Name_Type;
|
|
-- Name of unit from which referencing unit was with'ed or otherwise
|
|
-- needed as a result of Elaborate_All or Elaborate_Desirable.
|
|
|
|
Next_Elab : Elab_All_Id;
|
|
-- Link to next entry on chain (No_Elab_All_Link marks end of list)
|
|
end record;
|
|
|
|
package Elab_All_Entries is new Table.Table
|
|
(Table_Component_Type => Elab_All_Entry,
|
|
Table_Index_Type => Elab_All_Id,
|
|
Table_Low_Bound => 1,
|
|
Table_Initial => 2000,
|
|
Table_Increment => 200,
|
|
Table_Name => "Elab_All_Entries");
|
|
|
|
type Unit_Id_Array_Ptr is access Unit_Id_Array;
|
|
|
|
-- A Unit_Node_Record is built for each active unit
|
|
|
|
type Unit_Node_Record is record
|
|
Successors : Successor_Id;
|
|
-- Pointer to list of links for successor nodes
|
|
|
|
Num_Pred : Int;
|
|
-- Number of predecessors for this unit that have not yet been chosen.
|
|
-- Normally non-negative, but can go negative in the case of units
|
|
-- chosen by the diagnose error procedure (when cycles are being removed
|
|
-- from the graph).
|
|
|
|
Nextnp : Unit_Id;
|
|
-- Forward pointer for list of units with no predecessors
|
|
|
|
Visited : Boolean;
|
|
-- Used in computing transitive closure for Elaborate_All and also in
|
|
-- locating cycles and paths in the diagnose routines.
|
|
|
|
Elab_Position : Nat;
|
|
-- Initialized to zero. Set non-zero when a unit is chosen and placed in
|
|
-- the elaboration order. The value represents the ordinal position in
|
|
-- the elaboration order.
|
|
|
|
-- The following are for Elab_New. We compute the strongly connected
|
|
-- components (SCCs) of the directed graph of units. The edges are the
|
|
-- Successors, which do not include pragmas Elaborate_All (explicit or
|
|
-- implicit) in Elab_New. In addition, we assume there is a edge
|
|
-- pointing from a body to its corresponding spec; this edge is not
|
|
-- included in Successors, because of course a spec is elaborated BEFORE
|
|
-- its body, not after.
|
|
|
|
SCC_Root : Unit_Id;
|
|
-- Each unit points to the root of its SCC, which is just an arbitrary
|
|
-- member of the SCC. Two units are in the same SCC if and only if their
|
|
-- SCC_Roots are equal. U is the root of its SCC if and only if
|
|
-- SCC(U)=U.
|
|
|
|
Nodes : Unit_Id_Array_Ptr;
|
|
-- Present only in the root of an SCC. This is the set of units in the
|
|
-- SCC, in no particular order.
|
|
|
|
SCC_Num_Pred : Int;
|
|
-- Present only in the root of an SCC. This is the number of predecessor
|
|
-- units of the SCC that are in other SCCs, and that have not yet been
|
|
-- chosen.
|
|
|
|
Validate_Seen : Boolean := False;
|
|
-- See procedure Validate below
|
|
end record;
|
|
|
|
package UNR is new Table.Table
|
|
(Table_Component_Type => Unit_Node_Record,
|
|
Table_Index_Type => Unit_Id,
|
|
Table_Low_Bound => First_Unit_Entry,
|
|
Table_Initial => 500,
|
|
Table_Increment => 200,
|
|
Table_Name => "UNR");
|
|
|
|
No_Pred : Unit_Id;
|
|
-- Head of list of items with no predecessors
|
|
|
|
Num_Left : Int;
|
|
-- Number of entries not yet dealt with
|
|
|
|
Cur_Unit : Unit_Id;
|
|
-- Current unit, set by Gather_Dependencies, and picked up in Build_Link to
|
|
-- set the Reason_Unit field of the created dependency link.
|
|
|
|
Num_Chosen : Nat;
|
|
-- Number of units chosen in the elaboration order so far
|
|
|
|
Diagnose_Elaboration_Problem_Called : Boolean := False;
|
|
-- True if Diagnose_Elaboration_Problem was called. Used in an assertion.
|
|
|
|
-----------------------
|
|
-- Local Subprograms --
|
|
-----------------------
|
|
|
|
function Debug_Flag_Older return Boolean;
|
|
function Debug_Flag_Old return Boolean;
|
|
-- True if debug flags select the old or older algorithms. Pretty much any
|
|
-- change to elaboration order can break some programs. For example,
|
|
-- programs can depend on elaboration order even without failing
|
|
-- access-before-elaboration checks. A trivial example is a program that
|
|
-- prints text during elaboration. Therefore, we have flags to revert to
|
|
-- the old(er) algorithms.
|
|
|
|
procedure Validate (Order : Unit_Id_Array; Doing_New : Boolean);
|
|
-- Assert that certain properties are true
|
|
|
|
function Better_Choice_Optimistic
|
|
(U1 : Unit_Id;
|
|
U2 : Unit_Id) return Boolean;
|
|
-- U1 and U2 are both permitted candidates for selection as the next unit
|
|
-- to be elaborated. This function determines whether U1 is a better choice
|
|
-- than U2, i.e. should be elaborated in preference to U2, based on a set
|
|
-- of heuristics that establish a friendly and predictable order (see body
|
|
-- for details). The result is True if U1 is a better choice than U2, and
|
|
-- False if it is a worse choice, or there is no preference between them.
|
|
|
|
function Better_Choice_Pessimistic
|
|
(U1 : Unit_Id;
|
|
U2 : Unit_Id) return Boolean;
|
|
-- This is like Better_Choice_Optimistic, and has the same interface, but
|
|
-- returns true if U1 is a worse choice than U2 in the sense of the -p
|
|
-- (pessimistic elaboration order) switch. We still have to obey Ada rules,
|
|
-- so it is not quite the direct inverse of Better_Choice_Optimistic.
|
|
|
|
function Better_Choice (U1 : Unit_Id; U2 : Unit_Id) return Boolean;
|
|
-- Calls Better_Choice_Optimistic or Better_Choice_Pessimistic as
|
|
-- appropriate. Also takes care of the U2 = No_Unit_Id case.
|
|
|
|
procedure Build_Link
|
|
(Before : Unit_Id;
|
|
After : Unit_Id;
|
|
R : Succ_Reason;
|
|
Ea_Id : Elab_All_Id := No_Elab_All_Link);
|
|
-- Establish a successor link, Before must be elaborated before After, and
|
|
-- the reason for the link is R. Ea_Id is the contents to be placed in the
|
|
-- Elab_All_Link of the entry.
|
|
|
|
procedure Choose
|
|
(Elab_Order : in out Unit_Id_Table;
|
|
Chosen : Unit_Id;
|
|
Msg : String);
|
|
-- Chosen is the next entry chosen in the elaboration order. This procedure
|
|
-- updates all data structures appropriately.
|
|
|
|
function Corresponding_Body (U : Unit_Id) return Unit_Id;
|
|
pragma Inline (Corresponding_Body);
|
|
-- Given a unit that is a spec for which there is a separate body, return
|
|
-- the unit id of the body. It is an error to call this routine with a unit
|
|
-- that is not a spec, or that does not have a separate body.
|
|
|
|
function Corresponding_Spec (U : Unit_Id) return Unit_Id;
|
|
pragma Inline (Corresponding_Spec);
|
|
-- Given a unit that is a body for which there is a separate spec, return
|
|
-- the unit id of the spec. It is an error to call this routine with a unit
|
|
-- that is not a body, or that does not have a separate spec.
|
|
|
|
procedure Diagnose_Elaboration_Problem
|
|
(Elab_Order : in out Unit_Id_Table);
|
|
pragma No_Return (Diagnose_Elaboration_Problem);
|
|
-- Called when no elaboration order can be found. Outputs an appropriate
|
|
-- diagnosis of the problem, and then abandons the bind.
|
|
|
|
procedure Elab_All_Links
|
|
(Before : Unit_Id;
|
|
After : Unit_Id;
|
|
Reason : Succ_Reason;
|
|
Link : Elab_All_Id);
|
|
-- Used to compute the transitive closure of elaboration links for an
|
|
-- Elaborate_All pragma (Reason = Elab_All) or for an indication of
|
|
-- Elaborate_All_Desirable (Reason = Elab_All_Desirable). Unit After has a
|
|
-- pragma Elaborate_All or the front end has determined that a reference
|
|
-- probably requires Elaborate_All, and unit Before must be previously
|
|
-- elaborated. First a link is built making sure that unit Before is
|
|
-- elaborated before After, then a recursive call ensures that we also
|
|
-- build links for any units needed by Before (i.e. these units must/should
|
|
-- also be elaborated before After). Link is used to build a chain of
|
|
-- Elab_All_Entries to explain the reason for a link. The value passed is
|
|
-- the chain so far.
|
|
|
|
procedure Elab_Error_Msg (S : Successor_Id);
|
|
-- Given a successor link, outputs an error message of the form
|
|
-- "$ must be elaborated before $ ..." where ... is the reason.
|
|
|
|
procedure Force_Elab_Order;
|
|
-- Gather dependencies from the forced-elaboration-order file (-f switch)
|
|
|
|
procedure Gather_Dependencies;
|
|
-- Compute dependencies, building the Succ and UNR tables
|
|
|
|
procedure Init;
|
|
-- Initialize global data structures in this package body
|
|
|
|
function Is_Body_Unit (U : Unit_Id) return Boolean;
|
|
pragma Inline (Is_Body_Unit);
|
|
-- Determines if given unit is a body
|
|
|
|
function Is_Pure_Or_Preelab_Unit (U : Unit_Id) return Boolean;
|
|
-- Returns True if corresponding unit is Pure or Preelaborate. Includes
|
|
-- dealing with testing flags on spec if it is given a body.
|
|
|
|
function Is_Waiting_Body (U : Unit_Id) return Boolean;
|
|
pragma Inline (Is_Waiting_Body);
|
|
-- Determines if U is a waiting body, defined as a body that has
|
|
-- not been elaborated, but whose spec has been elaborated.
|
|
|
|
function Make_Elab_All_Entry
|
|
(Unam : Unit_Name_Type;
|
|
Link : Elab_All_Id) return Elab_All_Id;
|
|
-- Make an Elab_All_Entries table entry with the given Unam and Link
|
|
|
|
function Unit_Id_Of (Uname : Unit_Name_Type) return Unit_Id;
|
|
-- This function uses the Info field set in the names table to obtain
|
|
-- the unit Id of a unit, given its name id value.
|
|
|
|
procedure Write_Closure (Order : Unit_Id_Array);
|
|
-- Write the closure. This is for the -R and -Ra switches, "list closure
|
|
-- display".
|
|
|
|
procedure Write_Dependencies;
|
|
-- Write out dependencies (called only if appropriate option is set)
|
|
|
|
procedure Write_Elab_All_Chain (S : Successor_Id);
|
|
-- If the reason for the link S is Elaborate_All or Elaborate_Desirable,
|
|
-- then this routine will output the "needed by" explanation chain.
|
|
|
|
procedure Write_Elab_Order (Order : Unit_Id_Array; Title : String);
|
|
-- Display elaboration order. This is for the -l switch. Title is a heading
|
|
-- to print; an empty string is passed to indicate Zero_Formatting.
|
|
|
|
package Elab_New is
|
|
|
|
-- Implementation of the new algorithm
|
|
|
|
procedure Write_SCC (U : Unit_Id);
|
|
-- Write the unit names of the units in the SCC in which U lives
|
|
|
|
procedure Find_Elab_Order (Elab_Order : out Unit_Id_Table);
|
|
|
|
Elab_Cycle_Found : Boolean := False;
|
|
-- Set True if Find_Elab_Order found a cycle (usually an illegal pragma
|
|
-- Elaborate_All, explicit or implicit).
|
|
|
|
function SCC (U : Unit_Id) return Unit_Id;
|
|
-- The root of the strongly connected component containing U
|
|
|
|
function SCC_Num_Pred (U : Unit_Id) return Int;
|
|
-- The SCC_Num_Pred of the SCC in which U lives
|
|
|
|
function Nodes (U : Unit_Id) return Unit_Id_Array_Ptr;
|
|
-- The nodes of the strongly connected component containing U
|
|
|
|
end Elab_New;
|
|
|
|
use Elab_New;
|
|
|
|
package Elab_Old is
|
|
|
|
-- Implementation of the old algorithm
|
|
|
|
procedure Find_Elab_Order (Elab_Order : out Unit_Id_Table);
|
|
|
|
end Elab_Old;
|
|
|
|
-- Most of the code is shared between old and new; such code is outside
|
|
-- packages Elab_Old and Elab_New.
|
|
|
|
-------------------
|
|
-- Better_Choice --
|
|
-------------------
|
|
|
|
function Better_Choice (U1 : Unit_Id; U2 : Unit_Id) return Boolean is
|
|
pragma Assert (U1 /= No_Unit_Id);
|
|
begin
|
|
if U2 = No_Unit_Id then
|
|
return True;
|
|
end if;
|
|
|
|
if Pessimistic_Elab_Order then
|
|
return Better_Choice_Pessimistic (U1, U2);
|
|
else
|
|
return Better_Choice_Optimistic (U1, U2);
|
|
end if;
|
|
end Better_Choice;
|
|
|
|
------------------------------
|
|
-- Better_Choice_Optimistic --
|
|
------------------------------
|
|
|
|
function Better_Choice_Optimistic
|
|
(U1 : Unit_Id;
|
|
U2 : Unit_Id) return Boolean
|
|
is
|
|
UT1 : Unit_Record renames Units.Table (U1);
|
|
UT2 : Unit_Record renames Units.Table (U2);
|
|
|
|
begin
|
|
if Debug_Flag_B then
|
|
Write_Str ("Better_Choice_Optimistic (");
|
|
Write_Unit_Name (UT1.Uname);
|
|
Write_Str (", ");
|
|
Write_Unit_Name (UT2.Uname);
|
|
Write_Line (")");
|
|
end if;
|
|
|
|
-- Note: the checks here are applied in sequence, and the ordering is
|
|
-- significant (i.e. the more important criteria are applied first).
|
|
|
|
-- Prefer a waiting body to one that is not a waiting body
|
|
|
|
if Is_Waiting_Body (U1) and then not Is_Waiting_Body (U2) then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is waiting body, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
elsif Is_Waiting_Body (U2) and then not Is_Waiting_Body (U1) then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u2 is waiting body, u1 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- Prefer a predefined unit to a non-predefined unit
|
|
|
|
elsif UT1.Predefined and then not UT2.Predefined then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is predefined, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
elsif UT2.Predefined and then not UT1.Predefined then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u2 is predefined, u1 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- Prefer an internal unit to a non-internal unit
|
|
|
|
elsif UT1.Internal and then not UT2.Internal then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is internal, u2 is not");
|
|
end if;
|
|
return True;
|
|
|
|
elsif UT2.Internal and then not UT1.Internal then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u2 is internal, u1 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- Prefer a pure or preelaborated unit to one that is not. Pure should
|
|
-- come before preelaborated.
|
|
|
|
elsif Is_Pure_Or_Preelab_Unit (U1)
|
|
and then not
|
|
Is_Pure_Or_Preelab_Unit (U2)
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is pure/preelab, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
elsif Is_Pure_Or_Preelab_Unit (U2)
|
|
and then not
|
|
Is_Pure_Or_Preelab_Unit (U1)
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u2 is pure/preelab, u1 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- Prefer a body to a spec
|
|
|
|
elsif Is_Body_Unit (U1) and then not Is_Body_Unit (U2) then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is body, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
elsif Is_Body_Unit (U2) and then not Is_Body_Unit (U1) then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u2 is body, u1 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- If both are waiting bodies, then prefer the one whose spec is more
|
|
-- recently elaborated. Consider the following:
|
|
|
|
-- spec of A
|
|
-- spec of B
|
|
-- body of A or B?
|
|
|
|
-- The normal waiting body preference would have placed the body of A
|
|
-- before the spec of B if it could. Since it could not, then it must be
|
|
-- the case that A depends on B. It is therefore a good idea to put the
|
|
-- body of B first.
|
|
|
|
elsif Is_Waiting_Body (U1) and then Is_Waiting_Body (U2) then
|
|
declare
|
|
Result : constant Boolean :=
|
|
UNR.Table (Corresponding_Spec (U1)).Elab_Position >
|
|
UNR.Table (Corresponding_Spec (U2)).Elab_Position;
|
|
begin
|
|
if Debug_Flag_B then
|
|
if Result then
|
|
Write_Line (" True: based on waiting body elab positions");
|
|
else
|
|
Write_Line (" False: based on waiting body elab positions");
|
|
end if;
|
|
end if;
|
|
|
|
return Result;
|
|
end;
|
|
end if;
|
|
|
|
-- Remaining choice rules are disabled by Debug flag -do
|
|
|
|
if not Debug_Flag_Older then
|
|
|
|
-- The following deal with the case of specs that have been marked
|
|
-- as Elaborate_Body_Desirable. We generally want to delay these
|
|
-- specs as long as possible, so that the bodies have a better chance
|
|
-- of being elaborated closer to the specs.
|
|
|
|
-- If we have two units, one of which is a spec for which this flag
|
|
-- is set, and the other is not, we prefer to delay the spec for
|
|
-- which the flag is set.
|
|
|
|
if not UT1.Elaborate_Body_Desirable
|
|
and then UT2.Elaborate_Body_Desirable
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is elab body desirable, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
elsif not UT2.Elaborate_Body_Desirable
|
|
and then UT1.Elaborate_Body_Desirable
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u1 is elab body desirable, u2 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- If we have two specs that are both marked as Elaborate_Body
|
|
-- desirable, we prefer the one whose body is nearer to being able
|
|
-- to be elaborated, based on the Num_Pred count. This helps to
|
|
-- ensure bodies are as close to specs as possible.
|
|
|
|
elsif UT1.Elaborate_Body_Desirable
|
|
and then UT2.Elaborate_Body_Desirable
|
|
then
|
|
declare
|
|
Result : constant Boolean :=
|
|
UNR.Table (Corresponding_Body (U1)).Num_Pred <
|
|
UNR.Table (Corresponding_Body (U2)).Num_Pred;
|
|
begin
|
|
if Debug_Flag_B then
|
|
if Result then
|
|
Write_Line (" True based on Num_Pred compare");
|
|
else
|
|
Write_Line (" False based on Num_Pred compare");
|
|
end if;
|
|
end if;
|
|
|
|
return Result;
|
|
end;
|
|
end if;
|
|
end if;
|
|
|
|
-- If we have two specs in the same SCC, choose the one whose body is
|
|
-- closer to being ready.
|
|
|
|
if Doing_New
|
|
and then SCC (U1) = SCC (U2)
|
|
and then Units.Table (U1).Utype = Is_Spec
|
|
and then Units.Table (U2).Utype = Is_Spec
|
|
and then UNR.Table (Corresponding_Body (U1)).Num_Pred /=
|
|
UNR.Table (Corresponding_Body (U2)).Num_Pred
|
|
then
|
|
if UNR.Table (Corresponding_Body (U1)).Num_Pred <
|
|
UNR.Table (Corresponding_Body (U2)).Num_Pred
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Str (" True: same SCC; ");
|
|
Write_Int (UNR.Table (Corresponding_Body (U1)).Num_Pred);
|
|
Write_Str (" < ");
|
|
Write_Int (UNR.Table (Corresponding_Body (U2)).Num_Pred);
|
|
Write_Eol;
|
|
end if;
|
|
|
|
return True;
|
|
else
|
|
if Debug_Flag_B then
|
|
Write_Str (" False: same SCC; ");
|
|
Write_Int (UNR.Table (Corresponding_Body (U1)).Num_Pred);
|
|
Write_Str (" > ");
|
|
Write_Int (UNR.Table (Corresponding_Body (U2)).Num_Pred);
|
|
Write_Eol;
|
|
end if;
|
|
|
|
return False;
|
|
end if;
|
|
end if;
|
|
|
|
-- If we fall through, it means that no preference rule applies, so we
|
|
-- use alphabetical order to at least give a deterministic result.
|
|
|
|
if Debug_Flag_B then
|
|
Write_Line (" choose on alpha order");
|
|
end if;
|
|
|
|
return Uname_Less (UT1.Uname, UT2.Uname);
|
|
end Better_Choice_Optimistic;
|
|
|
|
-------------------------------
|
|
-- Better_Choice_Pessimistic --
|
|
-------------------------------
|
|
|
|
function Better_Choice_Pessimistic
|
|
(U1 : Unit_Id;
|
|
U2 : Unit_Id) return Boolean
|
|
is
|
|
UT1 : Unit_Record renames Units.Table (U1);
|
|
UT2 : Unit_Record renames Units.Table (U2);
|
|
|
|
begin
|
|
if Debug_Flag_B then
|
|
Write_Str ("Better_Choice_Pessimistic (");
|
|
Write_Unit_Name (UT1.Uname);
|
|
Write_Str (", ");
|
|
Write_Unit_Name (UT2.Uname);
|
|
Write_Line (")");
|
|
end if;
|
|
|
|
-- Note: the checks here are applied in sequence, and the ordering is
|
|
-- significant (i.e. the more important criteria are applied first).
|
|
|
|
-- If either unit is predefined or internal, then we use the normal
|
|
-- Better_Choice_Optimistic rule, since we don't want to disturb the
|
|
-- elaboration rules of the language with -p; same treatment for
|
|
-- Pure/Preelab.
|
|
|
|
-- Prefer a predefined unit to a non-predefined unit
|
|
|
|
if UT1.Predefined and then not UT2.Predefined then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is predefined, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
elsif UT2.Predefined and then not UT1.Predefined then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u2 is predefined, u1 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- Prefer an internal unit to a non-internal unit
|
|
|
|
elsif UT1.Internal and then not UT2.Internal then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is internal, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
elsif UT2.Internal and then not UT1.Internal then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u2 is internal, u1 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- Prefer a pure or preelaborated unit to one that is not
|
|
|
|
elsif Is_Pure_Or_Preelab_Unit (U1)
|
|
and then not
|
|
Is_Pure_Or_Preelab_Unit (U2)
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is pure/preelab, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
elsif Is_Pure_Or_Preelab_Unit (U2)
|
|
and then not
|
|
Is_Pure_Or_Preelab_Unit (U1)
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u2 is pure/preelab, u1 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
-- Prefer anything else to a waiting body. We want to make bodies wait
|
|
-- as long as possible, till we are forced to choose them.
|
|
|
|
elsif Is_Waiting_Body (U1) and then not Is_Waiting_Body (U2) then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u1 is waiting body, u2 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
elsif Is_Waiting_Body (U2) and then not Is_Waiting_Body (U1) then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u2 is waiting body, u1 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
-- Prefer a spec to a body (this is mandatory)
|
|
|
|
elsif Is_Body_Unit (U1) and then not Is_Body_Unit (U2) then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u1 is body, u2 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
elsif Is_Body_Unit (U2) and then not Is_Body_Unit (U1) then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u2 is body, u1 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
-- If both are waiting bodies, then prefer the one whose spec is less
|
|
-- recently elaborated. Consider the following:
|
|
|
|
-- spec of A
|
|
-- spec of B
|
|
-- body of A or B?
|
|
|
|
-- The normal waiting body preference would have placed the body of A
|
|
-- before the spec of B if it could. Since it could not, then it must be
|
|
-- the case that A depends on B. It is therefore a good idea to put the
|
|
-- body of B last so that if there is an elaboration order problem, we
|
|
-- will find it (that's what pessimistic order is about).
|
|
|
|
elsif Is_Waiting_Body (U1) and then Is_Waiting_Body (U2) then
|
|
declare
|
|
Result : constant Boolean :=
|
|
UNR.Table (Corresponding_Spec (U1)).Elab_Position <
|
|
UNR.Table (Corresponding_Spec (U2)).Elab_Position;
|
|
begin
|
|
if Debug_Flag_B then
|
|
if Result then
|
|
Write_Line (" True: based on waiting body elab positions");
|
|
else
|
|
Write_Line (" False: based on waiting body elab positions");
|
|
end if;
|
|
end if;
|
|
|
|
return Result;
|
|
end;
|
|
end if;
|
|
|
|
-- Remaining choice rules are disabled by Debug flag -do
|
|
|
|
if not Debug_Flag_Older then
|
|
|
|
-- The following deal with the case of specs that have been marked as
|
|
-- Elaborate_Body_Desirable. In the normal case, we generally want to
|
|
-- delay the elaboration of these specs as long as possible, so that
|
|
-- bodies have better chance of being elaborated closer to the specs.
|
|
-- Better_Choice_Pessimistic as usual wants to do the opposite and
|
|
-- elaborate such specs as early as possible.
|
|
|
|
-- If we have two units, one of which is a spec for which this flag
|
|
-- is set, and the other is not, we normally prefer to delay the spec
|
|
-- for which the flag is set, so again Better_Choice_Pessimistic does
|
|
-- the opposite.
|
|
|
|
if not UT1.Elaborate_Body_Desirable
|
|
and then UT2.Elaborate_Body_Desirable
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Line (" False: u1 is elab body desirable, u2 is not");
|
|
end if;
|
|
|
|
return False;
|
|
|
|
elsif not UT2.Elaborate_Body_Desirable
|
|
and then UT1.Elaborate_Body_Desirable
|
|
then
|
|
if Debug_Flag_B then
|
|
Write_Line (" True: u1 is elab body desirable, u2 is not");
|
|
end if;
|
|
|
|
return True;
|
|
|
|
-- If we have two specs that are both marked as Elaborate_Body
|
|
-- desirable, we normally prefer the one whose body is nearer to
|
|
-- being able to be elaborated, based on the Num_Pred count. This
|
|
-- helps to ensure bodies are as close to specs as possible. As
|
|
-- usual, Better_Choice_Pessimistic does the opposite.
|
|
|
|
elsif UT1.Elaborate_Body_Desirable
|
|
and then UT2.Elaborate_Body_Desirable
|
|
then
|
|
declare
|
|
Result : constant Boolean :=
|
|
UNR.Table (Corresponding_Body (U1)).Num_Pred >=
|
|
UNR.Table (Corresponding_Body (U2)).Num_Pred;
|
|
begin
|
|
if Debug_Flag_B then
|
|
if Result then
|
|
Write_Line (" True based on Num_Pred compare");
|
|
else
|
|
Write_Line (" False based on Num_Pred compare");
|
|
end if;
|
|
end if;
|
|
|
|
return Result;
|
|
end;
|
|
end if;
|
|
end if;
|
|
|
|
-- If we fall through, it means that no preference rule applies, so we
|
|
-- use alphabetical order to at least give a deterministic result. Since
|
|
-- Better_Choice_Pessimistic is in the business of stirring up the
|
|
-- order, we will use reverse alphabetical ordering.
|
|
|
|
if Debug_Flag_B then
|
|
Write_Line (" choose on reverse alpha order");
|
|
end if;
|
|
|
|
return Uname_Less (UT2.Uname, UT1.Uname);
|
|
end Better_Choice_Pessimistic;
|
|
|
|
----------------
|
|
-- Build_Link --
|
|
----------------
|
|
|
|
procedure Build_Link
|
|
(Before : Unit_Id;
|
|
After : Unit_Id;
|
|
R : Succ_Reason;
|
|
Ea_Id : Elab_All_Id := No_Elab_All_Link)
|
|
is
|
|
Cspec : Unit_Id;
|
|
|
|
begin
|
|
Succ.Append
|
|
((Before => Before,
|
|
After => No_Unit_Id, -- filled in below
|
|
Next => UNR.Table (Before).Successors,
|
|
Reason => R,
|
|
Elab_Body => False, -- set correctly below
|
|
Reason_Unit => Cur_Unit,
|
|
Elab_All_Link => Ea_Id));
|
|
UNR.Table (Before).Successors := Succ.Last;
|
|
|
|
-- Deal with special Elab_Body case. If the After of this link is
|
|
-- a body whose spec has Elaborate_All set, and this is not the link
|
|
-- directly from the body to the spec, then we make the After of the
|
|
-- link reference its spec instead, marking the link appropriately.
|
|
|
|
if Units.Table (After).Utype = Is_Body then
|
|
Cspec := Corresponding_Spec (After);
|
|
|
|
if Units.Table (Cspec).Elaborate_Body
|
|
and then Cspec /= Before
|
|
then
|
|
Succ.Table (Succ.Last).After := Cspec;
|
|
Succ.Table (Succ.Last).Elab_Body := True;
|
|
UNR.Table (Cspec).Num_Pred := UNR.Table (Cspec).Num_Pred + 1;
|
|
return;
|
|
end if;
|
|
end if;
|
|
|
|
-- Fall through on normal case
|
|
|
|
Succ.Table (Succ.Last).After := After;
|
|
Succ.Table (Succ.Last).Elab_Body := False;
|
|
UNR.Table (After).Num_Pred := UNR.Table (After).Num_Pred + 1;
|
|
end Build_Link;
|
|
|
|
------------
|
|
-- Choose --
|
|
------------
|
|
|
|
procedure Choose
|
|
(Elab_Order : in out Unit_Id_Table;
|
|
Chosen : Unit_Id;
|
|
Msg : String)
|
|
is
|
|
pragma Assert (Chosen /= No_Unit_Id);
|
|
S : Successor_Id;
|
|
U : Unit_Id;
|
|
|
|
begin
|
|
if Debug_Flag_C then
|
|
Write_Str ("Choosing Unit ");
|
|
Write_Unit_Name (Units.Table (Chosen).Uname);
|
|
Write_Str (Msg);
|
|
end if;
|
|
|
|
-- We shouldn't be choosing something with unelaborated predecessors,
|
|
-- and we shouldn't call this twice on the same unit. But that's not
|
|
-- true when this is called from Diagnose_Elaboration_Problem.
|
|
|
|
if Errors_Detected = 0 then
|
|
pragma Assert (UNR.Table (Chosen).Num_Pred = 0);
|
|
pragma Assert (UNR.Table (Chosen).Elab_Position = 0);
|
|
pragma Assert (not Doing_New or else SCC_Num_Pred (Chosen) = 0);
|
|
null;
|
|
end if;
|
|
|
|
-- Add to elaboration order. Note that units having no elaboration code
|
|
-- are not treated specially yet. The special casing of this is in
|
|
-- Bindgen, where Gen_Elab_Calls skips over them. Meanwhile we need them
|
|
-- here, because the object file list is also driven by the contents of
|
|
-- the Elab_Order table.
|
|
|
|
Append (Elab_Order, Chosen);
|
|
|
|
-- Remove from No_Pred list. This is a little inefficient and may be we
|
|
-- should doubly link the list, but it will do for now.
|
|
|
|
if No_Pred = Chosen then
|
|
No_Pred := UNR.Table (Chosen).Nextnp;
|
|
else
|
|
U := No_Pred;
|
|
while U /= No_Unit_Id loop
|
|
if UNR.Table (U).Nextnp = Chosen then
|
|
UNR.Table (U).Nextnp := UNR.Table (Chosen).Nextnp;
|
|
goto Done_Removal;
|
|
end if;
|
|
|
|
U := UNR.Table (U).Nextnp;
|
|
end loop;
|
|
|
|
-- Here if we didn't find it on the No_Pred list. This can happen
|
|
-- only in calls from the Diagnose_Elaboration_Problem routine,
|
|
-- where cycles are being removed arbitrarily from the graph.
|
|
|
|
pragma Assert (Errors_Detected > 0);
|
|
<<Done_Removal>> null;
|
|
end if;
|
|
|
|
-- For all successors, decrement the number of predecessors, and if it
|
|
-- becomes zero, then add to no-predecessor list.
|
|
|
|
S := UNR.Table (Chosen).Successors;
|
|
pragma Annotate (CodePeer, Modified, S);
|
|
|
|
while S /= No_Successor loop
|
|
U := Succ.Table (S).After;
|
|
UNR.Table (U).Num_Pred := UNR.Table (U).Num_Pred - 1;
|
|
|
|
if Debug_Flag_N then
|
|
Write_Str (" decrementing Num_Pred for unit ");
|
|
Write_Unit_Name (Units.Table (U).Uname);
|
|
Write_Str (" new value = ");
|
|
Write_Int (UNR.Table (U).Num_Pred);
|
|
Write_Eol;
|
|
end if;
|
|
|
|
if UNR.Table (U).Num_Pred = 0 then
|
|
UNR.Table (U).Nextnp := No_Pred;
|
|
No_Pred := U;
|
|
end if;
|
|
|
|
if Doing_New and then SCC (U) /= SCC (Chosen) then
|
|
UNR.Table (SCC (U)).SCC_Num_Pred :=
|
|
UNR.Table (SCC (U)).SCC_Num_Pred - 1;
|
|
|
|
if Debug_Flag_N then
|
|
Write_Str (" decrementing SCC_Num_Pred for unit ");
|
|
Write_Unit_Name (Units.Table (U).Uname);
|
|
Write_Str (" new value = ");
|
|
Write_Int (SCC_Num_Pred (U));
|
|
Write_Eol;
|
|
end if;
|
|
end if;
|
|
|
|
S := Succ.Table (S).Next;
|
|
end loop;
|
|
|
|
-- All done, adjust number of units left count and set elaboration pos
|
|
|
|
Num_Left := Num_Left - 1;
|
|
Num_Chosen := Num_Chosen + 1;
|
|
|
|
pragma Assert
|
|
(Errors_Detected > 0 or else Num_Chosen = Last (Elab_Order));
|
|
pragma Assert (Units.Last = UNR.Last);
|
|
pragma Assert (Num_Chosen + Num_Left = Int (UNR.Last));
|
|
|
|
if Debug_Flag_C then
|
|
Write_Str (" ");
|
|
Write_Int (Int (Num_Chosen));
|
|
Write_Str ("+");
|
|
Write_Int (Num_Left);
|
|
Write_Str ("=");
|
|
Write_Int (Int (UNR.Last));
|
|
Write_Eol;
|
|
end if;
|
|
|
|
UNR.Table (Chosen).Elab_Position := Num_Chosen;
|
|
|
|
-- If we just chose a spec with Elaborate_Body set, then we must
|
|
-- immediately elaborate the body, before any other units.
|
|
|
|
if Units.Table (Chosen).Elaborate_Body then
|
|
|
|
-- If the unit is a spec only, then there is no body. This is a bit
|
|
-- odd given that Elaborate_Body is here, but it is valid in an RCI
|
|
-- unit, where we only have the interface in the stub bind.
|
|
|
|
if Units.Table (Chosen).Utype = Is_Spec_Only
|
|
and then Units.Table (Chosen).RCI
|
|
then
|
|
null;
|
|
|
|
-- If this unit is an interface to a stand-alone library, then we
|
|
-- don't want to elaborate the body -- that will happen as part of
|
|
-- the library.
|
|
|
|
elsif Units.Table (Chosen).SAL_Interface then
|
|
null;
|
|
|
|
else
|
|
Choose
|
|
(Elab_Order => Elab_Order,
|
|
Chosen => Corresponding_Body (Chosen),
|
|
Msg => " [Elaborate_Body]");
|
|
end if;
|
|
end if;
|
|
end Choose;
|
|
|
|
------------------------
|
|
-- Corresponding_Body --
|
|
------------------------
|
|
|
|
-- Currently if the body and spec are separate, then they appear as two
|
|
-- separate units in the same ALI file, with the body appearing first and
|
|
-- the spec appearing second.
|
|
|
|
function Corresponding_Body (U : Unit_Id) return Unit_Id is
|
|
begin
|
|
pragma Assert (Units.Table (U).Utype = Is_Spec);
|
|
return U - 1;
|
|
end Corresponding_Body;
|
|
|
|
------------------------
|
|
-- Corresponding_Spec --
|
|
------------------------
|
|
|
|
-- Currently if the body and spec are separate, then they appear as two
|
|
-- separate units in the same ALI file, with the body appearing first and
|
|
-- the spec appearing second.
|
|
|
|
function Corresponding_Spec (U : Unit_Id) return Unit_Id is
|
|
begin
|
|
pragma Assert (Units.Table (U).Utype = Is_Body);
|
|
return U + 1;
|
|
end Corresponding_Spec;
|
|
|
|
--------------------
|
|
-- Debug_Flag_Old --
|
|
--------------------
|
|
|
|
function Debug_Flag_Old return Boolean is
|
|
begin
|
|
-- If the user specified both flags, we want to use the older algorithm,
|
|
-- rather than some confusing mix of the two.
|
|
|
|
return Debug_Flag_P and not Debug_Flag_O;
|
|
end Debug_Flag_Old;
|
|
|
|
----------------------
|
|
-- Debug_Flag_Older --
|
|
----------------------
|
|
|
|
function Debug_Flag_Older return Boolean is
|
|
begin
|
|
return Debug_Flag_O;
|
|
end Debug_Flag_Older;
|
|
|
|
----------------------------------
|
|
-- Diagnose_Elaboration_Problem --
|
|
----------------------------------
|
|
|
|
procedure Diagnose_Elaboration_Problem
|
|
(Elab_Order : in out Unit_Id_Table)
|
|
is
|
|
function Find_Path
|
|
(Ufrom : Unit_Id;
|
|
Uto : Unit_Id;
|
|
ML : Nat) return Boolean;
|
|
-- Recursive routine used to find a path from node Ufrom to node Uto.
|
|
-- If a path exists, returns True and outputs an appropriate set of
|
|
-- error messages giving the path. Also calls Choose for each of the
|
|
-- nodes so that they get removed from the remaining set. There are
|
|
-- two cases of calls, either Ufrom = Uto for an attempt to find a
|
|
-- cycle, or Ufrom is a spec and Uto the corresponding body for the
|
|
-- case of an unsatisfiable Elaborate_Body pragma. ML is the minimum
|
|
-- acceptable length for a path.
|
|
|
|
---------------
|
|
-- Find_Path --
|
|
---------------
|
|
|
|
function Find_Path
|
|
(Ufrom : Unit_Id;
|
|
Uto : Unit_Id;
|
|
ML : Nat) return Boolean
|
|
is
|
|
function Find_Link (U : Unit_Id; PL : Nat) return Boolean;
|
|
-- This is the inner recursive routine, it determines if a path
|
|
-- exists from U to Uto, and if so returns True and outputs the
|
|
-- appropriate set of error messages. PL is the path length
|
|
|
|
---------------
|
|
-- Find_Link --
|
|
---------------
|
|
|
|
function Find_Link (U : Unit_Id; PL : Nat) return Boolean is
|
|
S : Successor_Id;
|
|
|
|
begin
|
|
-- Recursion ends if we are at terminating node and the path is
|
|
-- sufficiently long, generate error message and return True.
|
|
|
|
if U = Uto and then PL >= ML then
|
|
Choose (Elab_Order, U, " [Find_Link: base]");
|
|
return True;
|
|
|
|
-- All done if already visited
|
|
|
|
elsif UNR.Table (U).Visited then
|
|
return False;
|
|
|
|
-- Otherwise mark as visited and look at all successors
|
|
|
|
else
|
|
UNR.Table (U).Visited := True;
|
|
|
|
S := UNR.Table (U).Successors;
|
|
while S /= No_Successor loop
|
|
if Find_Link (Succ.Table (S).After, PL + 1) then
|
|
Elab_Error_Msg (S);
|
|
Choose (Elab_Order, U, " [Find_Link: recursive]");
|
|
return True;
|
|
end if;
|
|
|
|
S := Succ.Table (S).Next;
|
|
end loop;
|
|
|
|
-- Falling through means this does not lead to a path
|
|
|
|
return False;
|
|
end if;
|
|
end Find_Link;
|
|
|
|
-- Start of processing for Find_Path
|
|
|
|
begin
|
|
-- Initialize all non-chosen nodes to not visited yet
|
|
|
|
for U in Units.First .. Units.Last loop
|
|
UNR.Table (U).Visited := UNR.Table (U).Elab_Position /= 0;
|
|
end loop;
|
|
|
|
-- Now try to find the path
|
|
|
|
return Find_Link (Ufrom, 0);
|
|
end Find_Path;
|
|
|
|
-- Start of processing for Diagnose_Elaboration_Problem
|
|
|
|
begin
|
|
Diagnose_Elaboration_Problem_Called := True;
|
|
Set_Standard_Error;
|
|
|
|
-- Output state of things if debug flag N set
|
|
|
|
if Debug_Flag_N then
|
|
declare
|
|
NP : Int;
|
|
|
|
begin
|
|
Write_Eol;
|
|
Write_Eol;
|
|
Write_Line ("Diagnose_Elaboration_Problem called");
|
|
Write_Line ("List of remaining unchosen units and predecessors");
|
|
|
|
for U in Units.First .. Units.Last loop
|
|
if UNR.Table (U).Elab_Position = 0 then
|
|
NP := UNR.Table (U).Num_Pred;
|
|
Write_Eol;
|
|
Write_Str (" Unchosen unit: #");
|
|
Write_Int (Int (U));
|
|
Write_Str (" ");
|
|
Write_Unit_Name (Units.Table (U).Uname);
|
|
Write_Str (" (Num_Pred = ");
|
|
Write_Int (NP);
|
|
Write_Line (")");
|
|
|
|
if NP = 0 then
|
|
if Units.Table (U).Elaborate_Body then
|
|
Write_Line
|
|
(" (not chosen because of Elaborate_Body)");
|
|
else
|
|
Write_Line (" ****************** why not chosen?");
|
|
end if;
|
|
end if;
|
|
|
|
-- Search links list to find unchosen predecessors
|
|
|
|
for S in Succ.First .. Succ.Last loop
|
|
declare
|
|
SL : Successor_Link renames Succ.Table (S);
|
|
|
|
begin
|
|
if SL.After = U
|
|
and then UNR.Table (SL.Before).Elab_Position = 0
|
|
then
|
|
Write_Str (" unchosen predecessor: #");
|
|
Write_Int (Int (SL.Before));
|
|
Write_Str (" ");
|
|
Write_Unit_Name (Units.Table (SL.Before).Uname);
|
|
Write_Eol;
|
|
NP := NP - 1;
|
|
end if;
|
|
end;
|
|
end loop;
|
|
|
|
if NP /= 0 then
|
|
Write_Line (" **************** Num_Pred value wrong!");
|
|
end if;
|
|
end if;
|
|
end loop;
|
|
end;
|
|
end if;
|
|
|
|
-- Output the header for the error, and manually increment the error
|
|
-- count. We are using Error_Msg_Output rather than Error_Msg here for
|
|
-- two reasons:
|
|
|
|
-- This is really only one error, not one for each line
|
|
-- We want this output on standard output since it is voluminous
|
|
|
|
-- But we do need to deal with the error count manually in this case
|
|
|
|
Errors_Detected := Errors_Detected + 1;
|
|
Error_Msg_Output ("elaboration circularity detected", Info => False);
|
|
|
|
-- Try to find cycles starting with any of the remaining nodes that have
|
|
-- not yet been chosen. There must be at least one (there is some reason
|
|
-- we are being called).
|
|
|
|
for U in Units.First .. Units.Last loop
|
|
if UNR.Table (U).Elab_Position = 0 then
|
|
if Find_Path (U, U, 1) then
|
|
raise Unrecoverable_Error;
|
|
end if;
|
|
end if;
|
|
end loop;
|
|
|
|
-- We should never get here, since we were called for some reason, and
|
|
-- we should have found and eliminated at least one bad path.
|
|
|
|
raise Program_Error;
|
|
end Diagnose_Elaboration_Problem;
|
|
|
|
--------------------
|
|
-- Elab_All_Links --
|
|
--------------------
|
|
|
|
procedure Elab_All_Links
|
|
(Before : Unit_Id;
|
|
After : Unit_Id;
|
|
Reason : Succ_Reason;
|
|
Link : Elab_All_Id)
|
|
is
|
|
begin
|
|
if UNR.Table (Before).Visited then
|
|
return;
|
|
end if;
|
|
|
|
-- Build the direct link for Before
|
|
|
|
UNR.Table (Before).Visited := True;
|
|
Build_Link (Before, After, Reason, Link);
|
|
|
|
-- Process all units with'ed by Before recursively
|
|
|
|
for W in Units.Table (Before).First_With ..
|
|
Units.Table (Before).Last_With
|
|
loop
|
|
-- Skip if this with is an interface to a stand-alone library. Skip
|
|
-- also if no ALI file for this WITH, happens for language defined
|
|
-- generics while bootstrapping the compiler (see body of routine
|
|
-- Lib.Writ.Write_With_Lines). Finally, skip if it is a limited with
|
|
-- clause, which does not impose an elaboration link.
|
|
|
|
if not Withs.Table (W).SAL_Interface
|
|
and then Withs.Table (W).Afile /= No_File
|
|
and then not Withs.Table (W).Limited_With
|
|
then
|
|
declare
|
|
Info : constant Int :=
|
|
Get_Name_Table_Int (Withs.Table (W).Uname);
|
|
|
|
begin
|
|
-- If the unit is unknown, for some unknown reason, fail
|
|
-- graciously explaining that the unit is unknown. Without
|
|
-- this check, gnatbind will crash in Unit_Id_Of.
|
|
|
|
if Info = 0 or else Unit_Id (Info) = No_Unit_Id then
|
|
declare
|
|
Withed : String :=
|
|
Get_Name_String (Withs.Table (W).Uname);
|
|
Last_Withed : Natural := Withed'Last;
|
|
Withing : String :=
|
|
Get_Name_String
|
|
(Units.Table (Before).Uname);
|
|
Last_Withing : Natural := Withing'Last;
|
|
Spec_Body : String := " (Spec)";
|
|
|
|
begin
|
|
To_Mixed (Withed);
|
|
To_Mixed (Withing);
|
|
|
|
if Last_Withed > 2
|
|
and then Withed (Last_Withed - 1) = '%'
|
|
then
|
|
Last_Withed := Last_Withed - 2;
|
|
end if;
|
|
|
|
if Last_Withing > 2
|
|
and then Withing (Last_Withing - 1) = '%'
|
|
then
|
|
Last_Withing := Last_Withing - 2;
|
|
end if;
|
|
|
|
if Units.Table (Before).Utype = Is_Body
|
|
or else Units.Table (Before).Utype = Is_Body_Only
|
|
then
|
|
Spec_Body := " (Body)";
|
|
end if;
|
|
|
|
Osint.Fail
|
|
("could not find unit "
|
|
& Withed (Withed'First .. Last_Withed) & " needed by "
|
|
& Withing (Withing'First .. Last_Withing) & Spec_Body);
|
|
end;
|
|
end if;
|
|
|
|
Elab_All_Links
|
|
(Unit_Id_Of (Withs.Table (W).Uname),
|
|
After,
|
|
Reason,
|
|
Make_Elab_All_Entry (Withs.Table (W).Uname, Link));
|
|
end;
|
|
end if;
|
|
end loop;
|
|
|
|
-- Process corresponding body, if there is one
|
|
|
|
if Units.Table (Before).Utype = Is_Spec then
|
|
Elab_All_Links
|
|
(Corresponding_Body (Before),
|
|
After, Reason,
|
|
Make_Elab_All_Entry
|
|
(Units.Table (Corresponding_Body (Before)).Uname, Link));
|
|
end if;
|
|
end Elab_All_Links;
|
|
|
|
--------------------
|
|
-- Elab_Error_Msg --
|
|
--------------------
|
|
|
|
procedure Elab_Error_Msg (S : Successor_Id) is
|
|
SL : Successor_Link renames Succ.Table (S);
|
|
|
|
begin
|
|
-- Nothing to do if internal unit involved and no -da flag
|
|
|
|
if not Debug_Flag_A
|
|
and then
|
|
(Is_Internal_File_Name (Units.Table (SL.Before).Sfile)
|
|
or else
|
|
Is_Internal_File_Name (Units.Table (SL.After).Sfile))
|
|
then
|
|
return;
|
|
end if;
|
|
|
|
-- Here we want to generate output
|
|
|
|
Error_Msg_Unit_1 := Units.Table (SL.Before).Uname;
|
|
|
|
if SL.Elab_Body then
|
|
Error_Msg_Unit_2 := Units.Table (Corresponding_Body (SL.After)).Uname;
|
|
else
|
|
Error_Msg_Unit_2 := Units.Table (SL.After).Uname;
|
|
end if;
|
|
|
|
Error_Msg_Output (" $ must be elaborated before $", Info => True);
|
|
|
|
Error_Msg_Unit_1 := Units.Table (SL.Reason_Unit).Uname;
|
|
|
|
case SL.Reason is
|
|
when Withed =>
|
|
Error_Msg_Output
|
|
(" reason: with clause",
|
|
Info => True);
|
|
|
|
when Forced =>
|
|
Error_Msg_Output
|
|
(" reason: forced by -f switch",
|
|
Info => True);
|
|
|
|
when Elab =>
|
|
Error_Msg_Output
|
|
(" reason: pragma Elaborate in unit $",
|
|
Info => True);
|
|
|
|
when Elab_All =>
|
|
Error_Msg_Output
|
|
(" reason: pragma Elaborate_All in unit $",
|
|
Info => True);
|
|
|
|
when Elab_All_Desirable =>
|
|
Error_Msg_Output
|
|
(" reason: implicit Elaborate_All in unit $",
|
|
Info => True);
|
|
|
|
Error_Msg_Output
|
|
(" recompile $ with -gnatel for full details",
|
|
Info => True);
|
|
|
|
when Elab_Desirable =>
|
|
Error_Msg_Output
|
|
(" reason: implicit Elaborate in unit $",
|
|
Info => True);
|
|
|
|
Error_Msg_Output
|
|
(" recompile $ with -gnatel for full details",
|
|
Info => True);
|
|
|
|
when Spec_First =>
|
|
Error_Msg_Output
|
|
(" reason: spec always elaborated before body",
|
|
Info => True);
|
|
end case;
|
|
|
|
Write_Elab_All_Chain (S);
|
|
|
|
if SL.Elab_Body then
|
|
Error_Msg_Unit_1 := Units.Table (SL.Before).Uname;
|
|
Error_Msg_Unit_2 := Units.Table (SL.After).Uname;
|
|
Error_Msg_Output
|
|
(" $ must therefore be elaborated before $", True);
|
|
|
|
Error_Msg_Unit_1 := Units.Table (SL.After).Uname;
|
|
Error_Msg_Output
|
|
(" (because $ has a pragma Elaborate_Body)", True);
|
|
end if;
|
|
|
|
if not Zero_Formatting then
|
|
Write_Eol;
|
|
end if;
|
|
end Elab_Error_Msg;
|
|
|
|
---------------------
|
|
-- Find_Elab_Order --
|
|
---------------------
|
|
|
|
procedure Find_Elab_Order
|
|
(Elab_Order : out Unit_Id_Table;
|
|
First_Main_Lib_File : File_Name_Type)
|
|
is
|
|
function Num_Spec_Body_Pairs (Order : Unit_Id_Array) return Nat;
|
|
-- Number of cases where the body of a unit immediately follows the
|
|
-- corresponding spec. Such cases are good, because calls to that unit
|
|
-- from outside can't get ABE.
|
|
|
|
-------------------------
|
|
-- Num_Spec_Body_Pairs --
|
|
-------------------------
|
|
|
|
function Num_Spec_Body_Pairs (Order : Unit_Id_Array) return Nat is
|
|
Result : Nat := 0;
|
|
|
|
begin
|
|
for J in Order'First + 1 .. Order'Last loop
|
|
if Units.Table (Order (J - 1)).Utype = Is_Spec
|
|
and then Units.Table (Order (J)).Utype = Is_Body
|
|
and then Corresponding_Spec (Order (J)) = Order (J - 1)
|
|
then
|
|
Result := Result + 1;
|
|
end if;
|
|
end loop;
|
|
|
|
return Result;
|
|
end Num_Spec_Body_Pairs;
|
|
|
|
-- Local variables
|
|
|
|
Old_Elab_Order : Unit_Id_Table;
|
|
|
|
-- Start of processing for Find_Elab_Order
|
|
|
|
begin
|
|
-- Output warning if -p used with no -gnatE units
|
|
|
|
if Pessimistic_Elab_Order
|
|
and not Dynamic_Elaboration_Checks_Specified
|
|
then
|
|
Error_Msg ("?use of -p switch questionable");
|
|
Error_Msg ("?since all units compiled with static elaboration model");
|
|
end if;
|
|
|
|
if Do_New and not Debug_Flag_Old and not Debug_Flag_Older then
|
|
if Debug_Flag_V then
|
|
Write_Line ("Doing new...");
|
|
end if;
|
|
|
|
Doing_New := True;
|
|
Init;
|
|
Elab_New.Find_Elab_Order (Elab_Order);
|
|
end if;
|
|
|
|
-- Elab_New does not support the pessimistic order, so if that was
|
|
-- requested, use the old results. Use Elab_Old if -dp or -do was
|
|
-- selected. Elab_New does not yet give proper error messages for
|
|
-- illegal Elaborate_Alls, so if there is one, run Elab_Old.
|
|
|
|
if Do_Old
|
|
or Pessimistic_Elab_Order
|
|
or Debug_Flag_Old
|
|
or Debug_Flag_Older
|
|
or Elab_Cycle_Found
|
|
then
|
|
if Debug_Flag_V then
|
|
Write_Line ("Doing old...");
|
|
end if;
|
|
|
|
Doing_New := False;
|
|
Init;
|
|
Elab_Old.Find_Elab_Order (Old_Elab_Order);
|
|
end if;
|
|
|
|
pragma Assert (Elab_Cycle_Found <= -- implies
|
|
Diagnose_Elaboration_Problem_Called);
|
|
|
|
declare
|
|
Old_Order : Unit_Id_Array renames
|
|
Old_Elab_Order.Table (1 .. Last (Old_Elab_Order));
|
|
begin
|
|
if Do_Old and Do_New then
|
|
declare
|
|
New_Order : Unit_Id_Array renames
|
|
Elab_Order.Table (1 .. Last (Elab_Order));
|
|
Old_Pairs : constant Nat := Num_Spec_Body_Pairs (Old_Order);
|
|
New_Pairs : constant Nat := Num_Spec_Body_Pairs (New_Order);
|
|
|
|
begin
|
|
Write_Line (Get_Name_String (First_Main_Lib_File));
|
|
|
|
pragma Assert (Old_Order'Length = New_Order'Length);
|
|
pragma Debug (Validate (Old_Order, Doing_New => False));
|
|
pragma Debug (Validate (New_Order, Doing_New => True));
|
|
|
|
-- Misc debug printouts that can be used for experimentation by
|
|
-- changing the 'if's below.
|
|
|
|
if True then
|
|
if New_Order = Old_Order then
|
|
Write_Line ("Elab_New: same order.");
|
|
else
|
|
Write_Line ("Elab_New: diff order.");
|
|
end if;
|
|
end if;
|
|
|
|
if New_Order /= Old_Order and then False then
|
|
Write_Line ("Elaboration orders differ:");
|
|
Write_Elab_Order
|
|
(Old_Order, Title => "OLD ELABORATION ORDER");
|
|
Write_Elab_Order
|
|
(New_Order, Title => "NEW ELABORATION ORDER");
|
|
end if;
|
|
|
|
if True then
|
|
Write_Str ("Pairs: ");
|
|
Write_Int (Old_Pairs);
|
|
|
|
if Old_Pairs = New_Pairs then
|
|
Write_Str (" = ");
|
|
elsif Old_Pairs < New_Pairs then
|
|
Write_Str (" < ");
|
|
else
|
|
Write_Str (" > ");
|
|
end if;
|
|
|
|
Write_Int (New_Pairs);
|
|
Write_Eol;
|
|
end if;
|
|
|
|
if Old_Pairs /= New_Pairs and then False then
|
|
Write_Str ("Pairs: ");
|
|
Write_Int (Old_Pairs);
|
|
|
|
if Old_Pairs < New_Pairs then
|
|
Write_Str (" < ");
|
|
else
|
|
Write_Str (" > ");
|
|
end if;
|
|
|
|
Write_Int (New_Pairs);
|
|
Write_Eol;
|
|
|
|
if Old_Pairs /= New_Pairs and then Debug_Flag_V then
|
|
Write_Elab_Order
|
|
(Old_Order, Title => "OLD ELABORATION ORDER");
|
|
Write_Elab_Order
|
|
(New_Order, Title => "NEW ELABORATION ORDER");
|
|
pragma Assert (New_Pairs >= Old_Pairs);
|
|
end if;
|
|
end if;
|
|
end;
|
|
end if;
|
|
|
|
-- The Elab_New algorithm doesn't implement the -p switch, so if that
|
|
-- was used, use the results from the old algorithm. Likewise if the
|
|
-- user has requested the old algorithm.
|
|
|
|
if Pessimistic_Elab_Order or Debug_Flag_Old or Debug_Flag_Older then
|
|
pragma Assert
|
|
(Last (Elab_Order) = 0
|
|
or else Last (Elab_Order) = Old_Order'Last);
|
|
|
|
Init (Elab_Order);
|
|
Append_All (Elab_Order, Old_Order);
|
|
end if;
|
|
|
|
-- Now set the Elab_Positions in the Units table. It is important to
|
|
-- do this late, in case we're running both Elab_New and Elab_Old.
|
|
|
|
declare
|
|
New_Order : Unit_Id_Array renames
|
|
Elab_Order.Table (1 .. Last (Elab_Order));
|
|
Units_Array : Units.Table_Type renames
|
|
Units.Table (Units.First .. Units.Last);
|
|
begin
|
|
for J in New_Order'Range loop
|
|
pragma Assert
|
|
(UNR.Table (New_Order (J)).Elab_Position = J);
|
|
Units_Array (New_Order (J)).Elab_Position := J;
|
|
end loop;
|
|
|
|
if Errors_Detected = 0 then
|
|
|
|
-- Display elaboration order if -l was specified
|
|
|
|
if Elab_Order_Output then
|
|
if Zero_Formatting then
|
|
Write_Elab_Order (New_Order, Title => "");
|
|
else
|
|
Write_Elab_Order
|
|
(New_Order, Title => "ELABORATION ORDER");
|
|
end if;
|
|
end if;
|
|
|
|
-- Display list of sources in the closure (except predefined
|
|
-- sources) if -R was used. Include predefined sources if -Ra
|
|
-- was used.
|
|
|
|
if List_Closure then
|
|
Write_Closure (New_Order);
|
|
end if;
|
|
end if;
|
|
end;
|
|
end;
|
|
end Find_Elab_Order;
|
|
|
|
----------------------
|
|
-- Force_Elab_Order --
|
|
----------------------
|
|
|
|
procedure Force_Elab_Order is
|
|
subtype Header_Num is Unit_Name_Type'Base range 0 .. 2**16 - 1;
|
|
|
|
function Hash (N : Unit_Name_Type) return Header_Num;
|
|
|
|
package Name_Map is new System.HTable.Simple_HTable
|
|
(Header_Num => Header_Num,
|
|
Element => Logical_Line_Number,
|
|
No_Element => No_Line_Number,
|
|
Key => Unit_Name_Type,
|
|
Hash => Hash,
|
|
Equal => "=");
|
|
-- Name_Map contains an entry for each file name seen, mapped to the
|
|
-- line number where we saw it first. This is used to give an error for
|
|
-- duplicates.
|
|
|
|
----------
|
|
-- Hash --
|
|
----------
|
|
|
|
function Hash (N : Unit_Name_Type) return Header_Num is
|
|
-- Name_Ids are already widely dispersed; no need for any actual
|
|
-- hashing. Just subtract to make it zero based, and "mod" to
|
|
-- bring it in range.
|
|
begin
|
|
return (N - Unit_Name_Type'First) mod (Header_Num'Last + 1);
|
|
end Hash;
|
|
|
|
-- Local variables
|
|
|
|
Cur_Line_Number : Logical_Line_Number;
|
|
Error : Boolean := False;
|
|
Iter : Forced_Units_Iterator;
|
|
Prev_Unit : Unit_Id := No_Unit_Id;
|
|
Uname : Unit_Name_Type;
|
|
|
|
-- Start of processing for Force_Elab_Order
|
|
|
|
begin
|
|
Iter := Iterate_Forced_Units;
|
|
while Has_Next (Iter) loop
|
|
Next (Iter, Uname, Cur_Line_Number);
|
|
|
|
declare
|
|
Dup : constant Logical_Line_Number := Name_Map.Get (Uname);
|
|
begin
|
|
if Dup = No_Line_Number then
|
|
Name_Map.Set (Uname, Cur_Line_Number);
|
|
|
|
-- We don't need to give the "not present" message in the case
|
|
-- of "duplicate unit", because we would have already given the
|
|
-- "not present" message on the first occurrence.
|
|
|
|
if Get_Name_Table_Int (Uname) = 0
|
|
or else Unit_Id (Get_Name_Table_Int (Uname)) = No_Unit_Id
|
|
then
|
|
Error := True;
|
|
if Doing_New then
|
|
Write_Line
|
|
("""" & Get_Name_String (Uname)
|
|
& """: not present; ignored");
|
|
end if;
|
|
end if;
|
|
|
|
else
|
|
Error := True;
|
|
if Doing_New then
|
|
Error_Msg_Nat_1 := Nat (Cur_Line_Number);
|
|
Error_Msg_Unit_1 := Uname;
|
|
Error_Msg_Nat_2 := Nat (Dup);
|
|
Error_Msg
|
|
(Force_Elab_Order_File.all
|
|
& ":#: duplicate unit name $ from line #");
|
|
end if;
|
|
end if;
|
|
end;
|
|
|
|
if not Error then
|
|
declare
|
|
Cur_Unit : constant Unit_Id := Unit_Id_Of (Uname);
|
|
begin
|
|
if Is_Internal_File_Name (Units.Table (Cur_Unit).Sfile) then
|
|
if Doing_New then
|
|
Write_Line
|
|
("""" & Get_Name_String (Uname)
|
|
& """: predefined unit ignored");
|
|
end if;
|
|
|
|
else
|
|
if Prev_Unit /= No_Unit_Id then
|
|
if Doing_New then
|
|
Write_Unit_Name (Units.Table (Prev_Unit).Uname);
|
|
Write_Str (" <-- ");
|
|
Write_Unit_Name (Units.Table (Cur_Unit).Uname);
|
|
Write_Eol;
|
|
end if;
|
|
|
|
Build_Link
|
|
(Before => Prev_Unit,
|
|
After => Cur_Unit,
|
|
R => Forced);
|
|
end if;
|
|
|
|
Prev_Unit := Cur_Unit;
|
|
end if;
|
|
end;
|
|
end if;
|
|
end loop;
|
|
end Force_Elab_Order;
|
|
|
|
-------------------------
|
|
-- Gather_Dependencies --
|
|
-------------------------
|
|
|
|
procedure Gather_Dependencies is
|
|
Withed_Unit : Unit_Id;
|
|
|
|
begin
|
|
-- Loop through all units
|
|
|
|
for U in Units.First .. Units.Last loop
|
|
Cur_Unit := U;
|
|
|
|
-- If this is not an interface to a stand-alone library and there is
|
|
-- a body and a spec, then spec must be elaborated first. Note that
|
|
-- the corresponding spec immediately follows the body.
|
|
|
|
if not Units.Table (U).SAL_Interface
|
|
and then Units.Table (U).Utype = Is_Body
|
|
then
|
|
Build_Link (Corresponding_Spec (U), U, Spec_First);
|
|
end if;
|
|
|
|
-- If this unit is not an interface to a stand-alone library, process
|
|
-- WITH references for this unit ignoring interfaces to stand-alone
|
|
-- libraries.
|
|
|
|
if not Units.Table (U).SAL_Interface then
|
|
for W in Units.Table (U).First_With ..
|
|
Units.Table (U).Last_With
|
|
loop
|
|
if Withs.Table (W).Sfile /= No_File
|
|
and then (not Withs.Table (W).SAL_Interface)
|
|
then
|
|
-- Check for special case of withing a unit that does not
|
|
-- exist any more. If the unit was completely missing we
|
|
-- would already have detected this, but a nasty case arises
|
|
-- when we have a subprogram body with no spec, and some
|
|
-- obsolete unit with's a previous (now disappeared) spec.
|
|
|
|
if Get_Name_Table_Int (Withs.Table (W).Uname) = 0 then
|
|
if Doing_New then
|
|
Error_Msg_File_1 := Units.Table (U).Sfile;
|
|
Error_Msg_Unit_1 := Withs.Table (W).Uname;
|
|
Error_Msg ("{ depends on $ which no longer exists");
|
|
end if;
|
|
|
|
goto Next_With;
|
|
end if;
|
|
|
|
Withed_Unit := Unit_Id_Of (Withs.Table (W).Uname);
|
|
|
|
-- Pragma Elaborate_All case, for this we use the recursive
|
|
-- Elab_All_Links procedure to establish the links.
|
|
|
|
-- Elab_New ignores Elaborate_All and Elab_All_Desirable,
|
|
-- except for error messages.
|
|
|
|
if Withs.Table (W).Elaborate_All and then not Doing_New then
|
|
|
|
-- Reset flags used to stop multiple visits to a given
|
|
-- node.
|
|
|
|
for Uref in UNR.First .. UNR.Last loop
|
|
UNR.Table (Uref).Visited := False;
|
|
end loop;
|
|
|
|
-- Now establish all the links we need
|
|
|
|
Elab_All_Links
|
|
(Withed_Unit, U, Elab_All,
|
|
Make_Elab_All_Entry
|
|
(Withs.Table (W).Uname, No_Elab_All_Link));
|
|
|
|
-- Elaborate_All_Desirable case, for this we establish the
|
|
-- same links as above, but with a different reason.
|
|
|
|
elsif Withs.Table (W).Elab_All_Desirable
|
|
and then not Doing_New
|
|
then
|
|
-- Reset flags used to stop multiple visits to a given
|
|
-- node.
|
|
|
|
for Uref in UNR.First .. UNR.Last loop
|
|
UNR.Table (Uref).Visited := False;
|
|
end loop;
|
|
|
|
-- Now establish all the links we need
|
|
|
|
Elab_All_Links
|
|
(Withed_Unit, U, Elab_All_Desirable,
|
|
Make_Elab_All_Entry
|
|
(Withs.Table (W).Uname, No_Elab_All_Link));
|
|
|
|
-- Pragma Elaborate case. We must build a link for the
|
|
-- withed unit itself, and also the corresponding body if
|
|
-- there is one.
|
|
|
|
-- However, skip this processing if there is no ALI file for
|
|
-- the WITH entry, because this means it is a generic (even
|
|
-- when we fix the generics so that an ALI file is present,
|
|
-- we probably still will have no ALI file for unchecked and
|
|
-- other special cases).
|
|
|
|
elsif Withs.Table (W).Elaborate
|
|
and then Withs.Table (W).Afile /= No_File
|
|
then
|
|
Build_Link (Withed_Unit, U, Withed);
|
|
|
|
if Units.Table (Withed_Unit).Utype = Is_Spec then
|
|
Build_Link
|
|
(Corresponding_Body (Withed_Unit), U, Elab);
|
|
end if;
|
|
|
|
-- Elaborate_Desirable case, for this we establish the same
|
|
-- links as above, but with a different reason.
|
|
|
|
elsif Withs.Table (W).Elab_Desirable then
|
|
Build_Link (Withed_Unit, U, Withed);
|
|
|
|
if Units.Table (Withed_Unit).Utype = Is_Spec then
|
|
Build_Link
|
|
(Corresponding_Body (Withed_Unit),
|
|
U, Elab_Desirable);
|
|
end if;
|
|
|
|
-- A limited_with does not establish an elaboration
|
|
-- dependence (that's the whole point).
|
|
|
|
elsif Withs.Table (W).Limited_With then
|
|
null;
|
|
|
|
-- Case of normal WITH with no elaboration pragmas, just
|
|
-- build the single link to the directly referenced unit
|
|
|
|
else
|
|
Build_Link (Withed_Unit, U, Withed);
|
|
end if;
|
|
end if;
|
|
|
|
<<Next_With>>
|
|
null;
|
|
end loop;
|
|
end if;
|
|
end loop;
|
|
|
|
-- If -f<elab_order> switch was given, take into account dependences
|
|
-- specified in the file <elab_order>.
|
|
|
|
if Force_Elab_Order_File /= null then
|
|
Force_Elab_Order;
|
|
end if;
|
|
|
|
-- Output elaboration dependencies if option is set
|
|
|
|
if Elab_Dependency_Output or Debug_Flag_E then
|
|
if Doing_New then
|
|
Write_Dependencies;
|
|
end if;
|
|
end if;
|
|
end Gather_Dependencies;
|
|
|
|
----------
|
|
-- Init --
|
|
----------
|
|
|
|
procedure Init is
|
|
begin
|
|
Num_Chosen := 0;
|
|
Num_Left := Int (Units.Last - Units.First + 1);
|
|
Succ.Init;
|
|
Elab_All_Entries.Init;
|
|
UNR.Init;
|
|
|
|
-- Initialize unit table for elaboration control
|
|
|
|
for U in Units.First .. Units.Last loop
|
|
UNR.Append
|
|
((Successors => No_Successor,
|
|
Num_Pred => 0,
|
|
Nextnp => No_Unit_Id,
|
|
Visited => False,
|
|
Elab_Position => 0,
|
|
SCC_Root => No_Unit_Id,
|
|
Nodes => null,
|
|
SCC_Num_Pred => 0,
|
|
Validate_Seen => False));
|
|
end loop;
|
|
end Init;
|
|
|
|
------------------
|
|
-- Is_Body_Unit --
|
|
------------------
|
|
|
|
function Is_Body_Unit (U : Unit_Id) return Boolean is
|
|
begin
|
|
return
|
|
Units.Table (U).Utype = Is_Body
|
|
or else Units.Table (U).Utype = Is_Body_Only;
|
|
end Is_Body_Unit;
|
|
|
|
-----------------------------
|
|
-- Is_Pure_Or_Preelab_Unit --
|
|
-----------------------------
|
|
|
|
function Is_Pure_Or_Preelab_Unit (U : Unit_Id) return Boolean is
|
|
begin
|
|
-- If we have a body with separate spec, test flags on the spec
|
|
|
|
if Units.Table (U).Utype = Is_Body then
|
|
return
|
|
Units.Table (Corresponding_Spec (U)).Preelab
|
|
or else Units.Table (Corresponding_Spec (U)).Pure;
|
|
|
|
-- Otherwise we have a spec or body acting as spec, test flags on unit
|
|
|
|
else
|
|
return Units.Table (U).Preelab or else Units.Table (U).Pure;
|
|
end if;
|
|
end Is_Pure_Or_Preelab_Unit;
|
|
|
|
---------------------
|
|
-- Is_Waiting_Body --
|
|
---------------------
|
|
|
|
function Is_Waiting_Body (U : Unit_Id) return Boolean is
|
|
begin
|
|
return
|
|
Units.Table (U).Utype = Is_Body
|
|
and then UNR.Table (Corresponding_Spec (U)).Elab_Position /= 0;
|
|
end Is_Waiting_Body;
|
|
|
|
-------------------------
|
|
-- Make_Elab_All_Entry --
|
|
-------------------------
|
|
|
|
function Make_Elab_All_Entry
|
|
(Unam : Unit_Name_Type;
|
|
Link : Elab_All_Id) return Elab_All_Id
|
|
is
|
|
begin
|
|
Elab_All_Entries.Append ((Needed_By => Unam, Next_Elab => Link));
|
|
return Elab_All_Entries.Last;
|
|
end Make_Elab_All_Entry;
|
|
|
|
----------------
|
|
-- Unit_Id_Of --
|
|
----------------
|
|
|
|
function Unit_Id_Of (Uname : Unit_Name_Type) return Unit_Id is
|
|
Info : constant Int := Get_Name_Table_Int (Uname);
|
|
|
|
begin
|
|
pragma Assert (Info /= 0 and then Unit_Id (Info) /= No_Unit_Id);
|
|
return Unit_Id (Info);
|
|
end Unit_Id_Of;
|
|
|
|
--------------
|
|
-- Validate --
|
|
--------------
|
|
|
|
procedure Validate (Order : Unit_Id_Array; Doing_New : Boolean) is
|
|
Cur_SCC : Unit_Id := No_Unit_Id;
|
|
OK : Boolean := True;
|
|
Msg : String := "Old: ";
|
|
|
|
begin
|
|
if Doing_New then
|
|
Msg := "New: ";
|
|
end if;
|
|
|
|
-- For each unit, assert that its successors are elaborated after it
|
|
|
|
for J in Order'Range loop
|
|
declare
|
|
U : constant Unit_Id := Order (J);
|
|
S : Successor_Id := UNR.Table (U).Successors;
|
|
|
|
begin
|
|
while S /= No_Successor loop
|
|
if UNR.Table (Succ.Table (S).After).Elab_Position <=
|
|
UNR.Table (U).Elab_Position
|
|
then
|
|
OK := False;
|
|
Write_Line (Msg & " elab order failed");
|
|
end if;
|
|
|
|
S := Succ.Table (S).Next;
|
|
end loop;
|
|
end;
|
|
end loop;
|
|
|
|
-- An SCC of size 2 units necessarily consists of a spec and the
|
|
-- corresponding body. Assert that the body is elaborated immediately
|
|
-- after the spec, with nothing in between. (We only have SCCs in the
|
|
-- new algorithm.)
|
|
|
|
if Doing_New then
|
|
for J in Order'Range loop
|
|
declare
|
|
U : constant Unit_Id := Order (J);
|
|
|
|
begin
|
|
if Nodes (U)'Length = 2 then
|
|
if Units.Table (U).Utype = Is_Spec then
|
|
if Order (J + 1) /= Corresponding_Body (U) then
|
|
OK := False;
|
|
Write_Line (Msg & "Bad spec with SCC of size 2:");
|
|
Write_SCC (SCC (U));
|
|
end if;
|
|
end if;
|
|
|
|
if Units.Table (U).Utype = Is_Body then
|
|
if Order (J - 1) /= Corresponding_Spec (U) then
|
|
OK := False;
|
|
Write_Line (Msg & "Bad body with SCC of size 2:");
|
|
Write_SCC (SCC (U));
|
|
end if;
|
|
end if;
|
|
end if;
|
|
end;
|
|
end loop;
|
|
|
|
-- Assert that all units of an SCC are elaborated together, with no
|
|
-- units from other SCCs in between. The above spec/body case is a
|
|
-- special case of this general rule.
|
|
|
|
for J in Order'Range loop
|
|
declare
|
|
U : constant Unit_Id := Order (J);
|
|
|
|
begin
|
|
if SCC (U) /= Cur_SCC then
|
|
Cur_SCC := SCC (U);
|
|
if UNR.Table (Cur_SCC).Validate_Seen then
|
|
OK := False;
|
|
Write_Line (Msg & "SCC not elaborated together:");
|
|
Write_SCC (Cur_SCC);
|
|
end if;
|
|
|
|
UNR.Table (Cur_SCC).Validate_Seen := True;
|
|
end if;
|
|
end;
|
|
end loop;
|
|
end if;
|
|
|
|
pragma Assert (OK);
|
|
end Validate;
|
|
|
|
-------------------
|
|
-- Write_Closure --
|
|
-------------------
|
|
|
|
procedure Write_Closure (Order : Unit_Id_Array) is
|
|
package Closure_Sources is new Table.Table
|
|
(Table_Component_Type => File_Name_Type,
|
|
Table_Index_Type => Natural,
|
|
Table_Low_Bound => 1,
|
|
Table_Initial => 10,
|
|
Table_Increment => 100,
|
|
Table_Name => "Gnatbind.Closure_Sources");
|
|
-- Table to record the sources in the closure, to avoid duplications
|
|
|
|
function Put_In_Sources (S : File_Name_Type) return Boolean;
|
|
-- Check if S is already in table Sources and put in Sources if it is
|
|
-- not. Return False if the source is already in Sources, and True if
|
|
-- it is added.
|
|
|
|
--------------------
|
|
-- Put_In_Sources --
|
|
--------------------
|
|
|
|
function Put_In_Sources (S : File_Name_Type) return Boolean is
|
|
begin
|
|
for J in 1 .. Closure_Sources.Last loop
|
|
if Closure_Sources.Table (J) = S then
|
|
return False;
|
|
end if;
|
|
end loop;
|
|
|
|
Closure_Sources.Append (S);
|
|
return True;
|
|
end Put_In_Sources;
|
|
|
|
-- Local variables
|
|
|
|
Source : File_Name_Type;
|
|
|
|
-- Start of processing for Write_Closure
|
|
|
|
begin
|
|
Closure_Sources.Init;
|
|
|
|
if not Zero_Formatting then
|
|
Write_Eol;
|
|
Write_Line ("REFERENCED SOURCES");
|
|
end if;
|
|
|
|
for J in reverse Order'Range loop
|
|
Source := Units.Table (Order (J)).Sfile;
|
|
|
|
-- Do not include same source more than once
|
|
|
|
if Put_In_Sources (Source)
|
|
|
|
-- Do not include run-time units unless -Ra switch set
|
|
|
|
and then (List_Closure_All
|
|
or else not Is_Internal_File_Name (Source))
|
|
then
|
|
if not Zero_Formatting then
|
|
Write_Str (" ");
|
|
end if;
|
|
|
|
Write_Line (Get_Name_String (Source));
|
|
end if;
|
|
end loop;
|
|
|
|
-- Subunits do not appear in the elaboration table because they are
|
|
-- subsumed by their parent units, but we need to list them for other
|
|
-- tools. For now they are listed after other files, rather than right
|
|
-- after their parent, since there is no easy link between the
|
|
-- elaboration table and the ALIs table ??? As subunits may appear
|
|
-- repeatedly in the list, if the parent unit appears in the context of
|
|
-- several units in the closure, duplicates are suppressed.
|
|
|
|
for J in Sdep.First .. Sdep.Last loop
|
|
Source := Sdep.Table (J).Sfile;
|
|
|
|
if Sdep.Table (J).Subunit_Name /= No_Name
|
|
and then Put_In_Sources (Source)
|
|
and then not Is_Internal_File_Name (Source)
|
|
then
|
|
if not Zero_Formatting then
|
|
Write_Str (" ");
|
|
end if;
|
|
|
|
Write_Line (Get_Name_String (Source));
|
|
end if;
|
|
end loop;
|
|
|
|
if not Zero_Formatting then
|
|
Write_Eol;
|
|
end if;
|
|
end Write_Closure;
|
|
|
|
------------------------
|
|
-- Write_Dependencies --
|
|
------------------------
|
|
|
|
procedure Write_Dependencies is
|
|
begin
|
|
if not Zero_Formatting then
|
|
Write_Eol;
|
|
Write_Line (" ELABORATION ORDER DEPENDENCIES");
|
|
Write_Eol;
|
|
end if;
|
|
|
|
Info_Prefix_Suppress := True;
|
|
|
|
for S in Succ_First .. Succ.Last loop
|
|
Elab_Error_Msg (S);
|
|
end loop;
|
|
|
|
Info_Prefix_Suppress := False;
|
|
|
|
if not Zero_Formatting then
|
|
Write_Eol;
|
|
end if;
|
|
end Write_Dependencies;
|
|
|
|
--------------------------
|
|
-- Write_Elab_All_Chain --
|
|
--------------------------
|
|
|
|
procedure Write_Elab_All_Chain (S : Successor_Id) is
|
|
ST : constant Successor_Link := Succ.Table (S);
|
|
After : constant Unit_Name_Type := Units.Table (ST.After).Uname;
|
|
|
|
L : Elab_All_Id;
|
|
Nam : Unit_Name_Type;
|
|
|
|
First_Name : Boolean := True;
|
|
|
|
begin
|
|
if ST.Reason in Elab_All .. Elab_All_Desirable then
|
|
L := ST.Elab_All_Link;
|
|
pragma Annotate (CodePeer, Modified, L);
|
|
|
|
while L /= No_Elab_All_Link loop
|
|
Nam := Elab_All_Entries.Table (L).Needed_By;
|
|
Error_Msg_Unit_1 := Nam;
|
|
Error_Msg_Output (" $", Info => True);
|
|
|
|
Get_Name_String (Nam);
|
|
|
|
if Name_Buffer (Name_Len) = 'b' then
|
|
if First_Name then
|
|
Error_Msg_Output
|
|
(" must be elaborated along with its spec:",
|
|
Info => True);
|
|
|
|
else
|
|
Error_Msg_Output
|
|
(" which must be elaborated along with its "
|
|
& "spec:",
|
|
Info => True);
|
|
end if;
|
|
|
|
else
|
|
if First_Name then
|
|
Error_Msg_Output
|
|
(" is withed by:",
|
|
Info => True);
|
|
|
|
else
|
|
Error_Msg_Output
|
|
(" which is withed by:",
|
|
Info => True);
|
|
end if;
|
|
end if;
|
|
|
|
First_Name := False;
|
|
|
|
L := Elab_All_Entries.Table (L).Next_Elab;
|
|
end loop;
|
|
|
|
Error_Msg_Unit_1 := After;
|
|
Error_Msg_Output (" $", Info => True);
|
|
end if;
|
|
end Write_Elab_All_Chain;
|
|
|
|
----------------------
|
|
-- Write_Elab_Order --
|
|
----------------------
|
|
|
|
procedure Write_Elab_Order
|
|
(Order : Unit_Id_Array; Title : String)
|
|
is
|
|
begin
|
|
if Title /= "" then
|
|
Write_Eol;
|
|
Write_Line (Title);
|
|
end if;
|
|
|
|
for J in Order'Range loop
|
|
if not Units.Table (Order (J)).SAL_Interface then
|
|
if not Zero_Formatting then
|
|
Write_Str (" ");
|
|
end if;
|
|
|
|
Write_Unit_Name (Units.Table (Order (J)).Uname);
|
|
Write_Eol;
|
|
end if;
|
|
end loop;
|
|
|
|
if Title /= "" then
|
|
Write_Eol;
|
|
end if;
|
|
end Write_Elab_Order;
|
|
|
|
--------------
|
|
-- Elab_New --
|
|
--------------
|
|
|
|
package body Elab_New is
|
|
|
|
generic
|
|
type Node is (<>);
|
|
First_Node : Node;
|
|
Last_Node : Node;
|
|
type Node_Array is array (Pos range <>) of Node;
|
|
with function Successors (N : Node) return Node_Array;
|
|
with procedure Create_SCC (Root : Node; Nodes : Node_Array);
|
|
|
|
procedure Compute_Strongly_Connected_Components;
|
|
-- Compute SCCs for a directed graph. The nodes in the graph are all
|
|
-- values of type Node in the range First_Node .. Last_Node.
|
|
-- Successors(N) returns the nodes pointed to by the edges emanating
|
|
-- from N. Create_SCC is a callback that is called once for each SCC,
|
|
-- passing in the Root node for that SCC (which is an arbitrary node in
|
|
-- the SCC used as a representative of that SCC), and the set of Nodes
|
|
-- in that SCC.
|
|
--
|
|
-- This is generic, in case we want to use it elsewhere; then we could
|
|
-- move this into a separate library unit. Unfortunately, it's not as
|
|
-- generic as one might like. Ideally, we would have "type Node is
|
|
-- private;", and pass in iterators to iterate over all nodes, and over
|
|
-- the successors of a given node. However, that leads to using advanced
|
|
-- features of Ada that are not allowed in the compiler and binder for
|
|
-- bootstrapping reasons. It also leads to trampolines, which are not
|
|
-- allowed in the compiler and binder. Restricting Node to be discrete
|
|
-- allows us to iterate over all nodes with a 'for' loop, and allows us
|
|
-- to attach temporary information to nodes by having an array indexed
|
|
-- by Node.
|
|
|
|
procedure Compute_Unit_SCCs;
|
|
-- Use the above generic procedure to compute the SCCs for the graph of
|
|
-- units. Store in each Unit_Node_Record the SCC_Root and Nodes
|
|
-- components. Also initialize the SCC_Num_Pred components.
|
|
|
|
procedure Find_Elab_All_Errors;
|
|
-- Generate an error for illegal Elaborate_All pragmas (explicit or
|
|
-- implicit). A pragma Elaborate_All (Y) on unit X is legal if and only
|
|
-- if X and Y are in different SCCs.
|
|
|
|
-------------------------------------------
|
|
-- Compute_Strongly_Connected_Components --
|
|
-------------------------------------------
|
|
|
|
procedure Compute_Strongly_Connected_Components is
|
|
|
|
-- This uses Tarjan's algorithm for finding SCCs. Comments here are
|
|
-- intended to tell what it does, but if you want to know how it
|
|
-- works, you have to look it up. Please do not modify this code
|
|
-- without reading up on Tarjan's algorithm.
|
|
|
|
subtype Node_Index is Nat;
|
|
No_Index : constant Node_Index := 0;
|
|
|
|
Num_Nodes : constant Nat :=
|
|
Node'Pos (Last_Node) - Node'Pos (First_Node) + 1;
|
|
Stack : Node_Array (1 .. Num_Nodes);
|
|
Top : Node_Index := 0;
|
|
-- Stack of nodes, pushed when first visited. All nodes of an SCC are
|
|
-- popped at once when the SCC is found.
|
|
|
|
subtype Valid_Node is Node range First_Node .. Last_Node;
|
|
Node_Indices : array (Valid_Node) of Node_Index :=
|
|
(others => No_Index);
|
|
-- Each node has an "index", which is the sequential number in the
|
|
-- order in which they are visited in the recursive walk. No_Index
|
|
-- means "not yet visited"; we want to avoid walking any node more
|
|
-- than once.
|
|
|
|
Index : Node_Index := 1;
|
|
-- Next value to be assigned to a node index
|
|
|
|
Low_Links : array (Valid_Node) of Node_Index;
|
|
-- Low_Links (N) is the smallest index of nodes reachable from N
|
|
|
|
On_Stack : array (Valid_Node) of Boolean := (others => False);
|
|
-- True if the node is currently on the stack
|
|
|
|
procedure Walk (N : Valid_Node);
|
|
-- Recursive depth-first graph walk, with the node index used to
|
|
-- avoid visiting a node more than once.
|
|
|
|
----------
|
|
-- Walk --
|
|
----------
|
|
|
|
procedure Walk (N : Valid_Node) is
|
|
Stack_Position_Of_N : constant Pos := Top + 1;
|
|
S : constant Node_Array := Successors (N);
|
|
|
|
begin
|
|
-- Assign the index and low link, increment Index for next call to
|
|
-- Walk.
|
|
|
|
Node_Indices (N) := Index;
|
|
Low_Links (N) := Index;
|
|
Index := Index + 1;
|
|
|
|
-- Push it on the stack:
|
|
|
|
Top := Stack_Position_Of_N;
|
|
Stack (Top) := N;
|
|
On_Stack (N) := True;
|
|
|
|
-- Walk not-yet-visited subnodes, and update low link for visited
|
|
-- ones as appropriate.
|
|
|
|
for J in S'Range loop
|
|
if Node_Indices (S (J)) = No_Index then
|
|
Walk (S (J));
|
|
Low_Links (N) :=
|
|
Node_Index'Min (Low_Links (N), Low_Links (S (J)));
|
|
elsif On_Stack (S (J)) then
|
|
Low_Links (N) :=
|
|
Node_Index'Min (Low_Links (N), Node_Indices (S (J)));
|
|
end if;
|
|
end loop;
|
|
|
|
-- If the index is (still) equal to the low link, we've found an
|
|
-- SCC. Pop the whole SCC off the stack, and call Create_SCC.
|
|
|
|
if Low_Links (N) = Node_Indices (N) then
|
|
declare
|
|
SCC : Node_Array renames
|
|
Stack (Stack_Position_Of_N .. Top);
|
|
pragma Assert (SCC'Length >= 1);
|
|
pragma Assert (SCC (SCC'First) = N);
|
|
|
|
begin
|
|
for J in SCC'Range loop
|
|
On_Stack (SCC (J)) := False;
|
|
end loop;
|
|
|
|
Create_SCC (Root => N, Nodes => SCC);
|
|
pragma Assert (Top - SCC'Length = Stack_Position_Of_N - 1);
|
|
Top := Stack_Position_Of_N - 1; -- pop all
|
|
end;
|
|
end if;
|
|
end Walk;
|
|
|
|
-- Start of processing for Compute_Strongly_Connected_Components
|
|
|
|
begin
|
|
-- Walk all the nodes that have not yet been walked
|
|
|
|
for N in Valid_Node loop
|
|
if Node_Indices (N) = No_Index then
|
|
Walk (N);
|
|
end if;
|
|
end loop;
|
|
end Compute_Strongly_Connected_Components;
|
|
|
|
-----------------------
|
|
-- Compute_Unit_SCCs --
|
|
-----------------------
|
|
|
|
procedure Compute_Unit_SCCs is
|
|
function Successors (U : Unit_Id) return Unit_Id_Array;
|
|
-- Return all the units that must be elaborated after U. In addition,
|
|
-- if U is a body, include the corresponding spec; this ensures that
|
|
-- a spec/body pair are always in the same SCC.
|
|
|
|
procedure Create_SCC (Root : Unit_Id; Nodes : Unit_Id_Array);
|
|
-- Set Nodes of the Root, and set SCC_Root of all the Nodes
|
|
|
|
procedure Init_SCC_Num_Pred (U : Unit_Id);
|
|
-- Initialize the SCC_Num_Pred fields, so that the root of each SCC
|
|
-- has a count of the number of successors of all the units in the
|
|
-- SCC, but only for successors outside the SCC.
|
|
|
|
procedure Compute_SCCs is new Compute_Strongly_Connected_Components
|
|
(Node => Unit_Id,
|
|
First_Node => Units.First,
|
|
Last_Node => Units.Last,
|
|
Node_Array => Unit_Id_Array,
|
|
Successors => Successors,
|
|
Create_SCC => Create_SCC);
|
|
|
|
----------------
|
|
-- Create_SCC --
|
|
----------------
|
|
|
|
procedure Create_SCC (Root : Unit_Id; Nodes : Unit_Id_Array) is
|
|
begin
|
|
if Debug_Flag_V then
|
|
Write_Str ("Root = ");
|
|
Write_Int (Int (Root));
|
|
Write_Str (" ");
|
|
Write_Unit_Name (Units.Table (Root).Uname);
|
|
Write_Str (" -- ");
|
|
Write_Int (Nodes'Length);
|
|
Write_Line (" units:");
|
|
|
|
for J in Nodes'Range loop
|
|
Write_Str (" ");
|
|
Write_Int (Int (Nodes (J)));
|
|
Write_Str (" ");
|
|
Write_Unit_Name (Units.Table (Nodes (J)).Uname);
|
|
Write_Eol;
|
|
end loop;
|
|
end if;
|
|
|
|
pragma Assert (Nodes (Nodes'First) = Root);
|
|
pragma Assert (UNR.Table (Root).Nodes = null);
|
|
UNR.Table (Root).Nodes := new Unit_Id_Array'(Nodes);
|
|
|
|
for J in Nodes'Range loop
|
|
pragma Assert (SCC (Nodes (J)) = No_Unit_Id);
|
|
UNR.Table (Nodes (J)).SCC_Root := Root;
|
|
end loop;
|
|
end Create_SCC;
|
|
|
|
----------------
|
|
-- Successors --
|
|
----------------
|
|
|
|
function Successors (U : Unit_Id) return Unit_Id_Array is
|
|
S : Successor_Id := UNR.Table (U).Successors;
|
|
Tab : Unit_Id_Table;
|
|
|
|
begin
|
|
-- Pretend that a spec is a successor of its body (even though it
|
|
-- isn't), just so both get included.
|
|
|
|
if Units.Table (U).Utype = Is_Body then
|
|
Append (Tab, Corresponding_Spec (U));
|
|
end if;
|
|
|
|
-- Now include the real successors
|
|
|
|
while S /= No_Successor loop
|
|
pragma Assert (Succ.Table (S).Before = U);
|
|
Append (Tab, Succ.Table (S).After);
|
|
S := Succ.Table (S).Next;
|
|
end loop;
|
|
|
|
declare
|
|
Result : constant Unit_Id_Array := Tab.Table (1 .. Last (Tab));
|
|
|
|
begin
|
|
Free (Tab);
|
|
return Result;
|
|
end;
|
|
end Successors;
|
|
|
|
-----------------------
|
|
-- Init_SCC_Num_Pred --
|
|
-----------------------
|
|
|
|
procedure Init_SCC_Num_Pred (U : Unit_Id) is
|
|
begin
|
|
if UNR.Table (U).Visited then
|
|
return;
|
|
end if;
|
|
|
|
UNR.Table (U).Visited := True;
|
|
|
|
declare
|
|
S : Successor_Id := UNR.Table (U).Successors;
|
|
|
|
begin
|
|
while S /= No_Successor loop
|
|
pragma Assert (Succ.Table (S).Before = U);
|
|
Init_SCC_Num_Pred (Succ.Table (S).After);
|
|
|
|
if SCC (U) /= SCC (Succ.Table (S).After) then
|
|
UNR.Table (SCC (Succ.Table (S).After)).SCC_Num_Pred :=
|
|
UNR.Table (SCC (Succ.Table (S).After)).SCC_Num_Pred + 1;
|
|
end if;
|
|
|
|
S := Succ.Table (S).Next;
|
|
end loop;
|
|
end;
|
|
end Init_SCC_Num_Pred;
|
|
|
|
-- Start of processing for Compute_Unit_SCCs
|
|
|
|
begin
|
|
Compute_SCCs;
|
|
|
|
for Uref in UNR.First .. UNR.Last loop
|
|
pragma Assert (not UNR.Table (Uref).Visited);
|
|
null;
|
|
end loop;
|
|
|
|
for Uref in UNR.First .. UNR.Last loop
|
|
Init_SCC_Num_Pred (Uref);
|
|
end loop;
|
|
|
|
-- Assert that SCC_Root of all units has been set to a valid unit,
|
|
-- and that SCC_Num_Pred has not been modified in non-root units.
|
|
|
|
for Uref in UNR.First .. UNR.Last loop
|
|
pragma Assert (UNR.Table (Uref).SCC_Root /= No_Unit_Id);
|
|
pragma Assert (UNR.Table (Uref).SCC_Root in UNR.First .. UNR.Last);
|
|
|
|
if SCC (Uref) /= Uref then
|
|
pragma Assert (UNR.Table (Uref).SCC_Num_Pred = 0);
|
|
null;
|
|
end if;
|
|
end loop;
|
|
end Compute_Unit_SCCs;
|
|
|
|
--------------------------
|
|
-- Find_Elab_All_Errors --
|
|
--------------------------
|
|
|
|
procedure Find_Elab_All_Errors is
|
|
Withed_Unit : Unit_Id;
|
|
|
|
begin
|
|
for U in Units.First .. Units.Last loop
|
|
|
|
-- If this unit is not an interface to a stand-alone library,
|
|
-- process WITH references for this unit ignoring interfaces to
|
|
-- stand-alone libraries.
|
|
|
|
if not Units.Table (U).SAL_Interface then
|
|
for W in Units.Table (U).First_With ..
|
|
Units.Table (U).Last_With
|
|
loop
|
|
if Withs.Table (W).Sfile /= No_File
|
|
and then (not Withs.Table (W).SAL_Interface)
|
|
then
|
|
-- Check for special case of withing a unit that does not
|
|
-- exist any more.
|
|
|
|
if Get_Name_Table_Int (Withs.Table (W).Uname) = 0 then
|
|
goto Next_With;
|
|
end if;
|
|
|
|
Withed_Unit := Unit_Id_Of (Withs.Table (W).Uname);
|
|
|
|
-- If it's Elaborate_All or Elab_All_Desirable, check
|
|
-- that the withER and withEE are not in the same SCC.
|
|
|
|
if Withs.Table (W).Elaborate_All
|
|
or else Withs.Table (W).Elab_All_Desirable
|
|
then
|
|
if SCC (U) = SCC (Withed_Unit) then
|
|
Elab_Cycle_Found := True; -- ???
|
|
|
|
-- We could probably give better error messages
|
|
-- than Elab_Old here, but for now, to avoid
|
|
-- disruption, we don't give any error here.
|
|
-- Instead, we set the Elab_Cycle_Found flag above,
|
|
-- and then run the Elab_Old algorithm to issue the
|
|
-- error message. Ideally, we would like to print
|
|
-- multiple errors rather than stopping after the
|
|
-- first cycle.
|
|
|
|
if False then
|
|
Error_Msg_Output
|
|
("illegal pragma Elaborate_All",
|
|
Info => False);
|
|
end if;
|
|
end if;
|
|
end if;
|
|
end if;
|
|
|
|
<<Next_With>>
|
|
null;
|
|
end loop;
|
|
end if;
|
|
end loop;
|
|
end Find_Elab_All_Errors;
|
|
|
|
---------------------
|
|
-- Find_Elab_Order --
|
|
---------------------
|
|
|
|
procedure Find_Elab_Order (Elab_Order : out Unit_Id_Table) is
|
|
Best_So_Far : Unit_Id;
|
|
U : Unit_Id;
|
|
|
|
begin
|
|
-- Gather dependencies and output them if option set
|
|
|
|
Gather_Dependencies;
|
|
|
|
Compute_Unit_SCCs;
|
|
|
|
-- Initialize the no-predecessor list
|
|
|
|
No_Pred := No_Unit_Id;
|
|
for U in UNR.First .. UNR.Last loop
|
|
if UNR.Table (U).Num_Pred = 0 then
|
|
UNR.Table (U).Nextnp := No_Pred;
|
|
No_Pred := U;
|
|
end if;
|
|
end loop;
|
|
|
|
-- OK, now we determine the elaboration order proper. All we do is to
|
|
-- select the best choice from the no-predecessor list until all the
|
|
-- nodes have been chosen.
|
|
|
|
Outer : loop
|
|
if Debug_Flag_N then
|
|
Write_Line ("Outer loop");
|
|
end if;
|
|
|
|
-- If there are no nodes with predecessors, then either we are
|
|
-- done, as indicated by Num_Left being set to zero, or we have
|
|
-- a circularity. In the latter case, diagnose the circularity,
|
|
-- removing it from the graph and continue.
|
|
-- ????But Diagnose_Elaboration_Problem always raises an
|
|
-- exception, so the loop never goes around more than once.
|
|
|
|
Get_No_Pred : while No_Pred = No_Unit_Id loop
|
|
exit Outer when Num_Left < 1;
|
|
Diagnose_Elaboration_Problem (Elab_Order);
|
|
end loop Get_No_Pred;
|
|
|
|
U := No_Pred;
|
|
Best_So_Far := No_Unit_Id;
|
|
|
|
-- Loop to choose best entry in No_Pred list
|
|
|
|
No_Pred_Search : loop
|
|
if Debug_Flag_N then
|
|
Write_Str (" considering choice of ");
|
|
Write_Unit_Name (Units.Table (U).Uname);
|
|
Write_Eol;
|
|
|
|
if Units.Table (U).Elaborate_Body then
|
|
Write_Str
|
|
(" Elaborate_Body = True, Num_Pred for body = ");
|
|
Write_Int
|
|
(UNR.Table (Corresponding_Body (U)).Num_Pred);
|
|
else
|
|
Write_Str
|
|
(" Elaborate_Body = False");
|
|
end if;
|
|
|
|
Write_Eol;
|
|
end if;
|
|
|
|
-- Don't even consider units whose SCC is not ready. This
|
|
-- ensures that all units of an SCC will be elaborated
|
|
-- together, with no other units in between.
|
|
|
|
if SCC_Num_Pred (U) = 0
|
|
and then Better_Choice (U, Best_So_Far)
|
|
then
|
|
if Debug_Flag_N then
|
|
Write_Line (" tentatively chosen (best so far)");
|
|
end if;
|
|
|
|
Best_So_Far := U;
|
|
else
|
|
if Debug_Flag_N then
|
|
Write_Line (" SCC not ready");
|
|
end if;
|
|
end if;
|
|
|
|
U := UNR.Table (U).Nextnp;
|
|
exit No_Pred_Search when U = No_Unit_Id;
|
|
end loop No_Pred_Search;
|
|
|
|
-- If there are no units on the No_Pred list whose SCC is ready,
|
|
-- there must be a cycle. Defer to Elab_Old to print an error
|
|
-- message.
|
|
|
|
if Best_So_Far = No_Unit_Id then
|
|
Elab_Cycle_Found := True;
|
|
return;
|
|
end if;
|
|
|
|
-- Choose the best candidate found
|
|
|
|
Choose (Elab_Order, Best_So_Far, " [Best_So_Far]");
|
|
|
|
-- If it's a spec with a body, and the body is not yet chosen,
|
|
-- choose the body if possible. The case where the body is
|
|
-- already chosen is Elaborate_Body; the above call to Choose
|
|
-- the spec will also Choose the body.
|
|
|
|
if Units.Table (Best_So_Far).Utype = Is_Spec
|
|
and then UNR.Table
|
|
(Corresponding_Body (Best_So_Far)).Elab_Position = 0
|
|
then
|
|
declare
|
|
Choose_The_Body : constant Boolean :=
|
|
UNR.Table (Corresponding_Body
|
|
(Best_So_Far)).Num_Pred = 0;
|
|
|
|
begin
|
|
if Debug_Flag_B then
|
|
Write_Str ("Can we choose the body?... ");
|
|
|
|
if Choose_The_Body then
|
|
Write_Line ("Yes!");
|
|
else
|
|
Write_Line ("No.");
|
|
end if;
|
|
end if;
|
|
|
|
if Choose_The_Body then
|
|
Choose
|
|
(Elab_Order => Elab_Order,
|
|
Chosen => Corresponding_Body (Best_So_Far),
|
|
Msg => " [body]");
|
|
end if;
|
|
end;
|
|
end if;
|
|
|
|
-- Finally, choose all the rest of the units in the same SCC as
|
|
-- Best_So_Far. If it hasn't been chosen (Elab_Position = 0), and
|
|
-- it's ready to be chosen (Num_Pred = 0), then we can choose it.
|
|
|
|
loop
|
|
declare
|
|
Chose_One_Or_More : Boolean := False;
|
|
SCC : Unit_Id_Array renames Nodes (Best_So_Far).all;
|
|
|
|
begin
|
|
for J in SCC'Range loop
|
|
if UNR.Table (SCC (J)).Elab_Position = 0
|
|
and then UNR.Table (SCC (J)).Num_Pred = 0
|
|
then
|
|
Chose_One_Or_More := True;
|
|
Choose (Elab_Order, SCC (J), " [same SCC]");
|
|
end if;
|
|
end loop;
|
|
|
|
exit when not Chose_One_Or_More;
|
|
end;
|
|
end loop;
|
|
end loop Outer;
|
|
|
|
Find_Elab_All_Errors;
|
|
end Find_Elab_Order;
|
|
|
|
-----------
|
|
-- Nodes --
|
|
-----------
|
|
|
|
function Nodes (U : Unit_Id) return Unit_Id_Array_Ptr is
|
|
begin
|
|
return UNR.Table (SCC (U)).Nodes;
|
|
end Nodes;
|
|
|
|
---------
|
|
-- SCC --
|
|
---------
|
|
|
|
function SCC (U : Unit_Id) return Unit_Id is
|
|
begin
|
|
return UNR.Table (U).SCC_Root;
|
|
end SCC;
|
|
|
|
------------------
|
|
-- SCC_Num_Pred --
|
|
------------------
|
|
|
|
function SCC_Num_Pred (U : Unit_Id) return Int is
|
|
begin
|
|
return UNR.Table (SCC (U)).SCC_Num_Pred;
|
|
end SCC_Num_Pred;
|
|
|
|
---------------
|
|
-- Write_SCC --
|
|
---------------
|
|
|
|
procedure Write_SCC (U : Unit_Id) is
|
|
pragma Assert (SCC (U) = U);
|
|
begin
|
|
for J in Nodes (U)'Range loop
|
|
Write_Int (UNR.Table (Nodes (U) (J)).Elab_Position);
|
|
Write_Str (". ");
|
|
Write_Unit_Name (Units.Table (Nodes (U) (J)).Uname);
|
|
Write_Eol;
|
|
end loop;
|
|
|
|
Write_Eol;
|
|
end Write_SCC;
|
|
|
|
end Elab_New;
|
|
|
|
--------------
|
|
-- Elab_Old --
|
|
--------------
|
|
|
|
package body Elab_Old is
|
|
|
|
---------------------
|
|
-- Find_Elab_Order --
|
|
---------------------
|
|
|
|
procedure Find_Elab_Order (Elab_Order : out Unit_Id_Table) is
|
|
Best_So_Far : Unit_Id;
|
|
U : Unit_Id;
|
|
|
|
begin
|
|
-- Gather dependencies and output them if option set
|
|
|
|
Gather_Dependencies;
|
|
|
|
-- Initialize the no-predecessor list
|
|
|
|
No_Pred := No_Unit_Id;
|
|
for U in UNR.First .. UNR.Last loop
|
|
if UNR.Table (U).Num_Pred = 0 then
|
|
UNR.Table (U).Nextnp := No_Pred;
|
|
No_Pred := U;
|
|
end if;
|
|
end loop;
|
|
|
|
-- OK, now we determine the elaboration order proper. All we do is to
|
|
-- select the best choice from the no-predecessor list until all the
|
|
-- nodes have been chosen.
|
|
|
|
Outer : loop
|
|
|
|
-- If there are no nodes with predecessors, then either we are
|
|
-- done, as indicated by Num_Left being set to zero, or we have
|
|
-- a circularity. In the latter case, diagnose the circularity,
|
|
-- removing it from the graph and continue.
|
|
-- ????But Diagnose_Elaboration_Problem always raises an
|
|
-- exception, so the loop never goes around more than once.
|
|
|
|
Get_No_Pred : while No_Pred = No_Unit_Id loop
|
|
exit Outer when Num_Left < 1;
|
|
Diagnose_Elaboration_Problem (Elab_Order);
|
|
end loop Get_No_Pred;
|
|
|
|
U := No_Pred;
|
|
Best_So_Far := No_Unit_Id;
|
|
|
|
-- Loop to choose best entry in No_Pred list
|
|
|
|
No_Pred_Search : loop
|
|
if Debug_Flag_N then
|
|
Write_Str (" considering choice of ");
|
|
Write_Unit_Name (Units.Table (U).Uname);
|
|
Write_Eol;
|
|
|
|
if Units.Table (U).Elaborate_Body then
|
|
Write_Str
|
|
(" Elaborate_Body = True, Num_Pred for body = ");
|
|
Write_Int
|
|
(UNR.Table (Corresponding_Body (U)).Num_Pred);
|
|
else
|
|
Write_Str
|
|
(" Elaborate_Body = False");
|
|
end if;
|
|
|
|
Write_Eol;
|
|
end if;
|
|
|
|
-- This is a candididate to be considered for choice
|
|
|
|
if Better_Choice (U, Best_So_Far) then
|
|
if Debug_Flag_N then
|
|
Write_Line (" tentatively chosen (best so far)");
|
|
end if;
|
|
|
|
Best_So_Far := U;
|
|
end if;
|
|
|
|
U := UNR.Table (U).Nextnp;
|
|
exit No_Pred_Search when U = No_Unit_Id;
|
|
end loop No_Pred_Search;
|
|
|
|
-- Choose the best candidate found
|
|
|
|
Choose (Elab_Order, Best_So_Far, " [Elab_Old Best_So_Far]");
|
|
end loop Outer;
|
|
end Find_Elab_Order;
|
|
|
|
end Elab_Old;
|
|
|
|
end Binde;
|