ada: Factor out tag assignments from type in expander
commitaf10c962b79c17291250df314d2adb17f11e2355
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 19 Apr 2023 20:39:38 +0000 (19 22:39 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 13 Jun 2023 07:31:43 +0000 (13 09:31 +0200)
tree930bfdfdf38d4058959b2d6160ac165fd927010d
parentf02be8fc6e1d9679d507faa7fd72155addc69ab1
ada: Factor out tag assignments from type in expander

They are performed in a few different places during expansion.

gcc/ada/

* exp_util.ads (Make_Tag_Assignment_From_Type): Declare.
* exp_util.adb (Make_Tag_Assignment_From_Type): New function.
* exp_aggr.adb (Build_Record_Aggr_Code): Call the above function.
(Initialize_Simple_Component): Likewise.
* exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): Likewise.
(Build_Record_Init_Proc.Build_Init_Procedure ): Likewise.
(Make_Tag_Assignment): Likewise.  Rename local variable and call
Unqualify to go through qualified expressions.
* exp_ch4.adb (Expand_Allocator_Expression): Likewise.
gcc/ada/exp_aggr.adb
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch4.adb
gcc/ada/exp_util.adb
gcc/ada/exp_util.ads