[Ada] Do not freeze profiles for dispatch tables
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 20 Apr 2022 07:54:49 +0000 (09:54 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 30 May 2022 08:29:01 +0000 (08:29 +0000)
commit3e93d2926aeefcffc978005b7964481f351dd494
treecf09f68a5f04e970fda67498d91162d1c3aa09e6
parent1ea22318caf52a98b32f8ef4e155376e7751db4b
[Ada] Do not freeze profiles for dispatch tables

When static dispatch tables are built for library-level tagged types, the
primitives (the subprogram themselves) are frozen; that's necessary because
their address is taken.  However, their profile, i.e. all the types present
therein, is also frozen, which is not necessary after AI05-019 and is also
inconsistent with the handling of attribute references.

The change also removes a couple of pragma Inline on subprograms that are
too large for inlining to bring any benefit.

gcc/ada/

* exp_ch3.adb (Expand_N_Object_Declaration): Adjust call to Make_DT.
* exp_disp.ads (Building_Static_DT): Remove pragma Inline.
(Building_Static_Secondary_DT): Likewise.
(Convert_Tag_To_Interface): Likewise.
(Make_DT): Remove second parameter.
* exp_disp.adb (Make_DT): Likewise.
(Check_Premature_Freezing): Delete.
Pass Do_Freeze_Profile as False in call to Freeze_Entity.
* freeze.ads (Freezing_Library_Level_Tagged_Type): Delete.
* freeze.adb (Freeze_Profile): Remove obsolete code.
(Freeze_Entity): Tweak comment.
gcc/ada/exp_ch3.adb
gcc/ada/exp_disp.adb
gcc/ada/exp_disp.ads
gcc/ada/freeze.adb
gcc/ada/freeze.ads