diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-12-20 04:52:34 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-20 04:52:34 +0100 |
commit | abaeccd90ef5b83812fa2e71d4ce2aff8434df4e (patch) | |
tree | 6b6d9c6f551a22d6826bb85ff1131ba1cbc5cd5f /src/vhdl/translate/trans-chap7.adb | |
parent | d8ae737938689cdac8f96e0b86815b0c95aef692 (diff) | |
download | ghdl-abaeccd90ef5b83812fa2e71d4ce2aff8434df4e.tar.gz ghdl-abaeccd90ef5b83812fa2e71d4ce2aff8434df4e.tar.bz2 ghdl-abaeccd90ef5b83812fa2e71d4ce2aff8434df4e.zip |
Remove Get/Set_Value_Staticness, add Get/Set_Aggregate_Expand_Flag
Diffstat (limited to 'src/vhdl/translate/trans-chap7.adb')
-rw-r--r-- | src/vhdl/translate/trans-chap7.adb | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index e773b3c87..661b95af2 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -113,40 +113,20 @@ package body Trans.Chap7 is end if; -- Only aggregates are specially handled. - case Get_Kind (Expr) is - when Iir_Kind_Aggregate => - null; - when Iir_Kind_Simple_Aggregate - | Iir_Kind_Null_Literal - | Iir_Kind_Physical_Int_Literal - | Iir_Kind_Physical_Fp_Literal - | Iir_Kind_Integer_Literal - | Iir_Kind_Floating_Point_Literal - | Iir_Kind_String_Literal8 => - return True; - when Iir_Kind_Overflow_Literal => - return False; - when others => - return False; - end case; - - Atype := Get_Type (Decl); - -- Bounds must be known (and static). - if Get_Type_Staticness (Atype) /= Locally then + if not Is_Static_Construct (Expr) + or else Get_Kind (Expr) /= Iir_Kind_Aggregate + then return False; end if; + Atype := Get_Type (Decl); + -- Currently, only array aggregates are handled. if Get_Kind (Get_Base_Type (Atype)) /= Iir_Kind_Array_Type_Definition then return False; end if; - -- Aggregate elements must be locally static. - -- Note: this does not yet handled aggregates of aggregates. - if Get_Value_Staticness (Expr) /= Locally then - return False; - end if; Info := Get_Aggregate_Info (Expr); while Info /= Null_Iir loop if Get_Aggr_Dynamic_Flag (Info) then @@ -4543,11 +4523,14 @@ package body Trans.Chap7 is procedure Translate_Predefined_Array_Equality (Subprg : Iir) is + Arr_Type : constant Iir_Array_Type_Definition := + Get_Type (Get_Interface_Declaration_Chain (Subprg)); + El_Type : constant Iir := Get_Element_Subtype (Arr_Type); + Info : constant Type_Info_Acc := Get_Info (Arr_Type); + Id : constant Name_Id := + Get_Identifier (Get_Type_Declarator (Arr_Type)); + Arr_Ptr_Type : constant O_Tnode := Info.Ortho_Ptr_Type (Mode_Value); F_Info : Subprg_Info_Acc; - Arr_Type : Iir_Array_Type_Definition; - Arr_Ptr_Type : O_Tnode; - Info : Type_Info_Acc; - Id : Name_Id; Var_L, Var_R : O_Dnode; L, R : Mnode; Interface_List : O_Inter_List; @@ -4558,14 +4541,7 @@ package body Trans.Chap7 is Var_Len : O_Dnode; Label : O_Snode; Le, Re : Mnode; - El_Type : Iir; begin - Arr_Type := Get_Type (Get_Interface_Declaration_Chain (Subprg)); - El_Type := Get_Element_Subtype (Arr_Type); - Info := Get_Info (Arr_Type); - Id := Get_Identifier (Get_Type_Declarator (Arr_Type)); - Arr_Ptr_Type := Info.Ortho_Ptr_Type (Mode_Value); - F_Info := Add_Info (Subprg, Kind_Subprg); -- Create function. |