aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap2.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-05-15 18:30:57 +0200
committerTristan Gingold <tgingold@free.fr>2017-05-18 07:59:35 +0200
commit6230ad4e5e9329e57d44066aba8c8d7711042fa3 (patch)
treefc76e9ac92a70e61e3aaaea1344c5be968203845 /src/vhdl/translate/trans-chap2.adb
parente717f1b8f84ae6a34f93af2e77daf98ac1a37555 (diff)
downloadghdl-6230ad4e5e9329e57d44066aba8c8d7711042fa3.tar.gz
ghdl-6230ad4e5e9329e57d44066aba8c8d7711042fa3.tar.bz2
ghdl-6230ad4e5e9329e57d44066aba8c8d7711042fa3.zip
Handle instantiation of protected types.
Diffstat (limited to 'src/vhdl/translate/trans-chap2.adb')
-rw-r--r--src/vhdl/translate/trans-chap2.adb38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb
index d24700f3e..fef4957ac 100644
--- a/src/vhdl/translate/trans-chap2.adb
+++ b/src/vhdl/translate/trans-chap2.adb
@@ -1121,6 +1121,32 @@ package body Trans.Chap2 is
end case;
end Instantiate_Iir_List_Info;
+ -- B must be passed by reference.
+ procedure Adjust_Info_Basetype (B : access Ortho_Info_Basetype_Type;
+ Orig : access Ortho_Info_Basetype_Type) is
+ begin
+ case B.Kind is
+ when Kind_Type_Scalar =>
+ null;
+ when Kind_Type_Array
+ | Kind_Type_Record =>
+ null;
+ when Kind_Type_File =>
+ null;
+ when Kind_Type_Protected =>
+ B.Prot_Scope := Instantiate_Var_Scope (B.Prot_Scope);
+ Push_Instantiate_Var_Scope
+ (B.Prot_Scope'Unrestricted_access,
+ Orig.Prot_Scope'Unrestricted_access);
+ B.Prot_Prev_Scope := Instantiated_Var_Scope
+ (B.Prot_Prev_Scope);
+ B.Prot_Init_Instance := Instantiate_Subprg_Instance
+ (B.Prot_Init_Instance);
+ B.Prot_Final_Instance := Instantiate_Subprg_Instance
+ (B.Prot_Final_Instance);
+ end case;
+ end Adjust_Info_Basetype;
+
function Copy_Info_Subtype (Src : Ortho_Info_Subtype_Type)
return Ortho_Info_Subtype_Type
is
@@ -1155,6 +1181,8 @@ package body Trans.Chap2 is
B => Src.B,
S => Copy_Info_Subtype (Src.S),
Type_Rti => Src.Type_Rti);
+ Adjust_Info_Basetype (Dest.B'Unrestricted_Access,
+ Src.B'Unrestricted_Access);
if Src.C /= null then
Dest.C := new Complex_Type_Arr_Info'
(Mode_Value =>
@@ -1311,6 +1339,8 @@ package body Trans.Chap2 is
Push_Instantiate_Var_Scope
(Info.Subprg_Frame_Scope'Access,
Orig_Info.Subprg_Frame_Scope'Access);
+ when Kind_Type =>
+ null;
when others =>
null;
end case;
@@ -1393,6 +1423,14 @@ package body Trans.Chap2 is
when Kind_Subprg =>
Pop_Instantiate_Var_Scope
(Info.Subprg_Frame_Scope'Access);
+ when Kind_Type =>
+ case Info.B.Kind is
+ when Kind_Type_Protected =>
+ Pop_Instantiate_Var_Scope
+ (Info.B.Prot_Scope'Unrestricted_access);
+ when others =>
+ null;
+ end case;
when others =>
null;
end case;