ada: Remove the body of System.Storage_Elements
commitb64aaf4d81916f5570ddf2414747f3152e8b9f84
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 19 Feb 2023 17:45:00 +0000 (19 18:45 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 23 May 2023 07:59:05 +0000 (23 09:59 +0200)
treebca8ed2928da481bfa3154ba941373850ae31754
parent90e1445904179706e50c90c6553e127dbb2c43e8
ada: Remove the body of System.Storage_Elements

All the subprograms declared in the unit have convention Intrinsic and
their current implementation makes some implicit assumptions that are
not valid universally, so it is replaced by a direct expansion.

This is mostly straightforward because Resolve_Intrinsic_Operator already
contains the required circuitry, but a few adjustements are necessary.

gcc/ada/

* exp_ch4.adb (Expand_N_Op_Mod): Deal with the special mod
operator of System.Storage_Elements.
* exp_intr.adb (Expand_To_Integer): New procedure.
(Expand_Intrinsic_Call): Call Expand_To_Integer appropriately.
(Expand_To_Address): Deal with an argument with modular type.
* sem_ch3.adb (Derive_Subprogram): Also set convention Intrinsic
on a derived intrinsic subprogram.
* sem_res.adb (Resolve_Arithmetic_Op): Deal with intrinsic
operators not coming from source exactly as those coming from
source and also generate a reference in both cases.
(Resolve_Op_Expon): Likewise.
(Resolve_Intrinsic_Operator): Call Implementation_Base_Type to get
a nonprivate base type.
* snames.ads-tmpl (Name_To_Integer): New intrinsic name.
* libgnat/s-stoele.ads: Replace pragma Convention with pragma
Import throughout and remove pragma Inline_Always and
Pure_Function.
* libgnat/s-stoele.adb: Replace entire contents with pragma
No_Body.
* libgnat/s-atacco.adb: Adjust comment about pragma No_Body.
gcc/ada/exp_ch4.adb
gcc/ada/exp_intr.adb
gcc/ada/libgnat/s-atacco.adb
gcc/ada/libgnat/s-stoele.adb [copied from gcc/ada/libgnat/s-atacco.adb with 88% similarity]
gcc/ada/libgnat/s-stoele.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_res.adb
gcc/ada/snames.ads-tmpl