summaryrefslogtreecommitdiff
path: root/iirs.adb.in
diff options
context:
space:
mode:
authorTristan Gingold2014-10-14 06:19:33 +0200
committerTristan Gingold2014-10-14 06:19:33 +0200
commit0e199cbea1070c016d29348cd659b9e6ca688afb (patch)
tree169e2c21b5e84998f03c2de76feed3e61cea503c /iirs.adb.in
parent68d26922e31aad3cb34dd3b7689bcec75ad70fcb (diff)
downloadghdl-0e199cbea1070c016d29348cd659b9e6ca688afb.tar.gz
ghdl-0e199cbea1070c016d29348cd659b9e6ca688afb.tar.bz2
ghdl-0e199cbea1070c016d29348cd659b9e6ca688afb.zip
Initial support for package header and package instantiation.
Diffstat (limited to 'iirs.adb.in')
-rw-r--r--iirs.adb.in38
1 files changed, 10 insertions, 28 deletions
diff --git a/iirs.adb.in b/iirs.adb.in
index 2ed914d..9c2319a 100644
--- a/iirs.adb.in
+++ b/iirs.adb.in
@@ -149,34 +149,6 @@ package body Iirs is
return Iir_Kind'Val (Get_Nkind (An_Iir));
end Get_Kind;
- procedure Set_Pos_Line_Off (Design_Unit: Iir_Design_Unit;
- Pos : Source_Ptr; Line, Off: Natural) is
- begin
- Set_Field4 (Design_Unit, Node_Type (Pos));
- Set_Field11 (Design_Unit, Node_Type (Off));
- Set_Field12 (Design_Unit, Node_Type (Line));
- end Set_Pos_Line_Off;
-
- procedure Get_Pos_Line_Off (Design_Unit: Iir_Design_Unit;
- Pos : out Source_Ptr; Line, Off: out Natural) is
- begin
- Pos := Source_Ptr (Get_Field4 (Design_Unit));
- Off := Natural (Get_Field11 (Design_Unit));
- Line := Natural (Get_Field12 (Design_Unit));
- end Get_Pos_Line_Off;
-
- -----------
- -- Lists --
- -----------
-
- -- Layout of lists:
- -- A list is stored into an IIR.
- -- There are two bounds for a list:
- -- the current number of elements
- -- the maximum number of elements.
- -- Using a maximum number of element bound (which can be increased) avoid
- -- to reallocating memory at each insertion.
-
function Time_Stamp_Id_To_Iir is new Ada.Unchecked_Conversion
(Source => Time_Stamp_Id, Target => Iir);
@@ -225,6 +197,16 @@ package body Iirs is
function Iir_Int32_To_Iir is new Ada.Unchecked_Conversion
(Source => Iir_Int32, Target => Iir);
+ function Iir_To_Source_Ptr (N : Iir) return Source_Ptr is
+ begin
+ return Source_Ptr (N);
+ end Iir_To_Source_Ptr;
+
+ function Source_Ptr_To_Iir (P : Source_Ptr) return Iir is
+ begin
+ return Iir (P);
+ end Source_Ptr_To_Iir;
+
function Iir_To_Location_Type (N : Iir) return Location_Type is
begin
return Location_Type (N);