experimenting udi implementation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-05-18 13:47:37 +09:00
parent f08ba4cd12
commit 35929b8c88
4 changed files with 75 additions and 21 deletions

View File

@ -1242,12 +1242,6 @@ static void pop_fnblk (hcl_t* hcl)
}
}
void hcl_clearfnblks (hcl_t* hcl)
{
while (hcl->c->fnblk.depth >= 0) pop_fnblk (hcl);
HCL_ASSERT (hcl, hcl->c->fnblk.depth == -1);
}
/* ========================================================================= */
static HCL_INLINE int _insert_cframe (hcl_t* hcl, hcl_ooi_t index, int opcode, hcl_cnode_t* operand)
{
@ -5897,7 +5891,8 @@ int hcl_compile (hcl_t* hcl, hcl_cnode_t* obj, int flags)
* in the interactive mode, the information doesn't have
* to get carried over.
*/
hcl_clearfnblks (hcl);
while (hcl->c->fnblk.depth >= 0) pop_fnblk (hcl);
HCL_ASSERT (hcl, hcl->c->fnblk.depth == -1);
/* it will be recreated below */
}
if (flags & HCL_COMPILE_CLEAR_CODE) hcl_clearcode (hcl);
@ -6203,9 +6198,6 @@ int hcl_compile (hcl_t* hcl, hcl_cnode_t* obj, int flags)
HCL_ASSERT (hcl, hcl->c->fnblk.depth == 0); /* ensure the virtual function block be the only one left */
hcl->code.ngtmprs = hcl->c->fnblk.info[0].tmprcnt; /* populate the number of global temporary variables */
/* TODO: delete all !defined(CLEAR_FNBLK_ALWAYS) code
* keep only defined(CLEAR_FNBLK_ALWAYS) code.
* not clearing the top fnblk for the reuse doesn't look very beneficial */
#if defined(CLEAR_FNBLK_ALWAYS)
pop_fnblk (hcl);
HCL_ASSERT (hcl, hcl->c->tv.s.len == 0);