summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold2014-12-13 17:10:02 +0100
committerTristan Gingold2014-12-13 17:10:02 +0100
commit7b8fae820dc02d90e4739ebaf67754bcbbb4dd9c (patch)
tree8b8cc16649fd4e96e0ff03700fccd2e7f606d9c9
parent0c655ec98435f5d9bdfb51cab215002d794c263f (diff)
downloadghdl-7b8fae820dc02d90e4739ebaf67754bcbbb4dd9c.tar.gz
ghdl-7b8fae820dc02d90e4739ebaf67754bcbbb4dd9c.tar.bz2
ghdl-7b8fae820dc02d90e4739ebaf67754bcbbb4dd9c.zip
iirs: move delay_mechanism to flag1; adjust xtools/pnodes.py for new sources.
-rw-r--r--src/vhdl/iirs.adb9
-rw-r--r--src/vhdl/iirs.adb.in5
-rw-r--r--src/vhdl/iirs.ads6
-rw-r--r--src/vhdl/nodes_meta.adb6
-rw-r--r--src/xtools/Makefile10
-rwxr-xr-xsrc/xtools/pnodes.py8
6 files changed, 27 insertions, 17 deletions
diff --git a/src/vhdl/iirs.adb b/src/vhdl/iirs.adb
index 876d146..7d2eb67 100644
--- a/src/vhdl/iirs.adb
+++ b/src/vhdl/iirs.adb
@@ -203,6 +203,11 @@ package body Iirs is
return Iir (L);
end Location_Type_To_Iir;
+ function Boolean_To_Iir_Delay_Mechanism is new Ada.Unchecked_Conversion
+ (Source => Boolean, Target => Iir_Delay_Mechanism);
+ function Iir_Delay_Mechanism_To_Boolean is new Ada.Unchecked_Conversion
+ (Source => Iir_Delay_Mechanism, Target => Boolean);
+
function Iir_To_String_Id is new Ada.Unchecked_Conversion
(Source => Iir, Target => String_Id);
function String_Id_To_Iir is new Ada.Unchecked_Conversion
@@ -2639,14 +2644,14 @@ package body Iirs is
begin
pragma Assert (Target /= Null_Iir);
pragma Assert (Has_Delay_Mechanism (Get_Kind (Target)));
- return Iir_Delay_Mechanism'Val (Get_Field12 (Target));
+ return Boolean_To_Iir_Delay_Mechanism (Get_Flag1 (Target));
end Get_Delay_Mechanism;
procedure Set_Delay_Mechanism (Target : Iir; Kind : Iir_Delay_Mechanism) is
begin
pragma Assert (Target /= Null_Iir);
pragma Assert (Has_Delay_Mechanism (Get_Kind (Target)));
- Set_Field12 (Target, Iir_Delay_Mechanism'Pos (Kind));
+ Set_Flag1 (Target, Iir_Delay_Mechanism_To_Boolean (Kind));
end Set_Delay_Mechanism;
function Get_Reject_Time_Expression (Target : Iir) return Iir is
diff --git a/src/vhdl/iirs.adb.in b/src/vhdl/iirs.adb.in
index 04511bb..b44eb4f 100644
--- a/src/vhdl/iirs.adb.in
+++ b/src/vhdl/iirs.adb.in
@@ -203,6 +203,11 @@ package body Iirs is
return Iir (L);
end Location_Type_To_Iir;
+ function Boolean_To_Iir_Delay_Mechanism is new Ada.Unchecked_Conversion
+ (Source => Boolean, Target => Iir_Delay_Mechanism);
+ function Iir_Delay_Mechanism_To_Boolean is new Ada.Unchecked_Conversion
+ (Source => Iir_Delay_Mechanism, Target => Boolean);
+
function Iir_To_String_Id is new Ada.Unchecked_Conversion
(Source => Iir, Target => String_Id);
function String_Id_To_Iir is new Ada.Unchecked_Conversion
diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads
index cd58daa..28c1148 100644
--- a/src/vhdl/iirs.ads
+++ b/src/vhdl/iirs.ads
@@ -2387,7 +2387,7 @@ package Iirs is
-- assignment guarded, the guard can be this assignment.
-- Get/Set_Guard (Field8)
--
- -- Get/Set_Delay_Mechanism (Field12)
+ -- Get/Set_Delay_Mechanism (Flag1)
--
-- Get/Set_Postponed_Flag (Flag3)
--
@@ -2767,7 +2767,7 @@ package Iirs is
--
-- Get/Set_Reject_Time_Expression (Field6)
--
- -- Get/Set_Delay_Mechanism (Field12)
+ -- Get/Set_Delay_Mechanism (Flag1)
--
-- Get/Set_Visible_Flag (Flag4)
--
@@ -5747,7 +5747,7 @@ package Iirs is
function Get_Guard (Target : Iir) return Iir;
procedure Set_Guard (Target : Iir; Guard : Iir);
- -- Field: Field12 (pos)
+ -- Field: Flag1 (uc)
function Get_Delay_Mechanism (Target : Iir) return Iir_Delay_Mechanism;
procedure Set_Delay_Mechanism (Target : Iir; Kind : Iir_Delay_Mechanism);
diff --git a/src/vhdl/nodes_meta.adb b/src/vhdl/nodes_meta.adb
index 3e038f5..b890c46 100644
--- a/src/vhdl/nodes_meta.adb
+++ b/src/vhdl/nodes_meta.adb
@@ -3323,8 +3323,8 @@ package body Nodes_Meta is
Field_Parent,
Field_Callees_List,
-- Iir_Kind_Concurrent_Conditional_Signal_Assignment
- Field_Delay_Mechanism,
Field_Label,
+ Field_Delay_Mechanism,
Field_Postponed_Flag,
Field_Visible_Flag,
Field_Guarded_Target_State,
@@ -3336,8 +3336,8 @@ package body Nodes_Meta is
Field_Guard,
Field_Parent,
-- Iir_Kind_Concurrent_Selected_Signal_Assignment
- Field_Delay_Mechanism,
Field_Label,
+ Field_Delay_Mechanism,
Field_Postponed_Flag,
Field_Visible_Flag,
Field_Guarded_Target_State,
@@ -3443,8 +3443,8 @@ package body Nodes_Meta is
Field_Tolerance,
Field_Parent,
-- Iir_Kind_Signal_Assignment_Statement
- Field_Delay_Mechanism,
Field_Label,
+ Field_Delay_Mechanism,
Field_Visible_Flag,
Field_Guarded_Target_State,
Field_Target,
diff --git a/src/xtools/Makefile b/src/xtools/Makefile
index 6504fbc..a136dd7 100644
--- a/src/xtools/Makefile
+++ b/src/xtools/Makefile
@@ -15,21 +15,21 @@
# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-DEPS=../iirs.ads ../nodes.ads ./pnodes.py
+DEPS=../vhdl/iirs.ads ../vhdl/nodes.ads ./pnodes.py
-all: ../iirs.adb ../nodes_meta.ads ../nodes_meta.adb
+all: ../vhdl/iirs.adb ../vhdl/nodes_meta.ads ../vhdl/nodes_meta.adb
-../iirs.adb: ../iirs.adb.in $(DEPS)
+../vhdl/iirs.adb: ../vhdl/iirs.adb.in $(DEPS)
$(RM) $@
./pnodes.py body > $@
chmod -w $@
-../nodes_meta.ads: ../nodes_meta.ads.in $(DEPS)
+../vhdl/nodes_meta.ads: ../vhdl/nodes_meta.ads.in $(DEPS)
$(RM) $@
./pnodes.py meta_specs > $@
chmod -w $@
-../nodes_meta.adb: ../nodes_meta.adb.in $(DEPS)
+../vhdl/nodes_meta.adb: ../vhdl/nodes_meta.adb.in $(DEPS)
$(RM) $@
./pnodes.py meta_body > $@
chmod -w $@
diff --git a/src/xtools/pnodes.py b/src/xtools/pnodes.py
index 364f125..e00cf4d 100755
--- a/src/xtools/pnodes.py
+++ b/src/xtools/pnodes.py
@@ -4,10 +4,10 @@ import re
import sys
import argparse
-field_file = "../nodes.ads"
-spec_file = "../iirs.ads"
-template_file = "../iirs.adb.in"
-meta_base_file = "../nodes_meta"
+field_file = "../vhdl/nodes.ads"
+spec_file = "../vhdl/iirs.ads"
+template_file = "../vhdl/iirs.adb.in"
+meta_base_file = "../vhdl/nodes_meta"
prefix_name = "Iir_Kind_"
prefix_range_name = "Iir_Kinds_"
type_name = "Iir_Kind"