diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-05-20 19:05:22 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-05-20 19:05:22 +0200 |
commit | c69c9c51c9235835bb876e4373bb4c784cf7c96d (patch) | |
tree | f0a83fef39d361c2f922ba02a80510733feba533 /src/vhdl/vhdl-nodes.adb | |
parent | dbe9a179e3ea356c8c21b95c650d3b7f3de8055f (diff) | |
download | ghdl-c69c9c51c9235835bb876e4373bb4c784cf7c96d.tar.gz ghdl-c69c9c51c9235835bb876e4373bb4c784cf7c96d.tar.bz2 ghdl-c69c9c51c9235835bb876e4373bb4c784cf7c96d.zip |
vhdl-nodes: use a flag field for direction.
Diffstat (limited to 'src/vhdl/vhdl-nodes.adb')
-rw-r--r-- | src/vhdl/vhdl-nodes.adb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb index c38a8950a..b25ed90a4 100644 --- a/src/vhdl/vhdl-nodes.adb +++ b/src/vhdl/vhdl-nodes.adb @@ -945,6 +945,11 @@ package body Vhdl.Nodes is function Iir_Signal_Kind_To_Boolean is new Ada.Unchecked_Conversion (Source => Iir_Signal_Kind, Target => Boolean); + function Boolean_To_Direction_Type is new Ada.Unchecked_Conversion + (Source => Boolean, Target => Direction_Type); + function Direction_Type_To_Boolean is new Ada.Unchecked_Conversion + (Source => Direction_Type, Target => Boolean); + function Iir_To_String8_Id is new Ada.Unchecked_Conversion (Source => Iir, Target => String8_Id); function String8_Id_To_Iir is new Ada.Unchecked_Conversion @@ -3675,7 +3680,7 @@ package body Vhdl.Nodes is pragma Assert (Decl /= Null_Iir); pragma Assert (Has_Direction (Get_Kind (Decl)), "no field Direction"); - return Direction_Type'Val (Get_State2 (Decl)); + return Boolean_To_Direction_Type (Get_Flag1 (Decl)); end Get_Direction; procedure Set_Direction (Decl : Iir; Dir : Direction_Type) is @@ -3683,7 +3688,7 @@ package body Vhdl.Nodes is pragma Assert (Decl /= Null_Iir); pragma Assert (Has_Direction (Get_Kind (Decl)), "no field Direction"); - Set_State2 (Decl, Direction_Type'Pos (Dir)); + Set_Flag1 (Decl, Direction_Type_To_Boolean (Dir)); end Set_Direction; function Get_Left_Limit (Decl : Iir_Range_Expression) return Iir is |