Writing a Compiler 3: The Branch Fixup
I left the last article by talking about a bug. Look at this source code: and the IL which is being generated from it: Assignments to a variable are versioned. I.e. every variable reference has a ‘subscript’, which is incremented for every write. So in this example we have %a_0, %a_1, and %a_2, all of …. Read More
Writing a Compiler 2: Conditionals
In part one I showed how my compiler is parsing expressions and converting this into an intermediate language format suitable for optimisation and code generation. The code in part one was purely linear with no branches or loops. In this second article I begin to deal with code which has multiple execution paths. I’ll start …. Read More