aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-10-28 06:52:41 +0200
committerTristan Gingold <tgingold@free.fr>2017-10-28 06:52:41 +0200
commit6b186f6fc00625ca6ef4dc55d9656da6e33d3763 (patch)
tree8659fc4614bc9e1d694ab962e4f399a3b456b2b7 /src/vhdl/translate
parent93435515a4e715e465e649c4c557dbcccf10d6b3 (diff)
downloadghdl-6b186f6fc00625ca6ef4dc55d9656da6e33d3763.tar.gz
ghdl-6b186f6fc00625ca6ef4dc55d9656da6e33d3763.tar.bz2
ghdl-6b186f6fc00625ca6ef4dc55d9656da6e33d3763.zip
Rename Allocate_Fat_Array_Base to Allocate_Unbounded_Composite_Base.
Diffstat (limited to 'src/vhdl/translate')
-rw-r--r--src/vhdl/translate/trans-chap3.adb10
-rw-r--r--src/vhdl/translate/trans-chap3.ads14
-rw-r--r--src/vhdl/translate/trans-chap4.adb26
-rw-r--r--src/vhdl/translate/trans-chap7.adb9
-rw-r--r--src/vhdl/translate/trans-chap8.adb2
5 files changed, 34 insertions, 27 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb
index fc69bdc05..b77a977c6 100644
--- a/src/vhdl/translate/trans-chap3.adb
+++ b/src/vhdl/translate/trans-chap3.adb
@@ -2882,9 +2882,9 @@ package body Trans.Chap3 is
end if;
end Maybe_Call_Type_Builder;
- procedure Allocate_Fat_Array_Base (Alloc_Kind : Allocation_Kind;
- Res : Mnode;
- Arr_Type : Iir)
+ procedure Allocate_Unbounded_Composite_Base (Alloc_Kind : Allocation_Kind;
+ Res : Mnode;
+ Arr_Type : Iir)
is
Dinfo : constant Type_Info_Acc :=
Get_Info (Get_Base_Type (Arr_Type));
@@ -2899,7 +2899,7 @@ package body Trans.Chap3 is
Gen_Alloc (Alloc_Kind, Length, Dinfo.B.Base_Ptr_Type (Kind)));
Maybe_Call_Type_Builder (Res, Arr_Type);
- end Allocate_Fat_Array_Base;
+ end Allocate_Unbounded_Composite_Base;
procedure Create_Array_Subtype (Sub_Type : Iir)
is
@@ -3071,7 +3071,7 @@ package body Trans.Chap3 is
Copy_Bounds (Chap3.Get_Composite_Bounds (Res), Bounds, Obj_Type);
-- Allocate base.
- Allocate_Fat_Array_Base (Alloc_Kind, Res, Obj_Type);
+ Allocate_Unbounded_Composite_Base (Alloc_Kind, Res, Obj_Type);
else
New_Assign_Stmt
(M2Lp (Res),
diff --git a/src/vhdl/translate/trans-chap3.ads b/src/vhdl/translate/trans-chap3.ads
index b1f8cbd67..3ea70c79d 100644
--- a/src/vhdl/translate/trans-chap3.ads
+++ b/src/vhdl/translate/trans-chap3.ads
@@ -218,14 +218,14 @@ package Trans.Chap3 is
-- If needed call the procedure to build OBJ.
procedure Maybe_Call_Type_Builder (Obj : Mnode; Obj_Type : Iir);
- -- Allocate the base of a fat array, whose length is determined from
- -- the bounds.
- -- RES_PTR is a pointer to the fat pointer (must be a variable that
+ -- Allocate the base of an unbounded composite, whose length is
+ -- determined from the bounds (already set).
+ -- RES_PTR is a pointer to the fat pointer (must be a stable variable: it
-- can be referenced several times).
- -- ARR_TYPE is the type of the array.
- procedure Allocate_Fat_Array_Base (Alloc_Kind : Allocation_Kind;
- Res : Mnode;
- Arr_Type : Iir);
+ -- ARR_TYPE is the type of the composite.
+ procedure Allocate_Unbounded_Composite_Base (Alloc_Kind : Allocation_Kind;
+ Res : Mnode;
+ Arr_Type : Iir);
-- Create the bounds for SUB_TYPE.
-- SUB_TYPE is expected to be a non-static, anonymous array type.
diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb
index ed96d8723..c5d7df598 100644
--- a/src/vhdl/translate/trans-chap4.adb
+++ b/src/vhdl/translate/trans-chap4.adb
@@ -535,7 +535,7 @@ package body Trans.Chap4 is
New_Assign_Stmt
(M2Lp (Chap3.Get_Composite_Bounds (Name_Node)),
M2Addr (Chap3.Get_Array_Type_Bounds (Aggr_Type)));
- Chap3.Allocate_Fat_Array_Base
+ Chap3.Allocate_Unbounded_Composite_Base
(Alloc_Kind, Name_Node, Get_Base_Type (Aggr_Type));
end;
else
@@ -636,7 +636,7 @@ package body Trans.Chap4 is
Obj_Type : constant Iir := Get_Type (Obj);
Type_Info : constant Type_Info_Acc := Get_Info (Obj_Type);
begin
- if Type_Info.Type_Mode = Type_Mode_Fat_Array then
+ if Type_Info.Type_Mode in Type_Mode_Unbounded then
declare
V : Mnode;
begin
@@ -1040,15 +1040,20 @@ package body Trans.Chap4 is
Chap6.Translate_Signal_Name (Decl, Name_Sig, Name_Val);
end if;
Name_Sig := Stabilize (Name_Sig);
- Chap3.Allocate_Fat_Array_Base (Alloc_System, Name_Sig, Sig_Type);
+
+ Chap3.Allocate_Unbounded_Composite_Base
+ (Alloc_System, Name_Sig, Sig_Type);
+
if Name_Val /= Mnode_Null then
Name_Val := Stabilize (Name_Val);
- Chap3.Allocate_Fat_Array_Base (Alloc_System, Name_Val, Sig_Type);
+ Chap3.Allocate_Unbounded_Composite_Base
+ (Alloc_System, Name_Val, Sig_Type);
end if;
if Is_Port and then Get_Default_Value (Decl) /= Null_Iir then
Name_Val := Chap6.Get_Port_Init_Value (Decl);
Name_Val := Stabilize (Name_Val);
- Chap3.Allocate_Fat_Array_Base (Alloc_System, Name_Val, Sig_Type);
+ Chap3.Allocate_Unbounded_Composite_Base
+ (Alloc_System, Name_Val, Sig_Type);
end if;
elsif Is_Complex_Type (Type_Info) then
if Has_Copy then
@@ -1098,7 +1103,7 @@ package body Trans.Chap4 is
begin
Open_Temp;
- if Type_Info.Type_Mode = Type_Mode_Fat_Array then
+ if Type_Info.Type_Mode in Type_Mode_Unbounded then
Name_Node := Get_Var (Sig_Info.Signal_Driver, Type_Info, Mode_Value);
Name_Node := Stabilize (Name_Node);
-- Copy bounds from signal.
@@ -1107,7 +1112,8 @@ package body Trans.Chap4 is
M2Addr (Chap3.Get_Composite_Bounds
(Chap6.Translate_Name (Decl, Mode_Signal))));
-- Allocate base.
- Chap3.Allocate_Fat_Array_Base (Alloc_System, Name_Node, Sig_Type);
+ Chap3.Allocate_Unbounded_Composite_Base
+ (Alloc_System, Name_Node, Sig_Type);
elsif Is_Complex_Type (Type_Info) then
Name_Node := Get_Var (Sig_Info.Signal_Driver, Type_Info, Mode_Value);
Allocate_Complex_Object (Sig_Type, Alloc_System, Name_Node);
@@ -1522,7 +1528,7 @@ package body Trans.Chap4 is
Tinfo := Get_Info (Decl_Type);
for Mode in Mode_Value .. Info.Alias_Kind loop
case Tinfo.Type_Mode is
- when Type_Mode_Fat_Array =>
+ when Type_Mode_Unbounded =>
-- create an object.
-- At elaboration: copy base from name, copy bounds from type,
-- check for matching bounds.
@@ -1587,7 +1593,7 @@ package body Trans.Chap4 is
Alias_Node : Mnode;
begin
case Tinfo.Type_Mode is
- when Type_Mode_Fat_Array =>
+ when Type_Mode_Unbounded =>
Stabilize (N);
Alias_Node := Stabilize (Get_Var (A, Tinfo, Mode));
Copy_Fat_Pointer (Alias_Node, N);
@@ -2038,7 +2044,7 @@ package body Trans.Chap4 is
New_Address (New_Obj (Var_Bound), Base_Info.B.Bounds_Ptr_Type));
-- Allocate the array.
- Chap3.Allocate_Fat_Array_Base
+ Chap3.Allocate_Unbounded_Composite_Base
(Alloc_Stack, Dv2M (Var_Array, Base_Info, Mode_Value), Base_Type);
-- Fill the array
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb
index bcc14b070..1e741d024 100644
--- a/src/vhdl/translate/trans-chap7.adb
+++ b/src/vhdl/translate/trans-chap7.adb
@@ -3727,7 +3727,7 @@ package body Trans.Chap7 is
is
pragma Unreferenced (Targ, Targ_Type);
begin
- if Get_Type_Info (Data).Type_Mode = Type_Mode_Fat_Array then
+ if Get_Type_Info (Data).Type_Mode in Type_Mode_Unbounded then
return Stabilize (Chap3.Get_Composite_Base (Data));
else
return Stabilize (Data);
@@ -3798,7 +3798,7 @@ package body Trans.Chap7 is
Var_Val : Mnode;
begin
-- allocate result array
- if Tinfo.Type_Mode = Type_Mode_Fat_Array then
+ if Tinfo.Type_Mode in Type_Mode_Unbounded then
Res := Create_Temp (Tinfo);
Var_Val := Stabilize (E2M (Sig, Tinfo, Mode_Signal));
@@ -3809,7 +3809,8 @@ package body Trans.Chap7 is
M2Addr (Chap3.Get_Composite_Bounds (Var_Val)));
-- Allocate base.
- Chap3.Allocate_Fat_Array_Base (Alloc_Stack, Res, Sig_Type);
+ Chap3.Allocate_Unbounded_Composite_Base
+ (Alloc_Stack, Res, Sig_Type);
elsif Is_Complex_Type (Tinfo) then
Res := Create_Temp (Tinfo);
Chap4.Allocate_Complex_Object (Sig_Type, Alloc_Stack, Res);
@@ -3819,7 +3820,7 @@ package body Trans.Chap7 is
Open_Temp;
- if Tinfo.Type_Mode /= Type_Mode_Fat_Array then
+ if Tinfo.Type_Mode not in Type_Mode_Unbounded then
Var_Val := Stabilize (E2M (Sig, Tinfo, Mode_Signal));
end if;
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb
index 167012371..9953244fd 100644
--- a/src/vhdl/translate/trans-chap8.adb
+++ b/src/vhdl/translate/trans-chap8.adb
@@ -2885,7 +2885,7 @@ package body Trans.Chap8 is
(Assoc_Info.Call_Assoc_Fat (Mode) /= Null_Var);
-- Allocate array base
Param := Fat;
- Chap3.Allocate_Fat_Array_Base
+ Chap3.Allocate_Unbounded_Composite_Base
(Alloc_Return, Fat, Formal_Type);
-- NOTE: Call_Assoc_Value is not used, the base is
-- directly allocated in the fat pointer.