aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/cstreams.c
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2022-03-03 14:35:31 -0800
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-16 08:42:03 +0000
commit7c88e46a270212180767fc585dd190b7713702db (patch)
tree8c8df550b477a71d7cbf40e3e36cef252824bcc9 /gcc/ada/cstreams.c
parent909ce3528c800676fbbebe1f9a0047d14378861e (diff)
downloadgcc-7c88e46a270212180767fc585dd190b7713702db.zip
gcc-7c88e46a270212180767fc585dd190b7713702db.tar.gz
gcc-7c88e46a270212180767fc585dd190b7713702db.tar.bz2
[Ada] Implement component finalization ordering rules for type extensions
Finalization of a record object is required to finalize any components that have an access discriminant constrained by a per-object expression before other components. This includes the case of a type extension; "early finalization" components of the parent type are required to be finalized before non-early-finalization extension components. This is implemented in the extension type's finalization procedure by placing the call to the parent type's finalization procedure between the finalization of the "early finalization" extension components and the finalization of the other extension components. Previously that call was executed after finalizing all of the extension conponents. gcc/ada/ * exp_ch7.adb (Build_Finalize_Statements): Add Last_POC_Call variable to keep track of the last "early finalization" call generated for type extension's finalization procedure. If non-empty, then this will indicate the point at which to insert the call to the parent type's finalization procedure. Modify nested function Process_Component_List_For_Finalize to set this variable (and avoid setting it during a recursive call). If Last_POC_Call is empty, then insert the parent finalization call before, rather than after, the finalization code for the extension components.
Diffstat (limited to 'gcc/ada/cstreams.c')
0 files changed, 0 insertions, 0 deletions