Code generator¶
Machine code generator.
The architecture is provided when the generator is created.
-
class
ppci.codegen.codegen.
CodeGenerator
(arch, reporter, optimize_for='size')¶ Machine code generator
-
emit_frame_to_stream
(frame, output_stream, debug=False)¶ Add code for the prologue and the epilogue. Add a label, the return instruction and the stack pointer adjustment for the frame. At this point we know how much stack space must be reserved for locals and what registers should be saved.
-
generate
(ircode: ppci.ir.Module, output_stream, debug=False)¶ Generate machine code from ir-code into output stream
-
generate_function
(ir_function, output_stream, debug=False)¶ Generate code for one function into a frame
-
generate_global
(var, output_stream, debug)¶ Generate code for a global variable
-
select_and_schedule
(ir_function, frame)¶ Perform instruction selection and scheduling
-