aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/styleg.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-01-23 13:06:26 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-16 10:30:57 +0200
commitca4bff3a3d0bdf88163b24d91a372745056f3ac1 (patch)
tree1f001fc3df08c283f83e868ff64ca98e703c200e /gcc/ada/styleg.adb
parentc637076413ad0dc3b9c0018c25df2f2a56b77f67 (diff)
downloadgcc-ca4bff3a3d0bdf88163b24d91a372745056f3ac1.zip
gcc-ca4bff3a3d0bdf88163b24d91a372745056f3ac1.tar.gz
gcc-ca4bff3a3d0bdf88163b24d91a372745056f3ac1.tar.bz2
ada: Adjust semantics and implementation of storage models
This makes the following adjustments to the semantics and implementation of storage models in the compiler: 1. By-copy semantics in subprogram calls: when an object accessed with a nonnative storage model is passed as an actual parameter in a call to a subprogram, an intermediate copy made on the host is passed instead. 2. More generally, any additional temporary required on the host by the semantics of nonnative storage models is now created by the front-end instead of the code generator. 3. All the temporaries created on the host for nonnative storage models are allocated on the secondary stack instead of the primary stack. As a result, this should simplify the implementation in code generators. gcc/ada/ * exp_aggr.adb (Build_Assignment_With_Temporary): Adjust comment and fix type of second parameter. Create the temporary on the secondary stack by calling Build_Temporary_On_Secondary_Stack. (Convert_Array_Aggr_In_Allocator): Adjust formatting. (Expand_Array_Aggregate): Likewise. * exp_ch4.adb (Expand_N_Allocator): Set Actual_Designated_Subtype on the dereference in the initialization for all composite types. * exp_ch5.adb (Expand_N_Assignment_Statement): Create a temporary on the host for an assignment between nonnative storage models. Suppress more checks when Suppress_Assignment_Checks is set. * exp_ch6.adb (Add_Simple_Call_By_Copy_Code): Deal with actuals that are dereferences with an Actual_Designated_Subtype. Add support for nonnative storage models. (Expand_Actuals): Create a copy if the actual is a dereference with a nonnative storage model. * exp_util.ads (Build_Temporary_On_Secondary_Stack): Declare. * exp_util.adb (Build_Temporary_On_Secondary_Stack): New function. * sem_ch5.adb (Analyze_Assignment.Set_Assignment_Type): Do not build an actual subtype for dereferences with an Actual_Designated_Subtype * sinfo.ads (Actual_Designated_Subtype): Adjust documentation. (Suppress_Assignment_Checks): Likewise.
Diffstat (limited to 'gcc/ada/styleg.adb')
0 files changed, 0 insertions, 0 deletions