diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-12-12 05:24:29 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-12-12 05:24:29 +0100 |
commit | 650e68b382f5a3c9404b74c7f39a4b769a46350a (patch) | |
tree | 5e07ebc00124279c3afceef952ab2475912e53d2 | |
parent | 61a92020340fb46d0f68c314d3907b6ef74a3e3a (diff) | |
download | ghdl-650e68b382f5a3c9404b74c7f39a4b769a46350a.tar.gz ghdl-650e68b382f5a3c9404b74c7f39a4b769a46350a.tar.bz2 ghdl-650e68b382f5a3c9404b74c7f39a4b769a46350a.zip |
Instantiate declarations of interface packages.
Fix #476
-rw-r--r-- | src/vhdl/sem_inst.adb | 5 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap2.adb | 20 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/vhdl/sem_inst.adb b/src/vhdl/sem_inst.adb index 9599da8d2..441d4cd58 100644 --- a/src/vhdl/sem_inst.adb +++ b/src/vhdl/sem_inst.adb @@ -617,6 +617,11 @@ package body Sem_Inst is when Iir_Kind_Interface_Package_Declaration => Set_Uninstantiated_Package_Decl (Res, Get_Uninstantiated_Package_Decl (Inter)); + Set_Generic_Chain + (Res, + Instantiate_Generic_Chain (Res, Get_Generic_Chain (Inter))); + Set_Declaration_Chain + (Res, Instantiate_Iir_Chain (Get_Declaration_Chain (Inter))); when Iir_Kind_Interface_Type_Declaration => Set_Type (Res, Get_Type (Inter)); when Iir_Kinds_Interface_Subprogram_Declaration => diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb index 41913c452..4afe598c9 100644 --- a/src/vhdl/translate/trans-chap2.adb +++ b/src/vhdl/translate/trans-chap2.adb @@ -1502,20 +1502,26 @@ package body Trans.Chap2 is begin Inter := Chain; while Inter /= Null_Iir loop + Orig := Sem_Inst.Get_Origin (Inter); + Orig_Info := Get_Info (Orig); + + Info := Add_Info (Inter, Orig_Info.Kind); + Copy_Info (Info, Orig_Info); + case Get_Kind (Inter) is - when Iir_Kind_Interface_Constant_Declaration - | Iir_Kind_Interface_Package_Declaration => - Orig := Sem_Inst.Get_Origin (Inter); - Orig_Info := Get_Info (Orig); + when Iir_Kind_Interface_Constant_Declaration => + null; - Info := Add_Info (Inter, Orig_Info.Kind); - Copy_Info (Info, Orig_Info); - Clean_Copy_Info (Info); + when Iir_Kind_Interface_Package_Declaration => + Instantiate_Iir_Generic_Chain_Info (Get_Generic_Chain (Inter)); + Instantiate_Iir_Chain_Info (Get_Declaration_Chain (Inter)); when others => raise Internal_Error; end case; + Clean_Copy_Info (Info); + Inter := Get_Chain (Inter); end loop; end Instantiate_Iir_Generic_Chain_Info; |