Read code and add some comments
Add code for graph coloring
Finish Graph Coloring Algorithm
Fix multiple compiling issues

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Further fix more compiling issues

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Rewrite location for "this" in class methods

The original program use a single static location for all the "this"
appeared in the program. This prevents us to assign different registers
to different "this" in different procedures. This is fixed by assigning
a "this" location fields for FnDecl objects.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Implement register filling for BeginFunc

Function parameters are also assigned with registers, but they were not
actually loaded before they are used. The implementation is added to
BeginFunc::EmitSpecific() so that the registers are really utilised.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Finish Graph Coloring Algorithm
Add registers save and restore for ACall and LCall
Fix bugs on Register Mapping
Reuse IN set to simplify RegMap generation

Original CodeGenerator::PopulateRegMap() reconstructed the register
table. This is unnecessary since at this stage, liveness analysis is
already done. This is fixed by reusing IN set information to write
CodeGenerator::PopulateRegMap().

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Fix bugs on graph coloring
Fix multiple virtual method definition

Virtual const methods was not overloaded. Const keywords are added back
to fix this problem.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Fix bugs on graph coloring
Adjust working environment

Now test.sh can report successful build, and make can automatically
disable PaX protection for dcc.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Code refactory

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Fix a stupid error about local variable copy

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Fix a bug that orphan nodes are not allocated

Orphan nodes were not included in the interference graph. While
register allocation is based on interference graph search, all orphan
nodes were left. This is fixed by adding orphan nodes back into graph.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Fix global variable assignment

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Read code and add some comments