aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/iirs_utils.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-07 06:29:21 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-07 06:29:21 +0100
commit06d553f9d32184ad71f47bbcfcde2528d40408ac (patch)
treebd4bfcdc43394ccf59a0209079f90c6983929e0e /src/vhdl/iirs_utils.adb
parent8ffc472d4def7cb5fb6b0d1af41e217f88a474e6 (diff)
downloadghdl-06d553f9d32184ad71f47bbcfcde2528d40408ac.tar.gz
ghdl-06d553f9d32184ad71f47bbcfcde2528d40408ac.tar.bz2
ghdl-06d553f9d32184ad71f47bbcfcde2528d40408ac.zip
Use Flist for records.
Diffstat (limited to 'src/vhdl/iirs_utils.adb')
-rw-r--r--src/vhdl/iirs_utils.adb21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/vhdl/iirs_utils.adb b/src/vhdl/iirs_utils.adb
index e48b43893..6a0c39a07 100644
--- a/src/vhdl/iirs_utils.adb
+++ b/src/vhdl/iirs_utils.adb
@@ -574,7 +574,8 @@ package body Iirs_Utils is
end case;
end Is_Parameter;
- function Find_Name_In_List (List: Iir_List; Lit: Name_Id) return Iir is
+ function Find_Name_In_List (List: Iir_List; Lit: Name_Id) return Iir
+ is
El: Iir;
Ident: Name_Id;
begin
@@ -589,6 +590,19 @@ package body Iirs_Utils is
return Null_Iir;
end Find_Name_In_List;
+ function Find_Name_In_Flist (List : Iir_Flist; Lit : Name_Id) return Iir
+ is
+ El : Iir;
+ begin
+ for I in Flist_First .. Flist_Last (List) loop
+ El := Get_Nth_Element (List, I);
+ if Get_Identifier (El) = Lit then
+ return El;
+ end if;
+ end loop;
+ return Null_Iir;
+ end Find_Name_In_Flist;
+
function Find_Name_In_Chain (Chain: Iir; Lit: Name_Id) return Iir
is
El: Iir := Chain;
@@ -1129,13 +1143,12 @@ package body Iirs_Utils is
pragma Assert (Get_Constraint_State (Def) = Fully_Constrained);
declare
- El_List : constant Iir_List :=
+ El_List : constant Iir_Flist :=
Get_Elements_Declaration_List (Def);
El : Iir;
begin
- for I in Natural loop
+ for I in Flist_First .. Flist_Last (El_List) loop
El := Get_Nth_Element (El_List, I);
- exit when El = Null_Iir;
if not Are_Bounds_Locally_Static (Get_Type (El)) then
return False;
end if;