README ------ This compiler is a big long chain of modules that transform l4 code into x86_64 assembly. Here is a breakdown of the modules and changes from l3: * The parser. The parser was mainly brought in from lab 3, and mainly just a straight-forward extension of the l3 parser. We changed asops, since they now side-effect and need special properties. We also added dereferences, arrays, other nice things. * AST utilities. Some of those now exist to make common operations on raw AST structures less painful. * The typechecker. The typechecker was significantly revamped. A 'typeof' function was added that did most of the typechecking work; the rest was relatively trivial compared to typeof. There were many annoying things other than typeof, but typeof was the most interesting to comment on. * The translator was extended with support for sizing up structs. It now is smarter about translating asops. A MEMORY thingo was added to the Tree, as was ALLOC. * The x86/munch modules were extended with support for multiple operand sizes. This was done in a fashion of extreme type A, and needs to be blasted before the next lab, for it is worthless, terrible, awful, ... A major falling-down of this compiler is that it passes size information around in no less than 235784 different fashions, and the translation between each has caused us no end of grief. If we had time to rewrite it instead of firefighting broken tests, uh... we would. Many of our optimizations from last lab needed to be commented out because of this temporary sizing sadness. * The liveness analyzer was mainly unchanged, but for a few rules. * The grapher was fully unchanged. Nice. * The color orderer was fully unchanged. Nice. * The coloring module was fully unchanged. Nice. * The solidifier was modified to deal with the fact that certain things could not be accessed directly. It, too, has become an unmitigated disaster. It must deal with all 875847384 of the sizes, and I am sad about this. * The peepholer lost one form of fail and loss sizing. * 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. * Our internal representation of x86 assembly was changed. In particular, conditional sets and jumps are now SETcc of cc * oper and Jcc of cc * oper, instead of a separate SET or J for each condition code. This simplifies other parts of the code as well. 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 l2, and one of ours that killed the reference compiler). Of course, our last bug was caught by only one failing test, so...