diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-04-12 21:56:35 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-19 14:05:30 +0000 |
commit | 8be71a90b15916a966553c47857e1579ca22d507 (patch) | |
tree | ad3bac00daf7b04e370ceb3bcf73ea1ac1e28009 /gcc/ada/fe.h | |
parent | ca03325fb3a5fbf9c8af853d4c7f199e1adb08e3 (diff) | |
download | gcc-8be71a90b15916a966553c47857e1579ca22d507.zip gcc-8be71a90b15916a966553c47857e1579ca22d507.tar.gz gcc-8be71a90b15916a966553c47857e1579ca22d507.tar.bz2 |
[Ada] Avoid copy operation for returns involving function calls
The underlying issue is that the front-end does not create transient scopes
for return statements, so objects copied for these statements can never be
finalized properly.
gcc/ada/
* exp_ch6.adb (Expand_Call_Helper): Adjust comment.
(Expand_Simple_Function_Return): For the case of a type which needs
finalization and is returned on the primary stack, do not create a
copy if the expression originates from a function call.
* exp_ch7.adb (Transient Scope Management): Adjust comment.
* exp_util.ads (Is_Related_To_Func_Return): Add WARNING line.
* fe.h (Is_Related_To_Func_Return): Declare.
Diffstat (limited to 'gcc/ada/fe.h')
-rw-r--r-- | gcc/ada/fe.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h index 4be9d94..bfd9054 100644 --- a/gcc/ada/fe.h +++ b/gcc/ada/fe.h @@ -183,9 +183,11 @@ extern Boolean Is_Init_Proc (Entity_Id); /* exp_util: */ #define Is_Fully_Repped_Tagged_Type exp_util__is_fully_repped_tagged_type +#define Is_Related_To_Func_Return exp_util__is_related_to_func_return #define Find_Interface_Tag exp_util__find_interface_tag -extern Boolean Is_Fully_Repped_Tagged_Type (Entity_Id); +extern Boolean Is_Fully_Repped_Tagged_Type (Entity_Id); +extern Boolean Is_Related_To_Func_Return (Entity_Id); extern Entity_Id Find_Interface_Tag (Entity_Id, Entity_Id); /* lib: */ |