aboutsummaryrefslogtreecommitdiffstats
path: root/src/ghdldrv/ghdlxml.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-11 08:48:28 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-11 08:48:28 +0100
commite8a21ffe5226aad4970bd1facd4a3464a4b436f1 (patch)
tree6dabc27375bc31dbd435d50a98dc223fa4145ac2 /src/ghdldrv/ghdlxml.adb
parent9a90393e30827308ec6cd834963f5359158115a0 (diff)
downloadghdl-e8a21ffe5226aad4970bd1facd4a3464a4b436f1.tar.gz
ghdl-e8a21ffe5226aad4970bd1facd4a3464a4b436f1.tar.bz2
ghdl-e8a21ffe5226aad4970bd1facd4a3464a4b436f1.zip
Rework list implementation, use iterator.
Diffstat (limited to 'src/ghdldrv/ghdlxml.adb')
-rw-r--r--src/ghdldrv/ghdlxml.adb10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ghdldrv/ghdlxml.adb b/src/ghdldrv/ghdlxml.adb
index 6bad81aad..9913aaf76 100644
--- a/src/ghdldrv/ghdlxml.adb
+++ b/src/ghdldrv/ghdlxml.adb
@@ -234,6 +234,7 @@ package body Ghdlxml is
procedure Disp_Iir_List (Id : String; L : Iir_List; Ref : Boolean)
is
El : Iir;
+ It : List_Iterator;
begin
case L is
when Null_Iir_List =>
@@ -249,14 +250,15 @@ package body Ghdlxml is
Put_Attribute ("list-id", Strip (Iir_List'Image (L)));
Put_Stag_End;
- for I in Natural loop
- El := Get_Nth_Element (L, I);
- exit when El = Null_Iir;
+ It := List_Iterate (L);
+ while Is_Valid (It) loop
+ El := Get_Element (It);
if Ref then
- Disp_Iir_Ref ("el", El);
+ Disp_Iir_Ref ("el", El);
else
Disp_Iir ("el", El);
end if;
+ Next (It);
end loop;
Put_Etag (Id);