aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-utils.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-11 20:55:41 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-12 06:44:25 +0100
commitf3eba1ac1ef38f7708154e594ede3f72db78105b (patch)
tree7164e9edc9996a4eca8bf53dba7de372f4df5b77 /src/vhdl/vhdl-utils.ads
parent783074260833160bfc3ef8f9203147e752e6269e (diff)
downloadghdl-f3eba1ac1ef38f7708154e594ede3f72db78105b.tar.gz
ghdl-f3eba1ac1ef38f7708154e594ede3f72db78105b.tar.bz2
ghdl-f3eba1ac1ef38f7708154e594ede3f72db78105b.zip
vhdl: clear associated_type in Sem_Generic_Association_Chain
So that it is cleared after use.
Diffstat (limited to 'src/vhdl/vhdl-utils.ads')
-rw-r--r--src/vhdl/vhdl-utils.ads18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-utils.ads b/src/vhdl/vhdl-utils.ads
index 01425a157..8cce0eb14 100644
--- a/src/vhdl/vhdl-utils.ads
+++ b/src/vhdl/vhdl-utils.ads
@@ -94,6 +94,18 @@ package Vhdl.Utils is
-- interface (initialized to the association chain and interface chain).
-- The function Get_Association_Interface return the interface associated
-- to ASSOC,and Next_Association_Interface updates ASSOC and INTER.
+ --
+ -- Usage:
+ -- Assoc := Get_xxx_Association_Chain (X);
+ -- Assoc_Inter := Get_xxx_Declaration_Chain (Y);
+ -- while Assoc /= Null_Iir loop
+ -- Inter := Get_Association_Interface (Assoc, Assoc_Inter);
+ -- ...
+ -- Next_Association_Interface (Assoc, Assoc_Inter);
+ -- end loop;
+ --
+ -- Note: This iterates over association, so unassociated interfaces are
+ -- not iterated.
function Get_Association_Interface (Assoc : Iir; Inter : Iir) return Iir;
procedure Next_Association_Interface
(Assoc : in out Iir; Inter : in out Iir);
@@ -116,6 +128,12 @@ package Vhdl.Utils is
-- variable).
function Is_Copyback_Parameter (Inter : Iir) return Boolean;
+ -- Set/clear the Associated_XXX fields of type, package and subprogram
+ -- interfaces.
+ -- For set, check they were previously cleared.
+ procedure Set_Interface_Associated (Inter_Chain : Iir; Assoc_Chain : Iir);
+ procedure Clear_Interface_Associated (Inter_Chain : Iir);
+
-- Duplicate enumeration literal LIT.
function Copy_Enumeration_Literal (Lit : Iir) return Iir;