aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-08 05:58:16 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-08 05:58:16 +0100
commita4073d46d4757361e4a88fee7edbc62ee495b3c6 (patch)
tree25a625910e10996df2ba9c297c114d3caa377cf4
parent9e01b1290d44a275160a0d87454e35918fe0d2e5 (diff)
downloadghdl-a4073d46d4757361e4a88fee7edbc62ee495b3c6.tar.gz
ghdl-a4073d46d4757361e4a88fee7edbc62ee495b3c6.tar.bz2
ghdl-a4073d46d4757361e4a88fee7edbc62ee495b3c6.zip
Use flist for entity_name_list.
-rw-r--r--src/vhdl/disp_vhdl.adb11
-rw-r--r--src/vhdl/iirs.adb8
-rw-r--r--src/vhdl/iirs.ads4
-rw-r--r--src/vhdl/nodes_meta.adb10
-rw-r--r--src/vhdl/parse.adb8
-rw-r--r--src/vhdl/sem_decls.adb2
-rw-r--r--src/vhdl/sem_specs.adb11
7 files changed, 27 insertions, 27 deletions
diff --git a/src/vhdl/disp_vhdl.adb b/src/vhdl/disp_vhdl.adb
index e36e1e1fd..9e14648cd 100644
--- a/src/vhdl/disp_vhdl.adb
+++ b/src/vhdl/disp_vhdl.adb
@@ -1607,19 +1607,18 @@ package body Disp_Vhdl is
Put (Tokens.Image (Tok));
end Disp_Entity_Kind;
- procedure Disp_Entity_Name_List (List : Iir_List)
+ procedure Disp_Entity_Name_List (List : Iir_Flist)
is
El : Iir;
begin
- if List = Iir_List_All then
+ if List = Iir_Flist_All then
Put ("all");
- elsif List = Iir_List_Others then
+ elsif List = Iir_Flist_Others then
Put ("others");
else
- for I in Natural loop
+ for I in Flist_First .. Flist_Last (List) loop
El := Get_Nth_Element (List, I);
- exit when El = Null_Iir;
- if I /= 0 then
+ if I /= Flist_First then
Put (", ");
end if;
if Get_Kind (El) = Iir_Kind_Signature then
diff --git a/src/vhdl/iirs.adb b/src/vhdl/iirs.adb
index d3210dfaa..3e0e7b70a 100644
--- a/src/vhdl/iirs.adb
+++ b/src/vhdl/iirs.adb
@@ -1211,20 +1211,20 @@ package body Iirs is
Set_Field3 (Target, Token_Type_To_Iir (Kind));
end Set_Entity_Class;
- function Get_Entity_Name_List (Target : Iir) return Iir_List is
+ function Get_Entity_Name_List (Target : Iir) return Iir_Flist is
begin
pragma Assert (Target /= Null_Iir);
pragma Assert (Has_Entity_Name_List (Get_Kind (Target)),
"no field Entity_Name_List");
- return Iir_To_Iir_List (Get_Field8 (Target));
+ return Iir_To_Iir_Flist (Get_Field8 (Target));
end Get_Entity_Name_List;
- procedure Set_Entity_Name_List (Target : Iir; Names : Iir_List) is
+ procedure Set_Entity_Name_List (Target : Iir; Names : Iir_Flist) is
begin
pragma Assert (Target /= Null_Iir);
pragma Assert (Has_Entity_Name_List (Get_Kind (Target)),
"no field Entity_Name_List");
- Set_Field8 (Target, Iir_List_To_Iir (Names));
+ Set_Field8 (Target, Iir_Flist_To_Iir (Names));
end Set_Entity_Name_List;
function Get_Attribute_Designator (Target : Iir) return Iir is
diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads
index de5348584..35ab56dd4 100644
--- a/src/vhdl/iirs.ads
+++ b/src/vhdl/iirs.ads
@@ -5985,8 +5985,8 @@ package Iirs is
procedure Set_Entity_Class (Target : Iir; Kind : Token_Type);
-- Field: Field8 (uc)
- function Get_Entity_Name_List (Target : Iir) return Iir_List;
- procedure Set_Entity_Name_List (Target : Iir; Names : Iir_List);
+ function Get_Entity_Name_List (Target : Iir) return Iir_Flist;
+ procedure Set_Entity_Name_List (Target : Iir; Names : Iir_Flist);
-- Field: Field6
function Get_Attribute_Designator (Target : Iir) return Iir;
diff --git a/src/vhdl/nodes_meta.adb b/src/vhdl/nodes_meta.adb
index 995d7bb88..9066426ca 100644
--- a/src/vhdl/nodes_meta.adb
+++ b/src/vhdl/nodes_meta.adb
@@ -58,7 +58,7 @@ package body Nodes_Meta is
Field_Literal_Subtype => Type_Iir,
Field_Allocator_Subtype => Type_Iir,
Field_Entity_Class => Type_Token_Type,
- Field_Entity_Name_List => Type_Iir_List,
+ Field_Entity_Name_List => Type_Iir_Flist,
Field_Attribute_Designator => Type_Iir,
Field_Attribute_Specification_Chain => Type_Iir,
Field_Attribute_Specification => Type_Iir,
@@ -5911,6 +5911,8 @@ package body Nodes_Meta is
case F is
when Field_Simple_Aggregate_List =>
return Get_Simple_Aggregate_List (N);
+ when Field_Entity_Name_List =>
+ return Get_Entity_Name_List (N);
when Field_Signal_List =>
return Get_Signal_List (N);
when Field_Enumeration_Literal_List =>
@@ -5943,6 +5945,8 @@ package body Nodes_Meta is
case F is
when Field_Simple_Aggregate_List =>
Set_Simple_Aggregate_List (N, V);
+ when Field_Entity_Name_List =>
+ Set_Entity_Name_List (N, V);
when Field_Signal_List =>
Set_Signal_List (N, V);
when Field_Enumeration_Literal_List =>
@@ -6095,8 +6099,6 @@ package body Nodes_Meta is
return Get_Dependence_List (N);
when Field_Analysis_Checks_List =>
return Get_Analysis_Checks_List (N);
- when Field_Entity_Name_List =>
- return Get_Entity_Name_List (N);
when Field_Sensitivity_List =>
return Get_Sensitivity_List (N);
when Field_Callees_List =>
@@ -6123,8 +6125,6 @@ package body Nodes_Meta is
Set_Dependence_List (N, V);
when Field_Analysis_Checks_List =>
Set_Analysis_Checks_List (N, V);
- when Field_Entity_Name_List =>
- Set_Entity_Name_List (N, V);
when Field_Sensitivity_List =>
Set_Sensitivity_List (N, V);
when Field_Callees_List =>
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb
index 58be80bea..a4a7b904b 100644
--- a/src/vhdl/parse.adb
+++ b/src/vhdl/parse.adb
@@ -3708,14 +3708,15 @@ package body Parse is
(Attribute : Iir_Attribute_Specification)
is
List : Iir_List;
+ Flist : Iir_Flist;
El : Iir;
begin
case Current_Token is
when Tok_All =>
- List := Iir_List_All;
+ Flist := Iir_Flist_All;
Scan;
when Tok_Others =>
- List := Iir_List_Others;
+ Flist := Iir_Flist_Others;
Scan;
when others =>
List := Create_Iir_List;
@@ -3725,8 +3726,9 @@ package body Parse is
exit when Current_Token /= Tok_Comma;
Scan;
end loop;
+ Flist := List_To_Flist (List);
end case;
- Set_Entity_Name_List (Attribute, List);
+ Set_Entity_Name_List (Attribute, Flist);
if Current_Token = Tok_Colon then
Scan;
Set_Entity_Class (Attribute, Parse_Entity_Class);
diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb
index 9d3b71b5e..387aceeb6 100644
--- a/src/vhdl/sem_decls.adb
+++ b/src/vhdl/sem_decls.adb
@@ -3007,7 +3007,7 @@ package body Sem_Decls is
Sem_Attribute_Declaration (Decl);
when Iir_Kind_Attribute_Specification =>
Sem_Attribute_Specification (Decl, Parent);
- if Get_Entity_Name_List (Decl) in Iir_Lists_All_Others then
+ if Get_Entity_Name_List (Decl) in Iir_Flists_All_Others then
Set_Attribute_Specification_Chain (Decl, Attr_Spec_Chain);
Attr_Spec_Chain := Decl;
end if;
diff --git a/src/vhdl/sem_specs.adb b/src/vhdl/sem_specs.adb
index a8a921c7b..2c94e0622 100644
--- a/src/vhdl/sem_specs.adb
+++ b/src/vhdl/sem_specs.adb
@@ -705,7 +705,7 @@ package body Sem_Specs is
Name : Iir;
Attr : Iir_Attribute_Declaration;
Attr_Type : Iir;
- List : Iir_List;
+ List : Iir_Flist;
Expr : Iir;
Res : Boolean;
begin
@@ -766,7 +766,7 @@ package body Sem_Specs is
-- implicitly and explicitly defined, that inherit the attribute, as
-- defined below:
List := Get_Entity_Name_List (Spec);
- if List = Iir_List_All then
+ if List = Iir_Flist_All then
-- o If the reserved word ALL is supplied, then the attribute
-- specification applies to all named entities of the specified
-- class that are declared in the immediatly enclosing
@@ -777,7 +777,7 @@ package body Sem_Specs is
(Warnid_Specs, +Spec,
"attribute specification apply to no named entity");
end if;
- elsif List = Iir_List_Others then
+ elsif List = Iir_Flist_Others then
-- o If the reserved word OTHERS is supplied, then the attribute
-- specification applies to named entities of the specified class
-- that are declared in the immediately enclosing declarative
@@ -797,9 +797,8 @@ package body Sem_Specs is
declare
El : Iir;
begin
- for I in Natural loop
+ for I in Flist_First .. Flist_Last (List) loop
El := Get_Nth_Element (List, I);
- exit when El = Null_Iir;
if Get_Kind (El) = Iir_Kind_Signature then
Sem_Signature_Entity_Designator (El, Spec);
else
@@ -892,7 +891,7 @@ package body Sem_Specs is
Spec := Get_Attribute_Specification_Chain (Spec);
end if;
while Spec /= Null_Iir loop
- pragma Assert (Get_Entity_Name_List (Spec) in Iir_Lists_All_Others);
+ pragma Assert (Get_Entity_Name_List (Spec) in Iir_Flists_All_Others);
Ent_Class := Get_Entity_Class (Spec);
if Ent_Class = Decl_Class or Ent_Class = Decl_Class2 then
Has_Error := False;