aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_util.ads
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-04-19 22:39:38 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-06-13 09:31:43 +0200
commitaf10c962b79c17291250df314d2adb17f11e2355 (patch)
tree930bfdfdf38d4058959b2d6160ac165fd927010d /gcc/ada/exp_util.ads
parentf02be8fc6e1d9679d507faa7fd72155addc69ab1 (diff)
downloadgcc-af10c962b79c17291250df314d2adb17f11e2355.zip
gcc-af10c962b79c17291250df314d2adb17f11e2355.tar.gz
gcc-af10c962b79c17291250df314d2adb17f11e2355.tar.bz2
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.
Diffstat (limited to 'gcc/ada/exp_util.ads')
-rw-r--r--gcc/ada/exp_util.ads7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads
index eef6800..06bd414 100644
--- a/gcc/ada/exp_util.ads
+++ b/gcc/ada/exp_util.ads
@@ -925,6 +925,13 @@ package Exp_Util is
-- wide type. Set Related_Id to request an external name for the subtype
-- rather than an internal temporary.
+ function Make_Tag_Assignment_From_Type
+ (Loc : Source_Ptr;
+ Target : Node_Id;
+ Typ : Entity_Id) return Node_Id;
+ -- Return an assignment of the tag of tagged type Typ to prefix Target,
+ -- which must be a record object of a descendant of Typ.
+
function Make_Variant_Comparison
(Loc : Source_Ptr;
Typ : Entity_Id;