aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.cc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2022-03-19 00:23:39 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-17 08:25:41 +0000
commitd4090614041c7803373a5064dfb82fdf6017971d (patch)
treee31236cc5772f6f5521aa8c2635a1a3f220d8450 /gcc/ada/gcc-interface/trans.cc
parenta08f366ae875ae70fba5014c94956cdbf7bf91db (diff)
downloadgcc-d4090614041c7803373a5064dfb82fdf6017971d.zip
gcc-d4090614041c7803373a5064dfb82fdf6017971d.tar.gz
gcc-d4090614041c7803373a5064dfb82fdf6017971d.tar.bz2
[Ada] Use Actions field of freeze nodes for subprograms
This has a couple of advantages: 1) the actions are analyzed with checks disabled and 2) they are considered elaboration code by Sem_Elab. gcc/ada/ * exp_ch13.adb (Expand_N_Freeze_Entity): Delete freeze nodes for subprograms only if they have no actions. * exp_ch6.adb (Freeze_Subprogram): Put the actions into the Actions field of the freeze node instead of inserting them after it. * sem_elab.adb (Is_SPARK_Semantic_Target): Fix typo in comment. * gcc-interface/trans.cc (process_freeze_entity): Return early for freeze nodes of subprograms with Interface_Alias set.
Diffstat (limited to 'gcc/ada/gcc-interface/trans.cc')
-rw-r--r--gcc/ada/gcc-interface/trans.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index 5741986..e9701cd 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -9045,6 +9045,11 @@ process_freeze_entity (Node_Id gnat_node)
if (kind == E_Class_Wide_Type)
return;
+ /* Likewise for the entities internally used by the front-end to register
+ primitives covering abstract interfaces, see Expand_N_Freeze_Entity. */
+ if (Is_Subprogram (gnat_entity) && Present (Interface_Alias (gnat_entity)))
+ return;
+
/* Check for an old definition if this isn't an object with address clause,
since the saved GCC tree is the address expression in that case. */
gnu_old