aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-02-19 18:45:00 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-23 09:59:05 +0200
commitb64aaf4d81916f5570ddf2414747f3152e8b9f84 (patch)
treebca8ed2928da481bfa3154ba941373850ae31754 /gcc/ada/sem_res.adb
parent90e1445904179706e50c90c6553e127dbb2c43e8 (diff)
downloadgcc-b64aaf4d81916f5570ddf2414747f3152e8b9f84.zip
gcc-b64aaf4d81916f5570ddf2414747f3152e8b9f84.tar.gz
gcc-b64aaf4d81916f5570ddf2414747f3152e8b9f84.tar.bz2
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.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 365c750..a99bed0 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -6037,11 +6037,11 @@ package body Sem_Res is
-- Start of processing for Resolve_Arithmetic_Op
begin
- if Comes_From_Source (N)
- and then Ekind (Entity (N)) = E_Function
+ if Ekind (Entity (N)) = E_Function
and then Is_Imported (Entity (N))
and then Is_Intrinsic_Subprogram (Entity (N))
then
+ Generate_Reference (Entity (N), N);
Resolve_Intrinsic_Operator (N, Typ);
return;
@@ -9710,7 +9710,7 @@ package body Sem_Res is
--------------------------------
procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id) is
- Btyp : constant Entity_Id := Base_Type (Underlying_Type (Typ));
+ Btyp : constant Entity_Id := Implementation_Base_Type (Typ);
Op : Entity_Id;
Arg1 : Node_Id;
Arg2 : Node_Id;
@@ -10641,11 +10641,11 @@ package body Sem_Res is
end if;
end if;
- if Comes_From_Source (N)
- and then Ekind (Entity (N)) = E_Function
+ if Ekind (Entity (N)) = E_Function
and then Is_Imported (Entity (N))
and then Is_Intrinsic_Subprogram (Entity (N))
then
+ Generate_Reference (Entity (N), N);
Resolve_Intrinsic_Operator (N, Typ);
return;
end if;