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 | |
parent | dbe9a179e3ea356c8c21b95c650d3b7f3de8055f (diff) | |
download | ghdl-c69c9c51c9235835bb876e4373bb4c784cf7c96d.tar.gz ghdl-c69c9c51c9235835bb876e4373bb4c784cf7c96d.tar.bz2 ghdl-c69c9c51c9235835bb876e4373bb4c784cf7c96d.zip |
vhdl-nodes: use a flag field for direction.
-rw-r--r-- | src/vhdl/vhdl-nodes.adb | 9 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.adb.in | 5 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 4 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes_meta.adb | 2 |
4 files changed, 15 insertions, 5 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 diff --git a/src/vhdl/vhdl-nodes.adb.in b/src/vhdl/vhdl-nodes.adb.in index b19174d3f..913f54f7e 100644 --- a/src/vhdl/vhdl-nodes.adb.in +++ b/src/vhdl/vhdl-nodes.adb.in @@ -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 diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index bc37733d6..2460e7bfc 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -2927,7 +2927,7 @@ package Vhdl.Nodes is -- -- Get/Set_Expr_Staticness (State1) -- - -- Get/Set_Direction (State2) + -- Get/Set_Direction (Flag1) -- Iir_Kind_Subtype_Definition (Medium) -- Such a node is only created by parse and transformed into the correct @@ -7866,7 +7866,7 @@ package Vhdl.Nodes is function Get_Range_Constraint (Target : Iir) return Iir; procedure Set_Range_Constraint (Target : Iir; Constraint : Iir); - -- Field: State2 (pos) + -- Field: Flag1 (uc) function Get_Direction (Decl : Iir) return Direction_Type; procedure Set_Direction (Decl : Iir; Dir : Direction_Type); diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb index cce8999d6..a105ad5fc 100644 --- a/src/vhdl/vhdl-nodes_meta.adb +++ b/src/vhdl/vhdl-nodes_meta.adb @@ -2993,8 +2993,8 @@ package body Vhdl.Nodes_Meta is Field_Type_Declarator, Field_Base_Type, -- Iir_Kind_Range_Expression - Field_Expr_Staticness, Field_Direction, + Field_Expr_Staticness, Field_Left_Limit_Expr, Field_Right_Limit_Expr, Field_Range_Origin, |