diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/sem_inst.adb | 6 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap2.adb | 28 |
2 files changed, 33 insertions, 1 deletions
diff --git a/src/vhdl/sem_inst.adb b/src/vhdl/sem_inst.adb index 819894fc6..a746822ff 100644 --- a/src/vhdl/sem_inst.adb +++ b/src/vhdl/sem_inst.adb @@ -513,6 +513,12 @@ package body Sem_Inst is Set_Protected_Type_Body (Get_Protected_Type_Declaration (Res), Res); + when Field_Package_Body => + null; + when Field_Package => + Instantiate_Iir_Field (Res, N, F); + Set_Package_Body (Get_Package (Res), Res); + when Field_Subtype_Definition => -- TODO null; diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb index 4b9d1b560..8b73c0e39 100644 --- a/src/vhdl/translate/trans-chap2.adb +++ b/src/vhdl/translate/trans-chap2.adb @@ -807,7 +807,8 @@ package body Trans.Chap2 is Info.Package_Body_Scope'Access); end if; - -- Each subprogram has a body instance argument. + -- Each subprogram has a body instance argument (because subprogram + -- bodys can access to body declarations). Subprgs.Push_Subprg_Instance (Info.Package_Body_Scope'Access, Info.Package_Body_Ptr_Type, Wki_Instance, Prev_Subprg_Instance); @@ -1239,6 +1240,31 @@ package body Trans.Chap2 is Package_Instance_Spec_Scope => Src.Package_Instance_Spec_Scope, Package_Instance_Body_Scope => Src.Package_Instance_Body_Scope); + when Kind_Field => + Dest.all := (Kind => Kind_Field, + Field_Node => Src.Field_Node, + Field_Bound => Src.Field_Bound); + + when Kind_Package => + Dest.all := + (Kind => Kind_Package, + Package_Elab_Spec_Subprg => Src.Package_Elab_Spec_Subprg, + Package_Elab_Body_Subprg => Src.Package_Elab_Body_Subprg, + Package_Elab_Spec_Instance => + Instantiate_Subprg_Instance (Src.Package_Elab_Spec_Instance), + Package_Elab_Body_Instance => + Instantiate_Subprg_Instance (Src.Package_Elab_Body_Instance), + Package_Elab_Var => Instantiate_Var (Src.Package_Elab_Var), + Package_Rti_Const => Src.Package_Rti_Const, + Package_Spec_Scope => + Instantiate_Var_Scope (Src.Package_Spec_Scope), + Package_Spec_Ptr_Type => Src.Package_Spec_Ptr_Type, + Package_Body_Scope => + Instantiate_Var_Scope (Src.Package_Body_Scope), + Package_Body_Ptr_Type => Src.Package_Body_Ptr_Type, + Package_Spec_Field => Src.Package_Spec_Field, + Package_Local_Id => Src.Package_Local_Id); + when others => raise Internal_Error; end case; |