diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-05-26 11:06:01 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-07-04 07:45:55 +0000 |
commit | c901877facf9635149ed69cabd88c871f60931fe (patch) | |
tree | 507d544b31199e0fd649a8c297653e6120f02eae /gcc/ada/debug.adb | |
parent | eb6e8a7acd1b8ecf36489e01cafad61add528f23 (diff) | |
download | gcc-c901877facf9635149ed69cabd88c871f60931fe.zip gcc-c901877facf9635149ed69cabd88c871f60931fe.tar.gz gcc-c901877facf9635149ed69cabd88c871f60931fe.tar.bz2 |
[Ada] Call-initialize all controlled objects in place
This changes the compiler to build in place almost all objects that need
finalization and are initialized with the result of a function call, thus
saving a pair of Adjust/Finalize calls for the anonymous return object.
gcc/ada/
* exp_ch3.adb (Expand_N_Object_Declaration): Don't adjust the object
if the expression is a function call.
<Rewrite_As_Renaming>: Return true if the object needs finalization
and is initialized with the result of a function call returned on
the secondary stack.
* exp_ch6.adb (Expand_Ctrl_Function_Call): Add Use_Sec_Stack boolean
parameter. Early return if the parent is an object declaration and
Use_Sec_Stack is false.
(Expand_Call_Helper): Adjust call to Expand_Ctrl_Function_Call.
* exp_ch7.adb (Find_Last_Init): Be prepared for initialization still
present in the object declaration.
* sem_ch3.adb (Analyze_Object_Declaration): Call the predicates
Needs_Secondary_Stack and Needs_Finalization to guard the renaming
optimization.
Diffstat (limited to 'gcc/ada/debug.adb')
0 files changed, 0 insertions, 0 deletions