From abdad7105d2f54e22b696a2e75058f4c634ef4a2 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 2 Jan 2017 05:00:00 +0100 Subject: translate: rename get_array_base to get_composite_base --- src/vhdl/translate/trans-chap3.adb | 18 +++--- src/vhdl/translate/trans-chap3.ads | 4 +- src/vhdl/translate/trans-chap4.adb | 22 +++---- src/vhdl/translate/trans-chap5.adb | 6 +- src/vhdl/translate/trans-chap6.adb | 8 +-- src/vhdl/translate/trans-chap7.adb | 70 +++++++++++----------- src/vhdl/translate/trans-chap8.adb | 10 ++-- src/vhdl/translate/trans-chap9.adb | 4 +- src/vhdl/translate/trans-foreach_non_composite.adb | 2 +- src/vhdl/translate/trans-helpers2.adb | 6 +- 10 files changed, 76 insertions(+), 74 deletions(-) (limited to 'src/vhdl') diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index ba82f67fe..878d1d13c 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -155,7 +155,7 @@ package body Trans.Chap3 is when Type_Mode_Fat_Array => -- Note: a fat array can only be at the top of a complex type; -- the bounds must have been set. - New_Association (Assoc, M2Addr (Chap3.Get_Array_Base (Var))); + New_Association (Assoc, M2Addr (Chap3.Get_Composite_Base (Var))); when others => raise Internal_Error; end case; @@ -2423,12 +2423,13 @@ package body Trans.Chap3 is end if; end Get_Array_Length; - function Get_Array_Base (Arr : Mnode) return Mnode + function Get_Composite_Base (Arr : Mnode) return Mnode is Info : constant Type_Info_Acc := Get_Type_Info (Arr); begin case Info.Type_Mode is - when Type_Mode_Fat_Array => + when Type_Mode_Unbounded_Array + | Type_Mode_Unbounded_Record => declare Kind : constant Object_Kind_Type := Get_Object_Kind (Arr); begin @@ -2440,12 +2441,13 @@ package body Trans.Chap3 is Info.B.Base_Type (Kind), Info.B.Base_Ptr_Type (Kind)); end; - when Type_Mode_Array => + when Type_Mode_Array + | Type_Mode_Record => return Arr; when others => raise Internal_Error; end case; - end Get_Array_Base; + end Get_Composite_Base; function Get_Bounds_Acc_Base (Acc : O_Enode; D_Type : Iir) return O_Enode @@ -2541,7 +2543,7 @@ package body Trans.Chap3 is Length := Get_Object_Size (Res, Arr_Type); -- Allocate the storage for the elements. New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Res)), + (M2Lp (Chap3.Get_Composite_Base (Res)), Gen_Alloc (Alloc_Kind, Length, Dinfo.B.Base_Ptr_Type (Kind))); Maybe_Call_Type_Builder (Res, Arr_Type); @@ -2582,8 +2584,8 @@ package body Trans.Chap3 is when Type_Mode_Unbounded_Array => -- a fat array. D := Stabilize (Dest); - Gen_Memcpy (M2Addr (Get_Array_Base (D)), - M2Addr (Get_Array_Base (E2M (Src, Info, Kind))), + Gen_Memcpy (M2Addr (Get_Composite_Base (D)), + M2Addr (Get_Composite_Base (E2M (Src, Info, Kind))), Get_Object_Size (D, Obj_Type)); when Type_Mode_Unbounded_Record => -- TODO diff --git a/src/vhdl/translate/trans-chap3.ads b/src/vhdl/translate/trans-chap3.ads index a4b8ddd7d..ba3db7adc 100644 --- a/src/vhdl/translate/trans-chap3.ads +++ b/src/vhdl/translate/trans-chap3.ads @@ -139,8 +139,8 @@ package Trans.Chap3 is -- Get the number of elements in array ATYPE. function Get_Array_Type_Length (Atype : Iir) return O_Enode; - -- Get the base of array ARR. - function Get_Array_Base (Arr : Mnode) return Mnode; + -- Get the base of array or record ARR. + function Get_Composite_Base (Arr : Mnode) return Mnode; -- Get the bounds of array ARR. function Get_Array_Bounds (Arr : Mnode) return Mnode; diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb index 6bcc41eb8..3a1cad573 100644 --- a/src/vhdl/translate/trans-chap4.adb +++ b/src/vhdl/translate/trans-chap4.adb @@ -376,7 +376,7 @@ package body Trans.Chap4 is New_Compare_Op (ON_Eq, New_Obj_Value (Index), Upper_Limit, Ghdl_Bool_Type)); - Init_Object (Chap3.Index_Base (Chap3.Get_Array_Base (Sobj), + Init_Object (Chap3.Index_Base (Chap3.Get_Composite_Base (Sobj), Obj_Type, New_Obj_Value (Index)), Get_Element_Subtype (Obj_Type)); @@ -634,7 +634,7 @@ package body Trans.Chap4 is Chap3.Gen_Deallocate (New_Value (M2Lp (Chap3.Get_Array_Bounds (V)))); Chap3.Gen_Deallocate - (New_Value (M2Lp (Chap3.Get_Array_Base (V)))); + (New_Value (M2Lp (Chap3.Get_Composite_Base (V)))); Close_Temp; end; elsif Is_Complex_Type (Type_Info) then @@ -675,7 +675,7 @@ package body Trans.Chap4 is New_Obj_Value (Len), Get_Nbr_Signals (Chap3.Index_Base - (Chap3.Get_Array_Base (Ssig), Sig_Type, + (Chap3.Get_Composite_Base (Ssig), Sig_Type, New_Lit (Ghdl_Index_0)), Get_Element_Subtype (Sig_Type)))); Finish_If_Stmt (If_Blk); @@ -741,7 +741,7 @@ package body Trans.Chap4 is return Res; when Type_Mode_Arrays => Res := Chap3.Index_Base - (Chap3.Get_Array_Base (Res), Res_Type, + (Chap3.Get_Composite_Base (Res), Res_Type, New_Lit (Ghdl_Index_0)); Res_Type := Get_Element_Subtype (Res_Type); when Type_Mode_Records => @@ -926,9 +926,9 @@ package body Trans.Chap4 is Res.Init_Val := Stabilize (Data.Init_Val); end if; when Type_Mode_Arrays => - Res.Value := Chap3.Get_Array_Base (Data.Value); + Res.Value := Chap3.Get_Composite_Base (Data.Value); if Data.Has_Val then - Res.Init_Val := Chap3.Get_Array_Base (Data.Init_Val); + Res.Init_Val := Chap3.Get_Composite_Base (Data.Init_Val); end if; when others => raise Internal_Error; @@ -1273,8 +1273,8 @@ package body Trans.Chap4 is Res.Targ_Val := Stabilize (Data.Targ_Val); Res.Pfx := Stabilize (Data.Pfx); else - Res.Targ_Val := Chap3.Get_Array_Base (Data.Targ_Val); - Res.Pfx := Chap3.Get_Array_Base (Data.Pfx); + Res.Targ_Val := Chap3.Get_Composite_Base (Data.Targ_Val); + Res.Pfx := Chap3.Get_Composite_Base (Data.Pfx); end if; return Res; end Create_Delayed_Signal_Prepare_Composite; @@ -1583,7 +1583,7 @@ package body Trans.Chap4 is when Type_Mode_Array => Stabilize (N); New_Assign_Stmt (Get_Var (A), - M2E (Chap3.Get_Array_Base (N))); + M2E (Chap3.Get_Composite_Base (N))); Chap3.Check_Array_Match (Decl_Type, T2M (Decl_Type, Mode), Name_Type, N, Decl); when Type_Mode_Acc @@ -2049,7 +2049,7 @@ package body Trans.Chap4 is Ghdl_Bool_Type)); -- fill array[i] V := Chap3.Index_Base - (Chap3.Get_Array_Base (Dv2M (Var_Array, Base_Info, Mode_Value)), + (Chap3.Get_Composite_Base (Dv2M (Var_Array, Base_Info, Mode_Value)), Base_Type, New_Obj_Value (Var_I)); Data := Read_Source_Data'(Vals, Var_I, Read_Port); Read_Signal_Source (V, El_Type, Data); @@ -2085,7 +2085,7 @@ package body Trans.Chap4 is New_Obj_Value (Var_J)))); V := Chap3.Index_Base - (Chap3.Get_Array_Base (Dv2M (Var_Array, Base_Info, Mode_Value)), + (Chap3.Get_Composite_Base (Dv2M (Var_Array, Base_Info, Mode_Value)), Base_Type, New_Obj_Value (Var_I)); Data := Read_Source_Data'(Vals, Var_J, Read_Driver); Read_Signal_Source (V, El_Type, Data); diff --git a/src/vhdl/translate/trans-chap5.adb b/src/vhdl/translate/trans-chap5.adb index eee9c24b2..b0e01dd54 100644 --- a/src/vhdl/translate/trans-chap5.adb +++ b/src/vhdl/translate/trans-chap5.adb @@ -326,7 +326,7 @@ package body Trans.Chap5 is begin -- FIXME: should check matching elements! Res := (Actual_Sig => - Chap3.Index_Base (Chap3.Get_Array_Base (Data.Actual_Sig), + Chap3.Index_Base (Chap3.Get_Composite_Base (Data.Actual_Sig), Data.Actual_Type, New_Obj_Value (Index)), Actual_Type => Get_Element_Subtype (Data.Actual_Type), Mode => Data.Mode, @@ -435,8 +435,8 @@ package body Trans.Chap5 is -- Copy pointer to the values. if Get_Info (Formal_Type).Type_Mode in Type_Mode_Arrays then New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Formal_Val)), - M2Addr (Chap3.Get_Array_Base (Actual_Val))); + (M2Lp (Chap3.Get_Composite_Base (Formal_Val)), + M2Addr (Chap3.Get_Composite_Base (Actual_Val))); else New_Assign_Stmt (M2Lp (Formal_Val), M2Addr (Actual_Val)); end if; diff --git a/src/vhdl/translate/trans-chap6.adb b/src/vhdl/translate/trans-chap6.adb index da87fd88b..caa3c025d 100644 --- a/src/vhdl/translate/trans-chap6.adb +++ b/src/vhdl/translate/trans-chap6.adb @@ -432,7 +432,7 @@ package body Trans.Chap6 is return (Offset => Offset, Res => Chap3.Index_Base - (Chap3.Get_Array_Base (Prefix), Prefix_Type, + (Chap3.Get_Composite_Base (Prefix), Prefix_Type, New_Obj_Value (Offset))); end Translate_Indexed_Name_Init; @@ -441,7 +441,7 @@ package body Trans.Chap6 is return Mnode is begin - return Chap3.Index_Base (Chap3.Get_Array_Base (Prefix), + return Chap3.Index_Base (Chap3.Get_Composite_Base (Prefix), Get_Type (Get_Prefix (Expr)), New_Obj_Value (Data.Offset)); end Translate_Indexed_Name_Finish; @@ -713,13 +713,13 @@ package body Trans.Chap6 is (New_Selected_Element (New_Obj (Res_D), Slice_Info.B.Base_Field (Kind)), M2E (Chap3.Slice_Base - (Chap3.Get_Array_Base (Prefix), + (Chap3.Get_Composite_Base (Prefix), Slice_Type, New_Obj_Value (Data.Unsigned_Diff)))); return Dv2M (Res_D, Slice_Info, Kind); when Type_Mode_Array => return Chap3.Slice_Base - (Chap3.Get_Array_Base (Prefix), + (Chap3.Get_Composite_Base (Prefix), Slice_Type, New_Obj_Value (Data.Unsigned_Diff)); when others => diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index 9e7e6ec75..4ad38dfc2 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -759,8 +759,8 @@ package body Trans.Chap7 is Res := Create_Temp (Type_Info, Kind); Stable_Expr := Stabilize (Expr); New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Res)), - New_Convert_Ov (M2Addr (Chap3.Get_Array_Base (Stable_Expr)), + (M2Lp (Chap3.Get_Composite_Base (Res)), + New_Convert_Ov (M2Addr (Chap3.Get_Composite_Base (Stable_Expr)), Type_Info.B.Base_Ptr_Type (Kind))); New_Assign_Stmt (M2Lp (Chap3.Get_Array_Bounds (Res)), @@ -799,7 +799,7 @@ package body Trans.Chap7 is Finish_Loop_Stmt (Success_Label); Close_Temp; - return Chap3.Get_Array_Base (Expr_Stable); + return Chap3.Get_Composite_Base (Expr_Stable); end Convert_Array_To_Thin_Array; function Translate_Implicit_Array_Conversion @@ -1302,7 +1302,7 @@ package body Trans.Chap7 is (M2Lp (Chap3.Get_Array_Bounds (Var_Sub_Arr)), M2Addr (Chap3.Get_Array_Bounds (M))); New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Var_Sub_Arr)), + (M2Lp (Chap3.Get_Composite_Base (Var_Sub_Arr)), M2Addr (Chap3.Slice_Base (Var_Arr, Expr_Type, New_Obj_Value (Var_Off)))); @@ -1577,7 +1577,7 @@ package body Trans.Chap7 is Chap3.Get_Object_Size (Res, Expr_Type), Info.B.Base_Ptr_Type (Mode_Value))); New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Res)), M2Addr (Var_Arr)); + (M2Lp (Chap3.Get_Composite_Base (Res)), M2Addr (Var_Arr)); -- Assign expressions Open_Temp; @@ -1667,7 +1667,7 @@ package body Trans.Chap7 is Dec_Var (Len); New_Assign_Stmt (New_Obj (El), - M2E (Chap3.Index_Base (Chap3.Get_Array_Base (Arr), + M2E (Chap3.Index_Base (Chap3.Get_Composite_Base (Arr), Left_Type, New_Obj_Value (Len)))); Start_If_Stmt (If_Blk, New_Compare_Op (Op, New_Obj_Value (El), @@ -1735,7 +1735,7 @@ package body Trans.Chap7 is Arr := Stabilize (E2M (Val, Get_Info (Val_Type), Mode_Value)); return Translate_To_String (Subprg, Res_Type, Loc, - M2E (Chap3.Get_Array_Base (Arr)), + M2E (Chap3.Get_Composite_Base (Arr)), M2E (Chap3.Range_To_Length (Chap3.Get_Array_Range (Arr, Val_Type, 1)))); end Translate_Bv_To_String; @@ -1820,13 +1820,13 @@ package body Trans.Chap7 is Translate_Predefined_Logical (Op, New_Obj_Value (El), - M2E (Chap3.Index_Base (Chap3.Get_Array_Base (Arr), + M2E (Chap3.Index_Base (Chap3.Get_Composite_Base (Arr), Arr_Type, New_Obj_Value (Len))))); Finish_Loop_Stmt (Label); Close_Temp; Res := Create_Temp (Res_Info, Mode_Value); - New_Assign_Stmt (M2Lp (Chap3.Get_Array_Base (Res)), + New_Assign_Stmt (M2Lp (Chap3.Get_Composite_Base (Res)), New_Obj_Value (Base)); New_Assign_Stmt (M2Lp (Chap3.Get_Array_Bounds (Res)), M2Addr (Chap3.Get_Array_Bounds (Arr))); @@ -1887,7 +1887,7 @@ package body Trans.Chap7 is New_Dyadic_Op (Op, New_Obj_Value (Res), - M2E (Chap3.Index_Base (Chap3.Get_Array_Base (Arr), + M2E (Chap3.Index_Base (Chap3.Get_Composite_Base (Arr), Arr_Type, New_Obj_Value (Len))))); Finish_Loop_Stmt (Label); Close_Temp; @@ -1989,14 +1989,14 @@ package body Trans.Chap7 is Start_Association (Assoc, Subprg); New_Association (Assoc, - New_Convert_Ov (M2E (Chap3.Get_Array_Base (L)), Ghdl_Ptr_Type)); + New_Convert_Ov (M2E (Chap3.Get_Composite_Base (L)), Ghdl_Ptr_Type)); New_Association (Assoc, M2E (Chap3.Range_To_Length (Chap3.Get_Array_Range (L, L_Type, 1)))); New_Association (Assoc, - New_Convert_Ov (M2E (Chap3.Get_Array_Base (R)), Ghdl_Ptr_Type)); + New_Convert_Ov (M2E (Chap3.Get_Composite_Base (R)), Ghdl_Ptr_Type)); New_Association (Assoc, M2E (Chap3.Range_To_Length (Chap3.Get_Array_Range (R, R_Type, 1)))); @@ -2580,7 +2580,7 @@ package body Trans.Chap7 is end case; return Translate_To_String (Subprg, Res_Type, Expr, - New_Convert_Ov (M2E (Chap3.Get_Array_Base (Arg)), + New_Convert_Ov (M2E (Chap3.Get_Composite_Base (Arg)), Ghdl_Ptr_Type), Chap3.Get_Array_Length (Arg, Left_Type), New_Lit (Rtis.New_Rti_Address @@ -2713,10 +2713,10 @@ package body Trans.Chap7 is case Info.Type_Mode is when Type_Mode_Fat_Array => Arr_Var := Stabilize (Target); - Base_Ptr := Stabilize (Chap3.Get_Array_Base (Arr_Var)); + Base_Ptr := Stabilize (Chap3.Get_Composite_Base (Arr_Var)); Len_Val := Chap3.Get_Array_Length (Arr_Var, Target_Type); when Type_Mode_Array => - Base_Ptr := Stabilize (Chap3.Get_Array_Base (Target)); + Base_Ptr := Stabilize (Chap3.Get_Composite_Base (Target)); Len_Val := Chap3.Get_Array_Type_Length (Target_Type); when others => raise Internal_Error; @@ -3119,7 +3119,7 @@ package body Trans.Chap7 is begin Open_Temp; Targ := Stabilize (Target); - Base := Stabilize (Chap3.Get_Array_Base (Targ)); + Base := Stabilize (Chap3.Get_Composite_Base (Targ)); Bounds := Stabilize (Chap3.Get_Array_Bounds (Targ)); Aggr_Info := Get_Aggregate_Info (Aggr); @@ -3324,7 +3324,7 @@ package body Trans.Chap7 is -- Copy values. Gen_Memcpy (Chap3.Get_Bounds_Acc_Base (New_Obj_Value (Res), D_Type), - M2Addr (Chap3.Get_Array_Base (Val_M)), + M2Addr (Chap3.Get_Composite_Base (Val_M)), New_Obj_Value (Val_Size)); return New_Obj_Value (Res); @@ -3355,7 +3355,7 @@ package body Trans.Chap7 is (M2Lp (Chap3.Get_Array_Bounds (Res)), New_Convert_Ov (New_Obj_Value (Ptr), D_Info.B.Bounds_Ptr_Type)); New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Res)), + (M2Lp (Chap3.Get_Composite_Base (Res)), Chap3.Get_Bounds_Acc_Base (New_Obj_Value (Ptr), D_Type)); return Res; end Bounds_Acc_To_Fat_Pointer; @@ -3451,7 +3451,7 @@ package body Trans.Chap7 is Expr_Type, E, Loc); return New_Convert_Ov - (M2Addr (Chap3.Get_Array_Base (E)), + (M2Addr (Chap3.Get_Composite_Base (E)), Res_Info.Ortho_Ptr_Type (Mode_Value)); when Type_Mode_Fat_Array => declare @@ -3571,8 +3571,8 @@ package body Trans.Chap7 is -- Set base. New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Res)), - New_Convert_Ov (M2Addr (Chap3.Get_Array_Base (E)), + (M2Lp (Chap3.Get_Composite_Base (Res)), + New_Convert_Ov (M2Addr (Chap3.Get_Composite_Base (E)), Res_Info.B.Base_Ptr_Type (Mode_Value))); -- Set bounds. New_Assign_Stmt @@ -3596,7 +3596,7 @@ package body Trans.Chap7 is pragma Unreferenced (Targ, Targ_Type); begin if Get_Type_Info (Data).Type_Mode = Type_Mode_Fat_Array then - return Stabilize (Chap3.Get_Array_Base (Data)); + return Stabilize (Chap3.Get_Composite_Base (Data)); else return Stabilize (Data); end if; @@ -4459,13 +4459,13 @@ package body Trans.Chap7 is New_Assign_Stmt (New_Obj (Var_L_El), M2E (Chap3.Index_Base - (Chap3.Get_Array_Base (Dp2M (L, Info, Mode_Value)), + (Chap3.Get_Composite_Base (Dp2M (L, Info, Mode_Value)), Arr_Type, New_Obj_Value (Var_I)))); New_Assign_Stmt (New_Obj (Var_R_El), M2E (Chap3.Index_Base - (Chap3.Get_Array_Base (Dp2M (R, Info, Mode_Value)), + (Chap3.Get_Composite_Base (Dp2M (R, Info, Mode_Value)), Arr_Type, New_Obj_Value (Var_I)))); Gen_Compare (Var_L_El, Var_R_El); @@ -4617,9 +4617,9 @@ package body Trans.Chap7 is New_Return_Stmt (New_Lit (Std_Boolean_True_Node)); Finish_If_Stmt (If_Blk); Open_Temp; - Le := Chap3.Index_Base (Chap3.Get_Array_Base (L), Arr_Type, + Le := Chap3.Index_Base (Chap3.Get_Composite_Base (L), Arr_Type, New_Obj_Value (Var_I)); - Re := Chap3.Index_Base (Chap3.Get_Array_Base (R), Arr_Type, + Re := Chap3.Index_Base (Chap3.Get_Composite_Base (R), Arr_Type, New_Obj_Value (Var_I)); Start_If_Stmt (If_Blk, @@ -4814,14 +4814,14 @@ package body Trans.Chap7 is (Res, Alloc_Return, Arr_Type, Chap3.Get_Array_Bounds (Dp2M (L, Info, Mode_Value))); New_Assign_Stmt - (New_Obj (Var_Base), M2Addr (Chap3.Get_Array_Base (Res))); + (New_Obj (Var_Base), M2Addr (Chap3.Get_Composite_Base (Res))); New_Assign_Stmt (New_Obj (Var_L_Base), - M2Addr (Chap3.Get_Array_Base (Dp2M (L, Info, Mode_Value)))); + M2Addr (Chap3.Get_Composite_Base (Dp2M (L, Info, Mode_Value)))); if not Is_Monadic then New_Assign_Stmt (New_Obj (Var_R_Base), - M2Addr (Chap3.Get_Array_Base (Dp2M (R, Info, Mode_Value)))); + M2Addr (Chap3.Get_Composite_Base (Dp2M (R, Info, Mode_Value)))); end if; -- Do the logical operation on each element. @@ -5102,8 +5102,8 @@ package body Trans.Chap7 is New_Lit (Ghdl_Index_0), Ghdl_Bool_Type))); New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Res)), - M2Addr (Chap3.Get_Array_Base (L))); + (M2Lp (Chap3.Get_Composite_Base (Res)), + M2Addr (Chap3.Get_Composite_Base (L))); New_Return_Stmt; Finish_If_Stmt (If_Blk); @@ -5112,11 +5112,11 @@ package body Trans.Chap7 is (New_Obj (Var_Res_Base), Gen_Alloc (Alloc_Return, New_Obj_Value (Var_Length), Info.B.Base_Ptr_Type (Mode_Value))); - New_Assign_Stmt (M2Lp (Chap3.Get_Array_Base (Res)), + New_Assign_Stmt (M2Lp (Chap3.Get_Composite_Base (Res)), New_Obj_Value (Var_Res_Base)); New_Assign_Stmt (New_Obj (Var_L_Base), - M2Addr (Chap3.Get_Array_Base (L))); + M2Addr (Chap3.Get_Composite_Base (L))); Start_If_Stmt (If_Blk, New_Compare_Op (ON_Gt, @@ -5393,7 +5393,7 @@ package body Trans.Chap7 is (Ghdl_Index_Type, Chap3.Get_Array_Length (Var, Etype)); Translate_Rw_Length (Var_Max, Ghdl_Write_Scalar); - Translate_Rw_Array (Chap3.Get_Array_Base (Var), Etype, + Translate_Rw_Array (Chap3.Get_Composite_Base (Var), Etype, Var_Max, Ghdl_Write_Scalar); Close_Temp; end; @@ -5417,7 +5417,7 @@ package body Trans.Chap7 is Chap3.Get_Array_Length (Var, Etype), Ghdl_Bool_Type), Subprg, 1); - Translate_Rw_Array (Chap3.Get_Array_Base (Var), Etype, + Translate_Rw_Array (Chap3.Get_Composite_Base (Var), Etype, Var_Len, Ghdl_Read_Scalar); New_Return_Stmt (New_Convert_Ov (New_Obj_Value (Var_Len), Std_Integer_Otype)); diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb index 311d73aeb..b01691607 100644 --- a/src/vhdl/translate/trans-chap8.adb +++ b/src/vhdl/translate/trans-chap8.adb @@ -2902,8 +2902,8 @@ package body Trans.Chap8 is (M2Lp (Chap3.Get_Array_Bounds (Fat)), M2Addr (Bnd)); New_Assign_Stmt - (M2Lp (Chap3.Get_Array_Base (Fat)), - M2Addr (Chap3.Get_Array_Base (Mval))); + (M2Lp (Chap3.Get_Composite_Base (Fat)), + M2Addr (Chap3.Get_Composite_Base (Mval))); else -- No need to copy the bounds. Copy_Fat_Pointer (Fat, Mval); @@ -3611,7 +3611,7 @@ package body Trans.Chap8 is return Val; end if; Res := Signal_Assign_Data' - (Expr => Chap3.Index_Base (Chap3.Get_Array_Base (Val.Expr), + (Expr => Chap3.Index_Base (Chap3.Get_Composite_Base (Val.Expr), Targ_Type, New_Obj_Value (Index)), Reject => Val.Reject, After => Val.After); @@ -3953,9 +3953,9 @@ package body Trans.Chap8 is is begin return Signal_Direct_Assign_Data' - (Drv => Chap3.Index_Base (Chap3.Get_Array_Base (Val.Drv), + (Drv => Chap3.Index_Base (Chap3.Get_Composite_Base (Val.Drv), Targ_Type, New_Obj_Value (Index)), - Expr => Chap3.Index_Base (Chap3.Get_Array_Base (Val.Expr), + Expr => Chap3.Index_Base (Chap3.Get_Composite_Base (Val.Expr), Targ_Type, New_Obj_Value (Index)), Expr_Node => Val.Expr_Node); end Gen_Signal_Direct_Update_Data_Array; diff --git a/src/vhdl/translate/trans-chap9.adb b/src/vhdl/translate/trans-chap9.adb index a17e7630b..37d4e1fb2 100644 --- a/src/vhdl/translate/trans-chap9.adb +++ b/src/vhdl/translate/trans-chap9.adb @@ -1262,7 +1262,7 @@ package body Trans.Chap9 is return Mnode is begin - return Chap3.Index_Base (Chap3.Get_Array_Base (Val), + return Chap3.Index_Base (Chap3.Get_Composite_Base (Val), Targ_Type, New_Obj_Value (Index)); end Gen_Register_Direct_Driver_Update_Data_Array; @@ -2337,7 +2337,7 @@ package body Trans.Chap9 is if Get_Type_Info (Data.Val).Type_Mode = Type_Mode_Record then Res.Val := Stabilize (Data.Val); else - Res.Val := Chap3.Get_Array_Base (Data.Val); + Res.Val := Chap3.Get_Composite_Base (Data.Val); end if; end if; diff --git a/src/vhdl/translate/trans-foreach_non_composite.adb b/src/vhdl/translate/trans-foreach_non_composite.adb index 2035f920e..15a21a059 100644 --- a/src/vhdl/translate/trans-foreach_non_composite.adb +++ b/src/vhdl/translate/trans-foreach_non_composite.adb @@ -46,7 +46,7 @@ begin Open_Temp; Var_Array := Stabilize (Targ); Var_Length := Create_Temp (Ghdl_Index_Type); - Var_Base := Stabilize (Chap3.Get_Array_Base (Var_Array)); + Var_Base := Stabilize (Chap3.Get_Composite_Base (Var_Array)); New_Assign_Stmt (New_Obj (Var_Length), Chap3.Get_Array_Length (Var_Array, Targ_Type)); diff --git a/src/vhdl/translate/trans-helpers2.adb b/src/vhdl/translate/trans-helpers2.adb index b1442fb92..7c5ad147d 100644 --- a/src/vhdl/translate/trans-helpers2.adb +++ b/src/vhdl/translate/trans-helpers2.adb @@ -28,8 +28,8 @@ package body Trans.Helpers2 is procedure Copy_Fat_Pointer (D : Mnode; S: Mnode) is begin - New_Assign_Stmt (M2Lp (Chap3.Get_Array_Base (D)), - M2Addr (Chap3.Get_Array_Base (S))); + New_Assign_Stmt (M2Lp (Chap3.Get_Composite_Base (D)), + M2Addr (Chap3.Get_Composite_Base (S))); New_Assign_Stmt (M2Lp (Chap3.Get_Array_Bounds (D)), M2Addr (Chap3.Get_Array_Bounds (S))); end Copy_Fat_Pointer; @@ -250,7 +250,7 @@ package body Trans.Helpers2 is case Type_Info.Type_Mode is when Type_Mode_Array | Type_Mode_Fat_Array => - Res := Chap3.Get_Array_Base (Res); + Res := Chap3.Get_Composite_Base (Res); when Type_Mode_Record => Res := Stabilize (Res); when others => -- cgit v1.2.3