On Fri Jun 23 20:41:40 2023 +0000, Zebediah Figura wrote:
Comment on v5 since Gitlab is being uncoöperative: the foreach_loop() function is currently applying logic twice to "if" inside "for", but moreover, I would leave off adding a generic wrapper for this until we have more passes that need it. I.e. I'd just write a single function that calls itself. More generally, I'm not thrilled about the way this gives the same IR two different semantics depending on whether this iterator pass has been done yet. I suppose that an improvement would be to use two different jump-type enums, but I don't immediately see how to name them.
It doesn't really change 'continue' semantics, but I agree the fact that extra work is needed to fix that stuff up later is not ideal. Now I think that maybe inserting iterator right in create_loop(), descending into 'if' blocks, is better. It will only need to handle 'if's, and 'switch'es when we have them.