diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 28 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap3.ads | 2 |
2 files changed, 8 insertions, 22 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 75304d669..4ca1f8d5a 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -2403,8 +2403,7 @@ package body Trans.Chap3 is (Def : Iir; Parent_Type : Iir; With_Vars : Boolean := True) is Info : Ortho_Info_Acc; - Base_Info : Type_Info_Acc; - Base_Type : Iir; + Parent_Info : Type_Info_Acc; Complete_Info : Incomplete_Type_Info_Acc; begin -- If the definition is already translated, return now. @@ -2427,9 +2426,6 @@ package body Trans.Chap3 is Info := Add_Info (Def, Kind_Type); - Base_Type := Get_Base_Type (Def); - Base_Info := Get_Info (Base_Type); - case Get_Kind (Def) is when Iir_Kinds_Scalar_Subtype_Definition => Create_Subtype_Info_From_Type (Def, Parent_Type, Info); @@ -2452,23 +2448,11 @@ package body Trans.Chap3 is end if; end; - if Base_Info = null or else Base_Info.Type_Incomplete then - -- This subtype also declare the base type. Create it. - declare - Mark : Id_Mark_Type; - begin - Push_Identifier_Prefix (Mark, "BT"); - Translate_Type_Definition (Base_Type); - Pop_Identifier_Prefix (Mark); - Base_Info := Get_Info (Base_Type); - end; - raise Internal_Error; - end if; - + Parent_Info := Get_Info (Parent_Type); if Get_Constraint_State (Def) = Fully_Constrained then Translate_Array_Subtype_Definition (Def); - Info.B := Base_Info.B; - Info.S := Base_Info.S; + Info.B := Parent_Info.B; + Info.S := Parent_Info.S; if With_Vars then Create_Composite_Subtype_Bounds_Var (Def, False); end if; @@ -2476,7 +2460,7 @@ package body Trans.Chap3 is -- An unconstrained array subtype. Use same infos as base -- type. Free_Info (Def); - Set_Info (Def, Base_Info); + Set_Info (Def, Parent_Info); end if; when Iir_Kind_Record_Subtype_Definition => @@ -2485,7 +2469,7 @@ package body Trans.Chap3 is when Iir_Kind_Access_Subtype_Definition => -- Like the access type. Free_Info (Def); - Set_Info (Def, Base_Info); + Set_Info (Def, Get_Info (Parent_Type)); when others => Error_Kind ("translate_subtype_definition", Def); diff --git a/src/vhdl/translate/trans-chap3.ads b/src/vhdl/translate/trans-chap3.ads index 88a169f2a..2adeb629d 100644 --- a/src/vhdl/translate/trans-chap3.ads +++ b/src/vhdl/translate/trans-chap3.ads @@ -57,6 +57,8 @@ package Trans.Chap3 is procedure Translate_Protected_Type_Body_Subprograms_Spec (Bod : Iir); procedure Translate_Protected_Type_Body_Subprograms_Body (Bod : Iir); + -- DEF derives (using the Ada meaning) of PARENT_TYPE, ie DEF has new + -- constraints on PARENT_TYPE. procedure Translate_Subtype_Definition (Def : Iir; Parent_Type : Iir; With_Vars : Boolean := True); |