IUCompilerCourse / Essentials-of-Compilation

A book about compiling Racket and Python to x86-64 assembly
1.27k stars 137 forks source link

Python version exercise 4.4 is not consistent with compile_and_test function in support code #165

Closed DarshalShetty closed 11 months ago

DarshalShetty commented 11 months ago

The first line of exercise 4.4 states:

Implement the allocate_registers pass.

However, the compile_and_test function in utils.py in the python support code doesn't handle a allocate_registers pass.

Also some information about how to add the functions build_interference (exercise 4.3) and uncover_live (exercise 4.2) into the compiler pipeline would be helpful since the Racket version of the book explicitly says that these functions need to be added as new passes.

jsiek commented 11 months ago

Thanks for noticing this! I've updated the exercise descriptions to be explicit. For Python there's just one pass, assign_homes, but it makes use of three functions (uncover_live, etc.).