]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Refactoring related to Returns_By_Ref
authorBob Duff <duff@adacore.com>
Thu, 22 Apr 2021 18:07:34 +0000 (14:07 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 5 Jul 2021 13:09:08 +0000 (13:09 +0000)
commit8926c29c5f512203b6ed6e1e944738fc0a6f0c4c
tree6d5c57bcf19efc82644a8d2ae64ddb0f3463a413
parent767f9cb1f81bdeb55a7b5fbbccb3c057f37e2fae
[Ada] Refactoring related to Returns_By_Ref

gcc/ada/

* sem_util.ads, sem_util.adb (Compute_Returns_By_Ref): New
procedure to compute Returns_By_Ref, to avoid some code
duplication. This will likely change soon, so it's good to have
the code in one place.
(CW_Or_Has_Controlled_Part): Move here from Exp_Ch7, because
it's called by Compute_Returns_By_Ref, and this is a better
place for it anyway.
(Needs_Finalization): Fix comment to be vague instead of wrong.
* exp_ch6.adb (Expand_N_Subprogram_Body, Freeze_Subprogram):
Call Compute_Returns_By_Ref.
* sem_ch6.adb (Check_Delayed_Subprogram): Call
Compute_Returns_By_Ref.
* exp_ch7.ads, exp_ch7.adb (CW_Or_Has_Controlled_Part): Move to
Sem_Util.
(Has_New_Controlled_Component): Remove unused function.
gcc/ada/exp_ch6.adb
gcc/ada/exp_ch7.adb
gcc/ada/exp_ch7.ads
gcc/ada/sem_ch6.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads