aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap7.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-01-05 09:29:59 +0100
committerTristan Gingold <tgingold@free.fr>2018-01-11 12:51:47 +0100
commit2d0b6074af96f3375165afc7386b0e9071be206a (patch)
tree8205991632ab8a28d8b4eb17708076a272e89f67 /src/vhdl/translate/trans-chap7.adb
parent1e0718e33573d3b855e4e57006c0293a2fe0f40b (diff)
downloadghdl-2d0b6074af96f3375165afc7386b0e9071be206a.tar.gz
ghdl-2d0b6074af96f3375165afc7386b0e9071be206a.tar.bz2
ghdl-2d0b6074af96f3375165afc7386b0e9071be206a.zip
WIP: arrays of unbounded type.
Diffstat (limited to 'src/vhdl/translate/trans-chap7.adb')
-rw-r--r--src/vhdl/translate/trans-chap7.adb26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb
index 438eb105c..09b005e92 100644
--- a/src/vhdl/translate/trans-chap7.adb
+++ b/src/vhdl/translate/trans-chap7.adb
@@ -4716,7 +4716,8 @@ package body Trans.Chap7 is
Var_I : O_Dnode;
Var_Len : O_Dnode;
Label : O_Snode;
- Le, Re : Mnode;
+ Base_Le, Base_Re : Mnode;
+ Var_L, Var_R : Mnode;
begin
if Global_Storage = O_Storage_External then
return;
@@ -4749,29 +4750,36 @@ package body Trans.Chap7 is
New_Assign_Stmt (New_Obj (Var_Len),
Chap3.Get_Array_Length (L, Arr_Type));
Close_Temp;
+ Open_Temp;
+ Var_L := Chap3.Create_Maybe_Fat_Array_Element (L, Arr_Type);
+ Var_R := Chap3.Create_Maybe_Fat_Array_Element (R, Arr_Type);
Init_Var (Var_I);
Start_Loop_Stmt (Label);
-- If the end of the array is reached, return TRUE.
Start_If_Stmt (If_Blk,
New_Compare_Op (ON_Ge,
- New_Obj_Value (Var_I),
- New_Obj_Value (Var_Len),
- Ghdl_Bool_Type));
+ New_Obj_Value (Var_I),
+ New_Obj_Value (Var_Len),
+ Ghdl_Bool_Type));
New_Return_Stmt (New_Lit (Std_Boolean_True_Node));
Finish_If_Stmt (If_Blk);
Open_Temp;
- Le := Chap3.Index_Base (Chap3.Get_Composite_Base (L), Arr_Type,
- New_Obj_Value (Var_I));
- Re := Chap3.Index_Base (Chap3.Get_Composite_Base (R), Arr_Type,
- New_Obj_Value (Var_I));
+ Base_Le := Chap3.Index_Base (Chap3.Get_Composite_Base (L), Arr_Type,
+ New_Obj_Value (Var_I));
+ Base_Le := Chap3.Assign_Maybe_Fat_Array_Element (Var_L, Base_Le);
+ Base_Re := Chap3.Index_Base (Chap3.Get_Composite_Base (R), Arr_Type,
+ New_Obj_Value (Var_I));
+ Base_Re := Chap3.Assign_Maybe_Fat_Array_Element (Var_R, Base_Re);
Start_If_Stmt
(If_Blk,
- New_Monadic_Op (ON_Not, Translate_Equality (Le, Re, El_Type)));
+ New_Monadic_Op (ON_Not,
+ Translate_Equality (Base_Le, Base_Re, El_Type)));
New_Return_Stmt (New_Lit (Std_Boolean_False_Node));
Finish_If_Stmt (If_Blk);
Close_Temp;
Inc_Var (Var_I);
Finish_Loop_Stmt (Label);
+ Close_Temp;
Finish_Operator_Instance_Use (F_Info);
Finish_Subprogram_Body;
end Translate_Predefined_Array_Equality_Body;