]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Allow file mapping for System's spec
authorRonan Desplanques <desplanques@adacore.com>
Thu, 24 Oct 2024 12:56:15 +0000 (14:56 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 12 Nov 2024 13:00:52 +0000 (14:00 +0100)
commitf0a2e57d0525b3372d5de543c77c5e1d7f830c69
treefbcb8229ea9e168085108593d31c179fc93a0fad
parent78b52a0aadddbf7de47d686e7c28da3b5ecf4364
ada: Allow file mapping for System's spec

Before this patch, it was never allowed to use pragma Source_File_Name
for the spec of System, allegedly because Targparm.Get_Target_Parameters
is called before configuration pragmas are processed. Using a mapping
file was allowed but did not work correctly.

This patch makes mapping files loading happen before the call to
Get_Target_Parameters so mapping file can set the file name of System.
Also, pragma Source_File_Name is allowed if it confirms a mapping that
was previously given in a mapping file, to accommodate GPRbuild that
uses both pragmas and mapping files.

gcc/ada/ChangeLog:

* frontend.adb (Frontend): Move call to Fmap.Initialize ...
* gnat1drv.adb (Gnat1drv): ... here. Look up Fmap when loading System.
* par-prag.adb (Prag): Allow pragma Source_File_Name for System when
it confirms an existing mapping.
gcc/ada/frontend.adb
gcc/ada/gnat1drv.adb
gcc/ada/par-prag.adb