Module Mach

type integer_comparison =
  1. | Isigned of Cmm.integer_comparison
  2. | Iunsigned of Cmm.integer_comparison
type integer_operation =
  1. | Iadd
  2. | Isub
  3. | Imul
  4. | Imulh
  5. | Idiv
  6. | Imod
  7. | Iand
  8. | Ior
  9. | Ixor
  10. | Ilsl
  11. | Ilsr
  12. | Iasr
  13. | Icomp of integer_comparison
  14. | Icheckbound
type float_comparison = Cmm.float_comparison
type test =
  1. | Itruetest
  2. | Ifalsetest
  3. | Iinttest of integer_comparison
  4. | Iinttest_imm of integer_comparison * int
  5. | Ifloattest of float_comparison
  6. | Ioddtest
  7. | Ieventest
type operation =
  1. | Imove
  2. | Ispill
  3. | Ireload
  4. | Iconst_int of nativeint
  5. | Iconst_float of int64
  6. | Iconst_symbol of string
  7. | Icall_ind
  8. | Icall_imm of {
    1. func : string;
    }
  9. | Itailcall_ind
  10. | Itailcall_imm of {
    1. func : string;
    }
  11. | Iextcall of {
    1. func : string;
    2. ty_res : Cmm.machtype;
    3. ty_args : Cmm.exttype list;
    4. alloc : bool;
    }
  12. | Istackoffset of int
  13. | Iload of Cmm.memory_chunk * Arch.addressing_mode * Asttypes.mutable_flag
  14. | Istore of Cmm.memory_chunk * Arch.addressing_mode * bool
  15. | Ialloc of {
    1. bytes : int;
    2. dbginfo : Debuginfo.alloc_dbginfo;
    }
  16. | Iintop of integer_operation
  17. | Iintop_imm of integer_operation * int
  18. | Inegf
  19. | Iabsf
  20. | Iaddf
  21. | Isubf
  22. | Imulf
  23. | Idivf
  24. | Ifloatofint
  25. | Iintoffloat
  26. | Iopaque
  27. | Ispecific of Arch.specific_operation
  28. | Ipoll of {
    1. return_label : Cmm.label option;
    }
type instruction = {
  1. desc : instruction_desc;
  2. next : instruction;
  3. arg : Reg.t array;
  4. res : Reg.t array;
  5. dbg : Debuginfo.t;
  6. mutable live : Reg.Set.t;
}
and instruction_desc =
  1. | Iend
  2. | Iop of operation
  3. | Ireturn
  4. | Iifthenelse of test * instruction * instruction
  5. | Iswitch of int array * instruction array
  6. | Icatch of Cmm.rec_flag * (int * instruction) list * instruction
  7. | Iexit of int
  8. | Itrywith of instruction * instruction
  9. | Iraise of Lambda.raise_kind
type fundecl = {
  1. fun_name : string;
  2. fun_args : Reg.t array;
  3. fun_body : instruction;
  4. fun_codegen_options : Cmm.codegen_option list;
  5. fun_dbg : Debuginfo.t;
  6. fun_poll : Lambda.poll_attribute;
  7. fun_num_stack_slots : int array;
  8. fun_contains_calls : bool;
}
val dummy_instr : instruction
val end_instr : unit -> instruction
val instr_cons : instruction_desc -> Reg.t array -> Reg.t array -> instruction -> instruction
val instr_cons_debug : instruction_desc -> Reg.t array -> Reg.t array -> Debuginfo.t -> instruction -> instruction
val instr_iter : (instruction -> unit) -> instruction -> unit
val operation_is_pure : operation -> bool

Returns true if the given operation only produces a result in its destination registers, but has no side effects whatsoever: it doesn't raise exceptions, it doesn't modify already-allocated blocks, it doesn't adjust the stack frame, etc.

val operation_can_raise : operation -> bool

Returns true if the given operation can raise an exception.