aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-07 08:00:47 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-07 08:00:47 +0100
commit51c217170387f9c3d78117ce853d0a0f256dce3c (patch)
treeed2d79e11b057e14d3f0fa0a8f2cc761299f087e /src/vhdl
parent4df833beb6929d358303604664249752ae946a87 (diff)
downloadghdl-51c217170387f9c3d78117ce853d0a0f256dce3c.tar.gz
ghdl-51c217170387f9c3d78117ce853d0a0f256dce3c.tar.bz2
ghdl-51c217170387f9c3d78117ce853d0a0f256dce3c.zip
Fix regressions in disp_vhdl.
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/disp_vhdl.adb30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/vhdl/disp_vhdl.adb b/src/vhdl/disp_vhdl.adb
index 65c951af0..6ff630e04 100644
--- a/src/vhdl/disp_vhdl.adb
+++ b/src/vhdl/disp_vhdl.adb
@@ -487,6 +487,7 @@ package body Disp_Vhdl is
Tm_El : constant Iir := Get_Element_Subtype (Type_Mark);
Has_Index : constant Boolean := Get_Index_Constraint_Flag (Def);
Has_Own_Element_Subtype : constant Boolean := Def_El /= Tm_El;
+ Indexes : Iir_Flist;
Index : Iir;
begin
if not Has_Index and not Has_Own_Element_Subtype then
@@ -496,10 +497,10 @@ package body Disp_Vhdl is
if Get_Constraint_State (Type_Mark) /= Fully_Constrained
and then Has_Index
then
+ Indexes := Get_Index_Subtype_List (Def);
Put (" (");
- for I in Natural loop
- Index := Get_Nth_Element (Get_Index_Subtype_List (Def), I);
- exit when Index = Null_Iir;
+ for I in Flist_First .. Flist_Last (Indexes) loop
+ Index := Get_Nth_Element (Indexes, I);
if I /= 0 then
Put (", ");
end if;
@@ -641,15 +642,15 @@ package body Disp_Vhdl is
procedure Disp_Enumeration_Type_Definition
(Def: Iir_Enumeration_Type_Definition)
is
+ Lits : constant Iir_Flist := Get_Enumeration_Literal_List (Def);
Len : Count;
Start_Col: Count;
Decl: Name_Id;
A_Lit: Iir; --Enumeration_Literal_Acc;
begin
- for I in Natural loop
- A_Lit := Get_Nth_Element (Get_Enumeration_Literal_List (Def), I);
- exit when A_Lit = Null_Iir;
- if I = Natural'first then
+ for I in Flist_First .. Flist_Last (Lits) loop
+ A_Lit := Get_Nth_Element (Lits, I);
+ if I = 0 then
Put ("(");
Start_Col := Col;
else
@@ -691,14 +692,14 @@ package body Disp_Vhdl is
procedure Disp_Array_Subtype_Definition (Def: Iir_Array_Subtype_Definition)
is
+ Indexes : constant Iir_Flist := Get_Index_Subtype_List (Def);
Index: Iir;
begin
Disp_Resolution_Indication (Def);
Put ("array (");
- for I in Natural loop
- Index := Get_Nth_Element (Get_Index_Subtype_List (Def), I);
- exit when Index = Null_Iir;
+ for I in Flist_First .. Flist_Last (Indexes) loop
+ Index := Get_Nth_Element (Indexes, I);
if I /= 0 then
Put (", ");
end if;
@@ -708,13 +709,14 @@ package body Disp_Vhdl is
Disp_Subtype_Indication (Get_Element_Subtype (Def));
end Disp_Array_Subtype_Definition;
- procedure Disp_Array_Type_Definition (Def: Iir_Array_Type_Definition) is
+ procedure Disp_Array_Type_Definition (Def: Iir_Array_Type_Definition)
+ is
+ Indexes : constant Iir_Flist := Get_Index_Subtype_List (Def);
Index: Iir;
begin
Put ("array (");
- for I in Natural loop
- Index := Get_Nth_Element (Get_Index_Subtype_List (Def), I);
- exit when Index = Null_Iir;
+ for I in Flist_First .. Flist_Last (Indexes) loop
+ Index := Get_Nth_Element (Indexes, I);
if I /= 0 then
Put (", ");
end if;