aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-canon.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-04 15:40:33 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-04 15:40:33 +0100
commitc7f7cdffe62bf0f9939c8f4b86ccb0d4ba870599 (patch)
tree7680e9d51ae2b264f2417cfe5d7cea95e9315a55 /src/vhdl/vhdl-canon.adb
parentad571771adbb27b43a9470f96dcb42db8a51c79a (diff)
downloadghdl-c7f7cdffe62bf0f9939c8f4b86ccb0d4ba870599.tar.gz
ghdl-c7f7cdffe62bf0f9939c8f4b86ccb0d4ba870599.tar.bz2
ghdl-c7f7cdffe62bf0f9939c8f4b86ccb0d4ba870599.zip
vhdl-sem_inst: handle suspend_state
Diffstat (limited to 'src/vhdl/vhdl-canon.adb')
-rw-r--r--src/vhdl/vhdl-canon.adb11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vhdl/vhdl-canon.adb b/src/vhdl/vhdl-canon.adb
index cad575929..c8e71807e 100644
--- a/src/vhdl/vhdl-canon.adb
+++ b/src/vhdl/vhdl-canon.adb
@@ -1357,7 +1357,7 @@ package body Vhdl.Canon is
end Canon_Sequential_Stmts;
function Canon_Insert_Suspend_State_Statement (Stmt : Iir; Var : Iir)
- return Iir
+ return Iir
is
Last : Iir;
Num : Int32;
@@ -1367,17 +1367,20 @@ package body Vhdl.Canon is
Location_Copy (Res, Stmt);
Set_Parent (Res, Get_Parent (Stmt));
Set_Chain (Res, Stmt);
+ Set_Suspend_State_Decl (Res, Var);
+
+ Last := Get_Suspend_State_Last (Var);
+ Set_Suspend_State_Last (Var, Res);
- Last := Get_Suspend_State_Chain (Var);
if Last = Null_Iir then
Num := 0;
+ Set_Suspend_State_Chain (Var, Res);
else
Num := Get_Suspend_State_Index (Last);
+ Set_Suspend_State_Chain (Last, Res);
end if;
Set_Suspend_State_Index (Res, Num + 1);
- Set_Suspend_State_Chain (Res, Last);
- Set_Suspend_State_Chain (Var, Res);
return Res;
end Canon_Insert_Suspend_State_Statement;