diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-11-08 20:50:52 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-11-19 13:58:50 +0100 |
commit | 7387bd77db523fc0347763785c70975da1579245 (patch) | |
tree | bc5b4047a504bb62a5b7a23c7dbad913f3fd23e2 /gcc/config/freebsd-nthr.h | |
parent | a3271e0613a56402ea048da7c51267c07d5962b4 (diff) | |
download | gcc-7387bd77db523fc0347763785c70975da1579245.zip gcc-7387bd77db523fc0347763785c70975da1579245.tar.gz gcc-7387bd77db523fc0347763785c70975da1579245.tar.bz2 |
ada: Cleanup in expansion of aggregates in object declarations with aspects
The strategy to expand aggregates present as initialization expressions in
object declarations, originally with a subsequent address clause given for
the object and later with aspects whose resolution needs to be delayed up
to the freeze point, has been to block their resolution, so as to block
their expansion, during the processing of the declarations, lest they be
nonstatic and expanded in place and therefore generate assignments to the
object before its freeze point, which is forbidden. Instead a temporary
is created at the declaration point and the aggregates are assigned to it,
and finally the temporary is copied into the object at the freeze point.
Of course this general strategy cannot be applied to limited types because
the copy operation is forbidden for them, so instead aggregates of limited
types are resolved but have their expansion delayed, before being eventually
expanded through Convert_Aggr_In_Object_Decl, which uses the mechanism based
on Initialization_Statements to insert them at the freeze point.
After the series of cleanups, all the aggregates that are initialization
expressions in object declarations and get expanded in place, go through the
Convert_Aggr_In_Object_Decl mechanism, exactly like those of limited type
with address clause/aspects have done historically. This means that we no
longer need to block the resolution of those of nonlimited type with address
clause/aspects.
gcc/ada/ChangeLog:
* exp_ch3.adb: Remove clauses for Expander.
(Expand_N_Object_Declaration): Remove special processing for delayed
aggregates of limited types as initialization expressions.
* freeze.adb (Warn_Overlay): Bail out if No_Initialization is set on
the declaration node of the entity.
* sem_ch3.adb (Delayed_Aspect_Present): Delete.
(Expand_N_Object_Declaration): Do not block the resolution of the
initialization expression that is an aggregate when the object has
an address clause or delayed aspects.
Diffstat (limited to 'gcc/config/freebsd-nthr.h')
0 files changed, 0 insertions, 0 deletions