4 This compiler is a big long chain of modules that transform l4 code into
7 Here is a breakdown of the modules and changes from l3:
9 * The parser. The parser was mainly brought in from lab 3, and mainly
10 just a straight-forward extension of the l3 parser. We changed asops,
11 since they now side-effect and need special properties. We also added
12 dereferences, arrays, other nice things.
14 * AST utilities. Some of those now exist to make common operations on raw
15 AST structures less painful.
17 * The typechecker. The typechecker was significantly revamped. A
18 'typeof' function was added that did most of the typechecking work;
19 the rest was relatively trivial compared to typeof. There were many
20 annoying things other than typeof, but typeof was the most interesting
23 * The translator was extended with support for sizing up structs. It now
24 is smarter about translating asops. A MEMORY thingo was added to the
27 * The x86/munch modules were extended with support for multiple operand
28 sizes. This was done in a fashion of extreme type A, and needs to be
29 blasted before the next lab, for it is worthless, terrible, awful, ... A
30 major falling-down of this compiler is that it passes size information
31 around in no less than 235784 different fashions, and the translation
32 between each has caused us no end of grief. If we had time to rewrite
33 it instead of firefighting broken tests, uh... we would. Many of our
34 optimizations from last lab needed to be commented out because of this
35 temporary sizing sadness.
37 * The liveness analyzer was mainly unchanged, but for a few rules.
39 * The grapher was fully unchanged. Nice.
41 * The color orderer was fully unchanged. Nice.
43 * The coloring module was fully unchanged. Nice.
45 * The solidifier was modified to deal with the fact that certain things
46 could not be accessed directly. It, too, has become an unmitigated
47 disaster. It must deal with all 875847384 of the sizes, and I am sad
50 * The peepholer lost one form of fail and loss sizing.
52 * The stringifier is of no interest to you, for it does real things that
53 interact with the real world, and that is not of interest to people who
56 * Our internal representation of x86 assembly was changed. In particular,
57 conditional sets and jumps are now SETcc of cc * oper and Jcc of cc *
58 oper, instead of a separate SET or J for each condition code. This
59 simplifies other parts of the code as well.
61 We believe that it is fully functional. We generate correct code whenever we
62 are supposed to, and we pass every test that we can lay our hands on
63 (including all of l2, and one of ours that killed the reference compiler).
64 Of course, our last bug was caught by only one failing test, so...