|Version 1 (modified by 10 years ago) (diff),|
GHC Commentary: The C code generator
This phase takes Cmm and generates plain C code. The C code generator is very simple these days, in fact it can almost be considered pretty-printing.
There are some slight subtleties:
- info tables, which are expressed in Cmm as being laid out before the entry code for a closure, are compiled into separate top-level structures in the generated C, because C has no support for laying out data next to functions. The desired layout is reconstructed in the assembly file by the Evil Mangler, or not if we're compiling unregisterised (see TABLES_NEXT_TO_CODE).