aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/sem_scopes.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/vhdl/sem_scopes.adb
parent9a90393e30827308ec6cd834963f5359158115a0 (diff)
downloadghdl-e8a21ffe5226aad4970bd1facd4a3464a4b436f1.tar.gz
ghdl-e8a21ffe5226aad4970bd1facd4a3464a4b436f1.tar.bz2
ghdl-e8a21ffe5226aad4970bd1facd4a3464a4b436f1.zip
Rework list implementation, use iterator.
Diffstat (limited to 'src/vhdl/sem_scopes.adb')
-rw-r--r--src/vhdl/sem_scopes.adb10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vhdl/sem_scopes.adb b/src/vhdl/sem_scopes.adb
index 4db8ffdf3..30d33d8fc 100644
--- a/src/vhdl/sem_scopes.adb
+++ b/src/vhdl/sem_scopes.adb
@@ -1136,15 +1136,17 @@ package body Sem_Scopes is
procedure Iterator_Decl_List (Decl_List : Iir_List; Arg : Arg_Type)
is
- Decl: Iir;
+ Decl : Iir;
+ It : List_Iterator;
begin
if Decl_List = Null_Iir_List then
return;
end if;
- for I in Natural loop
- Decl := Get_Nth_Element (Decl_List, I);
- exit when Decl = Null_Iir;
+ It := List_Iterate (Decl_List);
+ while Is_Valid (It) loop
+ Decl := Get_Element (It);
Handle_Decl (Decl, Arg);
+ Next (It);
end loop;
end Iterator_Decl_List;