summaryrefslogtreecommitdiff
path: root/src/vhdl/translate
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/translate')
-rw-r--r--src/vhdl/translate/trans-chap7.adb9
-rw-r--r--src/vhdl/translate/trans.ads10
2 files changed, 14 insertions, 5 deletions
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb
index c11f930..a3ae289 100644
--- a/src/vhdl/translate/trans-chap7.adb
+++ b/src/vhdl/translate/trans-chap7.adb
@@ -41,8 +41,7 @@ package body Trans.Chap7 is
procedure Copy_Range (Dest : Mnode; Src : Mnode);
function Translate_Static_Implicit_Conv
- (Expr : O_Cnode; Expr_Type : Iir; Res_Type : Iir)
- return O_Cnode
+ (Expr : O_Cnode; Expr_Type : Iir; Res_Type : Iir) return O_Cnode
is
Expr_Info : Type_Info_Acc;
Res_Info : Type_Info_Acc;
@@ -226,7 +225,7 @@ package body Trans.Chap7 is
List : O_Array_Aggr_List;
Res : O_Cnode;
begin
- Chap3.Translate_Anonymous_Type_Definition (Aggr_Type, True);
+ Chap3.Translate_Anonymous_Type_Definition (Aggr_Type, False);
Start_Array_Aggr (List, Get_Ortho_Type (Aggr_Type, Mode_Value));
Translate_Static_Aggregate_1
@@ -244,7 +243,7 @@ package body Trans.Chap7 is
List : O_Array_Aggr_List;
Res : O_Cnode;
begin
- Chap3.Translate_Anonymous_Type_Definition (Aggr_Type, True);
+ Chap3.Translate_Anonymous_Type_Definition (Aggr_Type, False);
Start_Array_Aggr (List, Get_Ortho_Type (Aggr_Type, Mode_Value));
for I in Natural loop
@@ -441,7 +440,7 @@ package body Trans.Chap7 is
if Get_Constraint_State (Str_Type) = Fully_Constrained
and then Get_Type_Staticness (Get_Index_Type (Str_Type, 0)) = Locally
then
- Chap3.Create_Array_Subtype (Str_Type, True);
+ Chap3.Create_Array_Subtype (Str_Type, False);
case Get_Kind (Str) is
when Iir_Kind_String_Literal8 =>
Res := Translate_Static_String_Literal8 (Str);
diff --git a/src/vhdl/translate/trans.ads b/src/vhdl/translate/trans.ads
index 4e778de..8cf76b7 100644
--- a/src/vhdl/translate/trans.ads
+++ b/src/vhdl/translate/trans.ads
@@ -1675,6 +1675,16 @@ package Trans is
-- FIXME: maybe a flag must be added to CLOSE_TEMP where it is known
-- stack2 can be released.
procedure Create_Temp_Stack2_Mark;
+
+ -- Some constructs (slices, aggregates) implicitly define a subtype.
+ -- This subtype (and its bounds) is created dynamically and its life
+ -- is short.
+ -- However, in some cases (default expression, target of signal
+ -- assignment) the construct may be evaluated several time (eg: to
+ -- compute the drivers). In that case, bounds are created many times
+ -- and therefore must be forgotten at the end of its life to avoid any
+ -- incorrect reuse.
+ --
-- Add ATYPE in the chain of types to be destroyed at the end of the
-- temp scope.
procedure Add_Transient_Type_In_Temp (Atype : Iir);