README
------

This compiler is a big long chain of modules that transform L5 code into
x86_64 assembly.

Here is a breakdown of the modules and changes from L5:

  * The parser.  The parser was mainly brought in from lab 4, and mainly
    just a straight-forward extension of the L4 parser to have increments,
    decrements, conditionals, and hex constants.
    
  * AST utilities were updated to use the new temp typing system.

  * Temporaries now are the only source of sizing information until we hit
    the stage at which point instructions are generated.  At that point,
    instructions get sizing info, too, but really, that's about it.

  * The typechecker was mostly unchanged.

  * The translator was changed to use the new sizing system.  Of interest,
    the 'safe' alloc routine and the 'safe' dereference routines have been
    moved into the IR stage, as opposed to having custom instructions
    generated for them at the munch stage.  This was done with the addition
    of the 'stmvar' IR function, which is equivalent to the GCC C extension:
      ({ stm; stm; ... expr })
    in that it evaluates the statements first, then returns the evaluation
    of the expression.

  * The munch modules were updated to remove a lot of their suck and make
    them correct again. Specifically, they were updated to use the new
    typing system and perform type inference of sorts (i.e. adding a
    quadword base pointer and a long offset yields a quad, etc.). This is
    far superior to the previous sizing method, in which we gave some loose
    (and disgusting) annotations of size and left the final sizing decisions
    to the stringifier (O.o).

  * The liveness analyzer was mainly unchanged.

  * The grapher was fully unchanged.  Nice.

  * The color orderer was optimized a bit.

  * The coloring module was fully unchanged.  Nice.

  * The solidifier was similarly ripped out and hit by the diqing beam, sent
    on a flight to Diqing airport, which is in Diqing which is in
    the Diqing province in China, and subsequently it was diqed.  It is now
    much happier.

  * The peepholer has been moved into the optimization framework.

  * An optimization framework was added, allowing optimizers to be
    individually turned off from the command line with approximately no work
    on our part.  I'm particularly proud of the simplicity with which it
    allows one to write optimizations; see optimize/feckful.sml.  They need
    only be hooked in one place (in particular, in a list at the top of
    top.sml).  Individual optimizations will be discussed in the paper to be
    handed in tomorrow.

  * The stringifier is of no interest to you, for it does real things that
    interact with the real world, and that is not of interest to people who
    write in ML.

We believe that it is fully functional. We generate correct code whenever we
are supposed to, and we pass every test that we can lay our hands on
(including all of the regression suite). There are a number of optimizations
that we wish to do, especially various interprocedural ones, but we ran out
of time.