aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch10.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch10.adb')
-rw-r--r--gcc/ada/sem_ch10.adb17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 5976b4d..9b9a9f1 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -31,6 +31,7 @@ with Einfo; use Einfo;
with Einfo.Entities; use Einfo.Entities;
with Einfo.Utils; use Einfo.Utils;
with Errout; use Errout;
+with Exp_Disp; use Exp_Disp;
with Exp_Put_Image;
with Exp_Util; use Exp_Util;
with Elists; use Elists;
@@ -1000,6 +1001,22 @@ package body Sem_Ch10 is
end if;
end if;
+ -- Build dispatch tables of library-level tagged types only now because
+ -- the generation of distribution stubs above may create some of them.
+
+ if Expander_Active and then Tagged_Type_Expansion then
+ case Nkind (Unit_Node) is
+ when N_Package_Declaration | N_Package_Body =>
+ Build_Static_Dispatch_Tables (Unit_Node);
+
+ when N_Package_Instantiation =>
+ Build_Static_Dispatch_Tables (Instance_Spec (Unit_Node));
+
+ when others =>
+ null;
+ end case;
+ end if;
+
-- Remove unit from visibility, so that environment is clean for the
-- next compilation, which is either the main unit or some other unit
-- in the context.