You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to emit code from my front end in a single pass, but also would like to support nested functions. I saw the documentation that says only one function can be created at a time, and also that curr_func is asserted in mir.c.
From my naive scan of where curr_func is used though, it looks like there's not much preventing multiple active functions, other than the signature of MIR_finish_func would need to take the function, rather than assuming a global single one.
Is that a reasonable change to try to make? Or are there other hidden dependencies on only having a single function at a time?
(To be clear, I don't need/want MIR to support access to outer scopes or anything like that, I just want to be able to add instructions, etc. to a second function before finishing the first one.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm trying to emit code from my front end in a single pass, but also would like to support nested functions. I saw the documentation that says only one function can be created at a time, and also that
curr_func
is asserted in mir.c.From my naive scan of where
curr_func
is used though, it looks like there's not much preventing multiple active functions, other than the signature ofMIR_finish_func
would need to take the function, rather than assuming a global single one.Is that a reasonable change to try to make? Or are there other hidden dependencies on only having a single function at a time?
(To be clear, I don't need/want MIR to support access to outer scopes or anything like that, I just want to be able to add instructions, etc. to a second function before finishing the first one.)
Thanks, Scott
Beta Was this translation helpful? Give feedback.
All reactions