]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Add minimal support for other delayed aspects on controlled objects
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 17 Nov 2024 19:00:42 +0000 (20:00 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 12 Dec 2024 09:57:57 +0000 (10:57 +0100)
commitae68258f1968514678dbd2a31ffd6ea92b0f13ee
treee6e6734ff757c26e219ad6589b8dd4ec45e02fd6
parent80619590329b566f793405a7d5b7a8e78b07da6f
ada: Add minimal support for other delayed aspects on controlled objects

This extends the processing done for the Address aspect to other delayed
aspects.  The External_Name aspect is also reclassified as a representation
aspect and the three representation aspects External_Name, Link_Name and
Linker_Section are moved from the Always_Delay to the Rep_Aspect category,
which makes it possible not to delay them in most cases with a small tweak.

gcc/ada/ChangeLog:

* aspects.ads (Is_Representation_Aspect): True for External_Name.
(Aspect_Delay): Use Rep_Aspect for External_Name, Link_Name and
Linker_Section.
* einfo.ads (Initialization_Statements): Document extended usage.
* exp_util.adb (Needs_Initialization_Statements): Return True for
all delayed aspects.
* freeze.adb (Check_Address_Clause): Do not move the initialization
expression here...
(Freeze_Object_Declaration): ...but here instead, as well as for all
delayed aspects.  Remove test for pragma Linker_Section.
* sem_ch13.adb (Analyze_One_Aspect): Do not delay in the Rep_Aspect
case if the expression is a string literal.
gcc/ada/aspects.ads
gcc/ada/einfo.ads
gcc/ada/exp_util.adb
gcc/ada/freeze.adb
gcc/ada/sem_ch13.adb