diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-08 06:16:36 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-08 06:16:36 +0100 |
commit | 4035edd1239f927ebd50fad88f01786db4d6a262 (patch) | |
tree | d9ca5a3210b18774b1646eb39b0a393dfb8cef1c /src/vhdl | |
parent | 6a7904b43d7741778db890d5b59057059254b520 (diff) | |
download | ghdl-4035edd1239f927ebd50fad88f01786db4d6a262.tar.gz ghdl-4035edd1239f927ebd50fad88f01786db4d6a262.tar.bz2 ghdl-4035edd1239f927ebd50fad88f01786db4d6a262.zip |
Remove List_Others, cleanup lists.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/disp_tree.adb | 59 | ||||
-rw-r--r-- | src/vhdl/iirs.ads | 5 | ||||
-rw-r--r-- | src/vhdl/nodes_gc.adb | 6 | ||||
-rw-r--r-- | src/vhdl/sem_inst.adb | 9 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap2.adb | 3 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap9.adb | 3 |
6 files changed, 35 insertions, 50 deletions
diff --git a/src/vhdl/disp_tree.adb b/src/vhdl/disp_tree.adb index c01dd61cd..111e9dee4 100644 --- a/src/vhdl/disp_tree.adb +++ b/src/vhdl/disp_tree.adb @@ -69,21 +69,20 @@ package body Disp_Tree is is El: Iir; begin - if Tree_List = Null_Iir_List then - Put_Line ("null-list"); - elsif Tree_List = Iir_List_All then - Put_Line ("list-all"); - elsif Tree_List = Iir_List_Others then - Put_Line ("list-others"); - else - New_Line; - for I in Natural loop - El := Get_Nth_Element (Tree_List, I); - exit when El = Null_Iir; - Put_Indent (Tab); - Disp_Iir (El, Tab + 1, Depth); - end loop; - end if; + case Tree_List is + when Null_Iir_List => + Put_Line ("null-list"); + when Iir_List_All => + Put_Line ("list-all"); + when others => + New_Line; + for I in Natural loop + El := Get_Nth_Element (Tree_List, I); + exit when El = Null_Iir; + Put_Indent (Tab); + Disp_Iir (El, Tab + 1, Depth); + end loop; + end case; end Disp_Iir_List; procedure Disp_Iir_Flist @@ -136,22 +135,20 @@ package body Disp_Tree is is El: Iir; begin - if Tree_List = Null_Iir_List then - Put_Indent (Tab); - Put_Line (" null-list"); - elsif Tree_List = Iir_List_All then - Put_Indent (Tab); - Put_Line (" list-all"); - elsif Tree_List = Iir_List_Others then - Put_Indent (Tab); - Put_Line (" list-others"); - else - for I in Natural loop - El := Get_Nth_Element (Tree_List, I); - exit when El = Null_Iir; - Disp_Iir (El, Tab, 0); - end loop; - end if; + case Tree_List is + when Null_Iir_List => + Put_Indent (Tab); + Put_Line (" null-list"); + when Iir_List_All => + Put_Indent (Tab); + Put_Line (" list-all"); + when others => + for I in Natural loop + El := Get_Nth_Element (Tree_List, I); + exit when El = Null_Iir; + Disp_Iir (El, Tab, 0); + end loop; + end case; end Disp_Tree_List_Flat; function Image_Name_Id (Ident: Name_Id) return String diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads index 3ae0e30d6..f40b64eb8 100644 --- a/src/vhdl/iirs.ads +++ b/src/vhdl/iirs.ads @@ -5358,9 +5358,6 @@ package Iirs is subtype Iir_List is Lists.List_Type; Null_Iir_List : constant Iir_List := Lists.Null_List; Iir_List_All : constant Iir_List := Lists.List_All; - Iir_List_Others : constant Iir_List := Lists.List_Others; - subtype Iir_Lists_All_Others is Iir_List - range Iir_List_Others .. Iir_List_All; Null_Iir : constant Iir := Nodes.Null_Node; @@ -5397,8 +5394,6 @@ package Iirs is renames Lists.Set_Nbr_Elements; function Get_First_Element (L : Iir_List) return Iir renames Lists.Get_First_Element; - function Get_Last_Element (L : Iir_List) return Iir - renames Lists.Get_Last_Element; function "=" (L, R : Iir_List) return Boolean renames Lists."="; subtype Iir_Flist is Flists.Flist_Type; diff --git a/src/vhdl/nodes_gc.adb b/src/vhdl/nodes_gc.adb index e9886d13b..89da35c4e 100644 --- a/src/vhdl/nodes_gc.adb +++ b/src/vhdl/nodes_gc.adb @@ -66,8 +66,7 @@ package body Nodes_GC is begin case N is when Null_Iir_List - | Iir_List_All - | Iir_List_Others => + | Iir_List_All => null; when others => for I in Natural loop @@ -84,8 +83,7 @@ package body Nodes_GC is begin case N is when Null_Iir_List - | Iir_List_All - | Iir_List_Others => + | Iir_List_All => null; when others => for I in Natural loop diff --git a/src/vhdl/sem_inst.adb b/src/vhdl/sem_inst.adb index 10eac72dd..30785dbb3 100644 --- a/src/vhdl/sem_inst.adb +++ b/src/vhdl/sem_inst.adb @@ -172,8 +172,7 @@ package body Sem_Inst is begin case L is when Null_Iir_List - | Iir_List_All - | Iir_List_Others => + | Iir_List_All => return L; when others => Res := Create_Iir_List; @@ -756,8 +755,7 @@ package body Sem_Inst is begin case N is when Null_Iir_List - | Iir_List_All - | Iir_List_Others => + | Iir_List_All => pragma Assert (Inst = N); return; when others => @@ -1126,8 +1124,7 @@ package body Sem_Inst is begin case L is when Null_Iir_List - | Iir_List_All - | Iir_List_Others => + | Iir_List_All => return; when others => for I in Natural loop diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb index d975a2ac1..c3260008f 100644 --- a/src/vhdl/translate/trans-chap2.adb +++ b/src/vhdl/translate/trans-chap2.adb @@ -1122,8 +1122,7 @@ package body Trans.Chap2 is begin case L is when Null_Iir_List - | Iir_List_All - | Iir_List_Others => + | Iir_List_All => return; when others => for I in Natural loop diff --git a/src/vhdl/translate/trans-chap9.adb b/src/vhdl/translate/trans-chap9.adb index c6a900855..0b2d3dc2a 100644 --- a/src/vhdl/translate/trans-chap9.adb +++ b/src/vhdl/translate/trans-chap9.adb @@ -1115,8 +1115,7 @@ package body Trans.Chap9 is begin case L is when Null_Iir_List - | Iir_List_All - | Iir_List_Others => + | Iir_List_All => return; when others => for I in Natural loop |