diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-05-02 10:07:38 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-06-01 08:43:17 +0000 |
commit | af93b89d8a144f0008b22553ff59c0286a13ddd9 (patch) | |
tree | e3a590ca6e31a2880983d0057661d63830e1b083 /gcc/ada/sem_disp.adb | |
parent | eb1091dd34ee60aa96a513c09ef1d70f40a6a38f (diff) | |
download | gcc-af93b89d8a144f0008b22553ff59c0286a13ddd9.zip gcc-af93b89d8a144f0008b22553ff59c0286a13ddd9.tar.gz gcc-af93b89d8a144f0008b22553ff59c0286a13ddd9.tar.bz2 |
[Ada] Minor tweaks to dispatching support code
No functional changes.
gcc/ada/
* exp_disp.ads (Expand_Interface_Thunk): Change type of Prim.
* exp_disp.adb (Expand_Interface_Thunk): Declare Is_Predef_Op
earlier, do not initialize Iface_Formal, use No idiom and tweaks
comments.
(Register_Primitive): Declare L earlier and tweak comments.
* sem_disp.adb (Check_Dispatching_Operation): Move tests out of
loop.
Diffstat (limited to 'gcc/ada/sem_disp.adb')
-rw-r--r-- | gcc/ada/sem_disp.adb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index 3e75a47..79af10a 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -1728,7 +1728,11 @@ package body Sem_Disp is -- emitted after those tables are built, to prevent access before -- elaboration in gigi. - if Body_Is_Last_Primitive and then Expander_Active then + if Body_Is_Last_Primitive + and then not Building_Static_DT (Tagged_Type) + and then Expander_Active + and then Tagged_Type_Expansion + then declare Subp_Body : constant Node_Id := Unit_Declaration_Node (Subp); Elmt : Elmt_Id; @@ -1739,13 +1743,9 @@ package body Sem_Disp is while Present (Elmt) loop Prim := Node (Elmt); - -- No code required to register primitives in VM targets - if Present (Alias (Prim)) and then Present (Interface_Alias (Prim)) and then Alias (Prim) = Subp - and then not Building_Static_DT (Tagged_Type) - and then Tagged_Type_Expansion then Insert_Actions_After (Subp_Body, Register_Primitive (Sloc (Subp_Body), Prim => Prim)); |