That's a pretty common approach, we could have some prefix for all
generated vars (e.g. tachyon#).
Good idea. I'll write a genFreeId function. Right now I'm trying to find what Marc has in place to create id objects... Hopefully I'll find something in the scanner code.
I assume that you want to transform the code prior to building the IR
That's correct. I think it's best to keep the IR generation simpler and avoid having to deal with multiple levels of function nesting during the translation.
otherwise you could just reuse the same mechanism that is generates
temporary var names in your IR construction phase.
There are no real variable names in the IR. Since it's in SSA form, temporaries are direct references to the instruction that defines the value. I added a mechanism to assign unique variable names within a given CFG to make the output more readable.
- Maxime