aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-06-21 04:58:03 +0200
committerTristan Gingold <tgingold@free.fr>2017-06-21 04:58:03 +0200
commitec063ac4da3715a272a7734fffc7a7ec98abd4ba (patch)
tree089661e05423675797f13659bf635709e5bd1a06 /src/vhdl/translate
parent1c5a4c9b3cbf399cb73f95ae32285a98e7030bd8 (diff)
downloadghdl-ec063ac4da3715a272a7734fffc7a7ec98abd4ba.tar.gz
ghdl-ec063ac4da3715a272a7734fffc7a7ec98abd4ba.tar.bz2
ghdl-ec063ac4da3715a272a7734fffc7a7ec98abd4ba.zip
translate: renaming.
Diffstat (limited to 'src/vhdl/translate')
-rw-r--r--src/vhdl/translate/trans-chap3.adb18
-rw-r--r--src/vhdl/translate/trans-chap3.ads4
-rw-r--r--src/vhdl/translate/trans-chap4.adb10
-rw-r--r--src/vhdl/translate/trans-chap5.adb7
-rw-r--r--src/vhdl/translate/trans-chap6.adb4
-rw-r--r--src/vhdl/translate/trans-chap7.adb47
-rw-r--r--src/vhdl/translate/trans-chap8.adb7
-rw-r--r--src/vhdl/translate/trans-helpers2.adb4
8 files changed, 52 insertions, 49 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb
index 34ffda82f..82df16e84 100644
--- a/src/vhdl/translate/trans-chap3.adb
+++ b/src/vhdl/translate/trans-chap3.adb
@@ -167,7 +167,7 @@ package body Trans.Chap3 is
(Assoc, M2Addr (Chap3.Unbox_Record (Chap3.Get_Composite_Base (Var))));
if Binfo.Type_Mode in Type_Mode_Unbounded then
- New_Association (Assoc, M2Addr (Chap3.Get_Array_Bounds (Var)));
+ New_Association (Assoc, M2Addr (Chap3.Get_Composite_Bounds (Var)));
end if;
return New_Function_Call (Assoc);
@@ -1359,7 +1359,7 @@ package body Trans.Chap3 is
if Is_Unbounded_Type (Info) then
Base2 := Create_Temp (Info, Kind);
New_Assign_Stmt
- (M2Lp (Get_Array_Bounds (Base2)),
+ (M2Lp (Get_Composite_Bounds (Base2)),
New_Obj_Value (Info.C (Kind).Builder_Bound_Param));
New_Assign_Stmt
(M2Lp (Get_Composite_Base (Base2)),
@@ -2678,7 +2678,7 @@ package body Trans.Chap3 is
return Get_Array_Type_Bounds (Get_Info (Atype));
end Get_Array_Type_Bounds;
- function Get_Array_Bounds (Arr : Mnode) return Mnode
+ function Get_Composite_Bounds (Arr : Mnode) return Mnode
is
Info : constant Type_Info_Acc := Get_Type_Info (Arr);
begin
@@ -2704,12 +2704,12 @@ package body Trans.Chap3 is
when others =>
raise Internal_Error;
end case;
- end Get_Array_Bounds;
+ end Get_Composite_Bounds;
function Get_Array_Range (Arr : Mnode; Atype : Iir; Dim : Positive)
return Mnode is
begin
- return Bounds_To_Range (Get_Array_Bounds (Arr), Atype, Dim);
+ return Bounds_To_Range (Get_Composite_Bounds (Arr), Atype, Dim);
end Get_Array_Range;
function Get_Bounds_Length (Bounds : Mnode; Atype : Iir) return O_Enode
@@ -2762,7 +2762,7 @@ package body Trans.Chap3 is
if Type_Info.Type_Locally_Constrained then
return New_Lit (Get_Thin_Array_Length (Atype));
else
- return Get_Bounds_Length (Get_Array_Bounds (Arr), Atype);
+ return Get_Bounds_Length (Get_Composite_Bounds (Arr), Atype);
end if;
end Get_Array_Length;
@@ -3048,7 +3048,7 @@ package body Trans.Chap3 is
Kind : constant Object_Kind_Type := Get_Object_Kind (Obj);
begin
if Type_Info.Type_Mode in Type_Mode_Unbounded then
- return Get_Subtype_Size (Obj_Type, Get_Array_Bounds (Obj), Kind);
+ return Get_Subtype_Size (Obj_Type, Get_Composite_Bounds (Obj), Kind);
else
return Get_Subtype_Size (Obj_Type, Mnode_Null, Kind);
end if;
@@ -3080,14 +3080,14 @@ package body Trans.Chap3 is
if Dinfo.Type_Mode in Type_Mode_Unbounded then
-- Allocate memory for bounds.
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Res)),
+ (M2Lp (Chap3.Get_Composite_Bounds (Res)),
Gen_Alloc (Alloc_Kind,
New_Lit (New_Sizeof (Dinfo.B.Bounds_Type,
Ghdl_Index_Type)),
Dinfo.B.Bounds_Ptr_Type));
-- Copy bounds to the allocated area.
- Copy_Bounds (Chap3.Get_Array_Bounds (Res), Bounds, Obj_Type);
+ Copy_Bounds (Chap3.Get_Composite_Bounds (Res), Bounds, Obj_Type);
-- Allocate base.
Allocate_Fat_Array_Base (Alloc_Kind, Res, Obj_Type);
diff --git a/src/vhdl/translate/trans-chap3.ads b/src/vhdl/translate/trans-chap3.ads
index 91c13e9ff..b1f8cbd67 100644
--- a/src/vhdl/translate/trans-chap3.ads
+++ b/src/vhdl/translate/trans-chap3.ads
@@ -143,8 +143,8 @@ package Trans.Chap3 is
-- 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;
+ -- Get the bounds of composite ARR (an array or an unbounded record).
+ function Get_Composite_Bounds (Arr : Mnode) return Mnode;
-- Get the range ot ATYPE.
function Type_To_Range (Atype : Iir) return Mnode;
diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb
index 676f13613..b496be745 100644
--- a/src/vhdl/translate/trans-chap4.adb
+++ b/src/vhdl/translate/trans-chap4.adb
@@ -533,7 +533,7 @@ package body Trans.Chap4 is
Chap3.Create_Array_Subtype (Aggr_Type);
Name_Node := Stabilize (Name);
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Name_Node)),
+ (M2Lp (Chap3.Get_Composite_Bounds (Name_Node)),
M2Addr (Chap3.Get_Array_Type_Bounds (Aggr_Type)));
Chap3.Allocate_Fat_Array_Base
(Alloc_Kind, Name_Node, Get_Base_Type (Aggr_Type));
@@ -560,7 +560,7 @@ package body Trans.Chap4 is
else
Chap3.Translate_Object_Allocation
(Name_Node, Alloc_Kind, Obj_Type,
- Chap3.Get_Array_Bounds (S));
+ Chap3.Get_Composite_Bounds (S));
Chap3.Translate_Object_Copy
(Name_Node, M2Addr (S), Obj_Type);
end if;
@@ -644,7 +644,7 @@ package body Trans.Chap4 is
V := Chap6.Translate_Name (Obj, Mode_Value);
Stabilize (V);
Chap3.Gen_Deallocate
- (New_Value (M2Lp (Chap3.Get_Array_Bounds (V))));
+ (New_Value (M2Lp (Chap3.Get_Composite_Bounds (V))));
Chap3.Gen_Deallocate
(New_Value (M2Lp (Chap3.Get_Composite_Base (V))));
Close_Temp;
@@ -1103,8 +1103,8 @@ package body Trans.Chap4 is
Name_Node := Stabilize (Name_Node);
-- Copy bounds from signal.
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Name_Node)),
- M2Addr (Chap3.Get_Array_Bounds
+ (M2Lp (Chap3.Get_Composite_Bounds (Name_Node)),
+ M2Addr (Chap3.Get_Composite_Bounds
(Chap6.Translate_Name (Decl, Mode_Signal))));
-- Allocate base.
Chap3.Allocate_Fat_Array_Base (Alloc_System, Name_Node, Sig_Type);
diff --git a/src/vhdl/translate/trans-chap5.adb b/src/vhdl/translate/trans-chap5.adb
index dbccd5ac4..ab0e696fa 100644
--- a/src/vhdl/translate/trans-chap5.adb
+++ b/src/vhdl/translate/trans-chap5.adb
@@ -553,7 +553,7 @@ package body Trans.Chap5 is
else
-- Actual type is unconstrained, but as this is an object reads
-- bounds from the object.
- return Chap3.Get_Array_Bounds
+ return Chap3.Get_Composite_Bounds
(Chap6.Translate_Name (Actual, Mode_Signal));
end if;
end Get_Actual_Bounds;
@@ -647,7 +647,7 @@ package body Trans.Chap5 is
(-- Note: this works only because it is not stabilized, and
-- therefore the bounds field is returned and not a pointer to
-- the bounds.
- M2Lp (Chap3.Get_Array_Bounds (Act_Node)),
+ M2Lp (Chap3.Get_Composite_Bounds (Act_Node)),
M2Addr (Bounds));
end loop;
@@ -655,7 +655,8 @@ package body Trans.Chap5 is
Info := Get_Info (Port);
if Info.Signal_Val /= Null_Var then
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Chap6.Get_Port_Init_Value (Port))),
+ (M2Lp (Chap3.Get_Composite_Bounds
+ (Chap6.Get_Port_Init_Value (Port))),
M2Addr (Bounds));
end if;
Close_Temp;
diff --git a/src/vhdl/translate/trans-chap6.adb b/src/vhdl/translate/trans-chap6.adb
index b06c010e5..e0bb4b2d6 100644
--- a/src/vhdl/translate/trans-chap6.adb
+++ b/src/vhdl/translate/trans-chap6.adb
@@ -841,10 +841,10 @@ package body Trans.Chap6 is
-- Result is a fat pointer, create it and set bounds.
Fat_Res := Create_Temp (El_Tinfo, Kind);
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Fat_Res)),
+ (M2Lp (Chap3.Get_Composite_Bounds (Fat_Res)),
New_Address
(New_Selected_Element
- (M2Lv (Chap3.Get_Array_Bounds (Stable_Prefix)),
+ (M2Lv (Chap3.Get_Composite_Bounds (Stable_Prefix)),
El_Info.Field_Bound),
El_Tinfo.B.Bounds_Ptr_Type));
else
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb
index 7b8ed6799..bcc14b070 100644
--- a/src/vhdl/translate/trans-chap7.adb
+++ b/src/vhdl/translate/trans-chap7.adb
@@ -780,8 +780,8 @@ package body Trans.Chap7 is
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)),
- M2Addr (Chap3.Get_Array_Bounds (Stable_Expr)));
+ (M2Lp (Chap3.Get_Composite_Bounds (Res)),
+ M2Addr (Chap3.Get_Composite_Bounds (Stable_Expr)));
return Res;
end Convert_Constrained_To_Unconstrained;
@@ -859,7 +859,7 @@ package body Trans.Chap7 is
Start_Loop_Stmt (Failure_Label);
Convert_To_Constrained_Check
- (Chap3.Get_Array_Bounds (Expr_Stable), Expr_Type,
+ (Chap3.Get_Composite_Bounds (Expr_Stable), Expr_Type,
Atype, Failure_Label);
New_Exit_Stmt (Success_Label);
@@ -1430,8 +1430,8 @@ package body Trans.Chap7 is
V_Arr := Create_Temp (Info.Ortho_Type (Mode_Value));
Var_Sub_Arr := Dv2M (V_Arr, Info, Mode_Value);
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Var_Sub_Arr)),
- M2Addr (Chap3.Get_Array_Bounds (M)));
+ (M2Lp (Chap3.Get_Composite_Bounds (Var_Sub_Arr)),
+ M2Addr (Chap3.Get_Composite_Bounds (M)));
New_Assign_Stmt
(M2Lp (Chap3.Get_Composite_Base (Var_Sub_Arr)),
M2Addr (Chap3.Slice_Base (Var_Arr,
@@ -1530,9 +1530,9 @@ package body Trans.Chap7 is
Expr_Type),
New_Lit (Ghdl_Index_0),
Ghdl_Bool_Type));
- Copy_Bounds_V87
- (Chap3.Bounds_To_Range
- (Chap3.Get_Array_Bounds (Dyn_Mnodes (Dyn_I)), Expr_Type, 1));
+ Copy_Bounds_V87 (Chap3.Bounds_To_Range
+ (Chap3.Get_Composite_Bounds
+ (Dyn_Mnodes (Dyn_I)), Expr_Type, 1));
New_Else_Stmt (Assign_Bounds_Ifs (Dyn_I));
end if;
end Assign_Bounds_Arr_V87;
@@ -1555,7 +1555,7 @@ package body Trans.Chap7 is
-- Set result bounds.
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Res)), M2Addr (Var_Bounds));
+ (M2Lp (Chap3.Get_Composite_Bounds (Res)), M2Addr (Var_Bounds));
-- Evaluate all dynamic expressions
Dyn_I := 0;
@@ -1693,7 +1693,7 @@ package body Trans.Chap7 is
Copy_Range
(Get_Res_Range,
Chap3.Bounds_To_Range
- (Chap3.Get_Array_Bounds (Dyn_Mnodes (Last_Dyn_Expr)),
+ (Chap3.Get_Composite_Bounds (Dyn_Mnodes (Last_Dyn_Expr)),
Expr_Type, 1));
end if;
@@ -1959,8 +1959,8 @@ package body Trans.Chap7 is
Res := Create_Temp (Res_Info, Mode_Value);
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)));
+ New_Assign_Stmt (M2Lp (Chap3.Get_Composite_Bounds (Res)),
+ M2Addr (Chap3.Get_Composite_Bounds (Arr)));
return Translate_Implicit_Conv (M2E (Res), Res_Btype, Res_Type,
Mode_Value, Loc);
@@ -3251,7 +3251,7 @@ package body Trans.Chap7 is
Open_Temp;
Targ := Stabilize (Target);
Base := Stabilize (Chap3.Get_Composite_Base (Targ));
- Bounds := Stabilize (Chap3.Get_Array_Bounds (Targ));
+ Bounds := Stabilize (Chap3.Get_Composite_Bounds (Targ));
Aggr_Info := Get_Aggregate_Info (Aggr);
-- Check type
@@ -3431,7 +3431,7 @@ package body Trans.Chap7 is
Val_Size := Create_Temp_Init
(Ghdl_Index_Type,
Chap3.Get_Subtype_Size
- (D_Type, Chap3.Get_Array_Bounds (Val_M), Mode_Value));
+ (D_Type, Chap3.Get_Composite_Bounds (Val_M), Mode_Value));
-- Size of the bounds.
Bounds_Size :=
@@ -3449,7 +3449,8 @@ package body Trans.Chap7 is
-- Copy bounds.
Gen_Memcpy
- (New_Obj_Value (Res), M2Addr (Chap3.Get_Array_Bounds (Val_M)),
+ (New_Obj_Value (Res),
+ M2Addr (Chap3.Get_Composite_Bounds (Val_M)),
New_Lit (Bounds_Size));
-- Copy values.
@@ -3483,7 +3484,7 @@ package body Trans.Chap7 is
D_Info, Mode_Value);
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Res)),
+ (M2Lp (Chap3.Get_Composite_Bounds (Res)),
New_Convert_Ov (New_Obj_Value (Ptr), D_Info.B.Bounds_Ptr_Type));
New_Assign_Stmt
(M2Lp (Chap3.Get_Composite_Base (Res)),
@@ -3707,14 +3708,14 @@ package body Trans.Chap7 is
Res_Info.B.Base_Ptr_Type (Mode_Value)));
-- Set bounds.
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Res)),
+ (M2Lp (Chap3.Get_Composite_Bounds (Res)),
New_Address (New_Obj (Bounds), Res_Info.B.Bounds_Ptr_Type));
-- Convert bounds.
Translate_Type_Conversion_Bounds
(Dv2M (Bounds, Res_Info, Mode_Value,
Res_Info.B.Bounds_Type, Res_Info.B.Bounds_Ptr_Type),
- Stabilize (Chap3.Get_Array_Bounds (E)),
+ Stabilize (Chap3.Get_Composite_Bounds (E)),
Res_Type, Expr_Type, Loc);
Close_Temp;
@@ -3804,8 +3805,8 @@ package body Trans.Chap7 is
-- Copy bounds.
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Res)),
- M2Addr (Chap3.Get_Array_Bounds (Var_Val)));
+ (M2Lp (Chap3.Get_Composite_Bounds (Res)),
+ M2Addr (Chap3.Get_Composite_Bounds (Var_Val)));
-- Allocate base.
Chap3.Allocate_Fat_Array_Base (Alloc_Stack, Res, Sig_Type);
@@ -4986,7 +4987,7 @@ package body Trans.Chap7 is
Res := Dp2M (F_Info.Operator_Res, Tinfo, Mode_Value);
Chap3.Translate_Object_Allocation
(Res, Alloc_Return, Arr_Type,
- Chap3.Get_Array_Bounds
+ Chap3.Get_Composite_Bounds
(Dp2M (F_Info.Operator_Left, Tinfo, Mode_Value)));
New_Assign_Stmt
(New_Obj (Var_Base), M2Addr (Chap3.Get_Composite_Base (Res)));
@@ -5277,8 +5278,8 @@ package body Trans.Chap7 is
-- The index subtypes of the return values of all shift operators is
-- the same as the index subtype of their left arguments.
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Res)),
- M2Addr (Chap3.Get_Array_Bounds (L)));
+ (M2Lp (Chap3.Get_Composite_Bounds (Res)),
+ M2Addr (Chap3.Get_Composite_Bounds (L)));
-- Get length of LEFT.
New_Assign_Stmt (New_Obj (Var_Length),
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb
index 006c1709f..29441bca8 100644
--- a/src/vhdl/translate/trans-chap8.adb
+++ b/src/vhdl/translate/trans-chap8.adb
@@ -259,7 +259,7 @@ package body Trans.Chap8 is
Ret_Info, Mode_Value));
Chap3.Translate_Object_Allocation
(Area, Alloc_Return, Ret_Type,
- Chap3.Get_Array_Bounds (Val));
+ Chap3.Get_Composite_Bounds (Val));
Chap3.Translate_Object_Copy (Area, M2Addr (Val), Ret_Type);
Gen_Return;
end;
@@ -2898,9 +2898,10 @@ package body Trans.Chap8 is
Ftype_Info.B.Bounds_Type,
Ftype_Info.B.Bounds_Ptr_Type));
Chap3.Copy_Bounds
- (Bnd, Chap3.Get_Array_Bounds (Mval), Formal_Type);
+ (Bnd,
+ Chap3.Get_Composite_Bounds (Mval), Formal_Type);
New_Assign_Stmt
- (M2Lp (Chap3.Get_Array_Bounds (Fat)),
+ (M2Lp (Chap3.Get_Composite_Bounds (Fat)),
M2Addr (Bnd));
New_Assign_Stmt
(M2Lp (Chap3.Get_Composite_Base (Fat)),
diff --git a/src/vhdl/translate/trans-helpers2.adb b/src/vhdl/translate/trans-helpers2.adb
index fa8f11038..c1aab8e5f 100644
--- a/src/vhdl/translate/trans-helpers2.adb
+++ b/src/vhdl/translate/trans-helpers2.adb
@@ -30,8 +30,8 @@ package body Trans.Helpers2 is
begin
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)));
+ New_Assign_Stmt (M2Lp (Chap3.Get_Composite_Bounds (D)),
+ M2Addr (Chap3.Get_Composite_Bounds (S)));
end Copy_Fat_Pointer;
-- Convert NAME into a STRING_CST.