[Ada] Implement AI12-0175 Preelaborable packages with address clauses
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 20 Mar 2020 22:00:32 +0000 (23:00 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 12 Jun 2020 08:29:15 +0000 (04:29 -0400)
commitec772e4b269206a943b3caa5544d9c7ac1d8de1a
tree2e4f88df493177cf8b9d464d87e8045c9450b5b3
parent6f6f89a494e3b9b2d9ed73589f04b54c3282a5ef
[Ada] Implement AI12-0175 Preelaborable packages with address clauses

2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* rtsfind.ads (RTU_Id): Add System_Address_To_Access_Conversions.
* sem_elab.adb (Elaboration_Phase_Active): Alphabetize.
(Finalize_All_Data_Structures): Likewise.
(Error_Preelaborated_Call): New procedure.
(Build_Call_Marker): Set Is_Preelaborable_Call flag in marker.
(Build_Access_Marker): Likewise.
(Build_Subprogram_Invocation): Likewise.
(Build_Task_Activation): Likewise.
(Check_Preelaborated_Call): Return when the call is preelaborable.
Call Error_Preelaborated_Call to give the error otherwise.
(Check_Elab_Call): Likewise.
* sem_util.adb (Is_Preelaborable_Function): New predicate.
(Is_Non_Preelaborable_Construct.Visit): Recurse on the
Explicit_Actual_Parameter field of N_Parameter_Association.
(Is_Non_Preelaborable_Construct.Visit_Subexpression): In Ada 2020,
for a call to a preelaborable function, visit the parameter list;
otherwise, raise Non_Preelaborable exception.
(Is_Preelaborable_Construct): Likewise, but recursively check the
parameters instead and return false upon failure, otherwise true.
* sinfo.ads (Is_Preelaborable_Call): New flag in call marker nodes.
(Is_Preelaborable_Call): New inline function.
(Set_Is_Preelaborable_Call): New inline procedure.
* sinfo.adb (Is_Preelaborable_Call): New inline function.
(Set_Is_Preelaborable_Call): New inline procedure.
gcc/ada/rtsfind.ads
gcc/ada/sem_elab.adb
gcc/ada/sem_util.adb
gcc/ada/sinfo.adb
gcc/ada/sinfo.ads