StrongerXi / soc

Compiler for a subset of OCaml
1 stars 0 forks source link

Lir #16

Closed StrongerXi closed 3 years ago

StrongerXi commented 3 years ago

Add in another, more low-level IR (hence the name LIR)

High level goals

  1. Closer to machine instructions (removing more high-level concepts like primop, conditional, letrec, closure creation, etc.)
  2. Creates room for instruction selection (doesn't seem to be useful though, for this functional language).
  3. Agnostic to
    • memory layout, e.g., stack and heap.
    • calling convention
    • register set
  4. Determines memory representation of different types of data.
  5. Determines word size.

Testing

I don't think it's terribly helpful to test Lir, or I just don't see a good way of testing it. I implemented pretty-printing to help debugging later, but from this point on I'll stick with executable as compiler integration test.