aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnat_ugn.texi
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-05-15 23:56:44 +0200
committerMarc Poulhiès <poulhies@adacore.com>2024-06-20 10:50:53 +0200
commit4f6ee98c27cf0219779a2ccd6ef5d0e67b75580f (patch)
tree3f9c0e28de77fa11b25b83d05b109b8ae1c65fb4 /gcc/ada/gnat_ugn.texi
parent09ed91df30102e17ac5c59bab314b8b37606c710 (diff)
downloadgcc-4f6ee98c27cf0219779a2ccd6ef5d0e67b75580f.zip
gcc-4f6ee98c27cf0219779a2ccd6ef5d0e67b75580f.tar.gz
gcc-4f6ee98c27cf0219779a2ccd6ef5d0e67b75580f.tar.bz2
ada: Streamline propagation of controlled flags on types
The front-end maintains a set of 4 flags on (base) types that are used to parameterize the implementation of controlled operations, and these flags need to be propagated through composition and derivation. This is done on a per-flag basis in the current implementation with a few loopholes. This introduces a Propagate_Controlled_Flags routine to that effect, which is modeled on the existing Propagate_Concurrent_Flags routine, and is used in most cases to do the propagation. This also removes the handling of the Finalize_Storage_Only flag from Inherit_Aspects_At_Freeze_Point, since the associated aspect does not exist (only the pragma does). gcc/ada/ * freeze.adb (Freeze_Array_Type): Call Propagate_Controlled_Flags to propagate the controlled flags from the component to the array. (Freeze_Record_Type): Propagate the Finalize_Storage_Only flag from the components to the record. * sem_ch3.adb (Analyze_Private_Extension_Declaration): Do not call Propagate_Concurrent_Flags here but... (Array_Type_Declaration): Tidy and call Propagate_Controlled_Flags to propagate the controlled flags from the component to the array. (Build_Derived_Private_Type): Do not propagate the controlled flags manually here but... (Build_Derived_Record_Type): ...call Propagate_Controlled_Flags to propagate the controlled flags from parent to derived type. (Build_Derived_Type): Likewise. (Copy_Array_Base_Type_Attributes): Call Propagate_Controlled_Flags to copy the controlled flags. (Record_Type_Definition): Streamline the propagation of the Finalize_Storage_Only flag from the components to the record. * sem_ch7.adb (Preserve_Full_Attributes): Use Full_Base and call Propagate_Controlled_Flags to copy the controlled flags. * sem_ch9.adb (Analyze_Protected_Definition): Use canonical idiom to compute Has_Controlled_Component. (Analyze_Protected_Type_Declaration): Minor tweak. * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): Do not deal with Finalize_Storage_Only here. * sem_util.ads (Propagate_Controlled_Flags): New declaration. * sem_util.adb (Propagate_Controlled_Flags): New procedure.
Diffstat (limited to 'gcc/ada/gnat_ugn.texi')
0 files changed, 0 insertions, 0 deletions