module Asm_ast: sig end
Abstract syntax tree with an assembly looking-like structure.
Author(s): Samuel Mimram, Julien Cristau
val assocp : 'a -> ('a * 'b) list -> 'b
Just like List.assoc but with physical equlity as test.
type value =
| |
Integer of int |
| |
Boolean of bool |
Pseudo-typed values for assembly.
type variable_def = {
|
vd_pos : int; |
|
vd_size : int; |
|
mutable vd_value : value option; |
|
vd_by_ref : bool; |
|
vd_on_the_stack : bool; |
}
A variable definition.
type variable = {
|
mutable var_reg : int option; |
|
mutable var_def : variable_def; |
|
mutable var_spilled : bool; |
|
mutable var_to_spill : bool; |
}
A variable.
type procedure = {
}
type meta_instr =
A meta instruction (has several base blocks as argument).
type instr =
An assembly instruction.
For operators of arity three, the third operand should be allocated in the same register as the first one when it's possible.
type base_block = {
}
A base block.
val allocate_registers : base_block -> unit
Do the registers allocation (simple version).
type var_gen = {
|
vg_const : bool; |
|
vg_stack : bool; |
}
val generate_code : string -> procedure list -> string
Generate the target asm.