package ocaml-base-compiler

  1. Overview
  2. Docs
type machtype_component =
  1. | Val
  2. | Addr
  3. | Int
  4. | Float
type machtype = machtype_component array
val typ_void : machtype
val typ_val : machtype
val typ_addr : machtype
val typ_int : machtype
val typ_float : machtype
val size_component : machtype_component -> int

Least upper bound of two machtype_components.

val ge_component : machtype_component -> machtype_component -> bool

Returns true iff the first supplied machtype_component is greater than or equal to the second under the relation used by lub_component.

val size_machtype : machtype -> int
type integer_comparison = Lambda.integer_comparison =
  1. | Ceq
  2. | Cne
  3. | Clt
  4. | Cgt
  5. | Cle
  6. | Cge
val negate_integer_comparison : integer_comparison -> integer_comparison
val swap_integer_comparison : integer_comparison -> integer_comparison
type float_comparison = Lambda.float_comparison =
  1. | CFeq
  2. | CFneq
  3. | CFlt
  4. | CFnlt
  5. | CFgt
  6. | CFngt
  7. | CFle
  8. | CFnle
  9. | CFge
  10. | CFnge
val negate_float_comparison : float_comparison -> float_comparison
val swap_float_comparison : float_comparison -> float_comparison
type label = int
val new_label : unit -> label
type raise_kind =
  1. | Raise_withtrace
  2. | Raise_notrace
type rec_flag =
  1. | Nonrecursive
  2. | Recursive
type memory_chunk =
  1. | Byte_unsigned
  2. | Byte_signed
  3. | Sixteen_unsigned
  4. | Sixteen_signed
  5. | Thirtytwo_unsigned
  6. | Thirtytwo_signed
  7. | Word_int
  8. | Word_val
  9. | Single
  10. | Double
  11. | Double_u
and operation =
  1. | Capply of machtype
  2. | Cextcall of string * machtype * bool * label option
  3. | Cload of memory_chunk * Asttypes.mutable_flag
  4. | Calloc
  5. | Cstore of memory_chunk * Lambda.initialization_or_assignment
  6. | Caddi
  7. | Csubi
  8. | Cmuli
  9. | Cmulhi
  10. | Cdivi
  11. | Cmodi
  12. | Cand
  13. | Cor
  14. | Cxor
  15. | Clsl
  16. | Clsr
  17. | Casr
  18. | Ccmpi of integer_comparison
  19. | Caddv
  20. | Cadda
  21. | Ccmpa of integer_comparison
  22. | Cnegf
  23. | Cabsf
  24. | Caddf
  25. | Csubf
  26. | Cmulf
  27. | Cdivf
  28. | Cfloatofint
  29. | Cintoffloat
  30. | Ccmpf of float_comparison
  31. | Craise of raise_kind
  32. | Ccheckbound
and expression =
  1. | Cconst_int of int
  2. | Cconst_natint of nativeint
  3. | Cconst_float of float
  4. | Cconst_symbol of string
  5. | Cconst_pointer of int
  6. | Cconst_natpointer of nativeint
  7. | Cblockheader of nativeint * Debuginfo.t
  8. | Cvar of Ident.t
  9. | Clet of Ident.t * expression * expression
  10. | Cassign of Ident.t * expression
  11. | Ctuple of expression list
  12. | Cop of operation * expression list * Debuginfo.t
  13. | Csequence of expression * expression
  14. | Cifthenelse of expression * expression * expression
  15. | Cswitch of expression * int array * expression array * Debuginfo.t
  16. | Cloop of expression
  17. | Ccatch of rec_flag * (int * Ident.t list * expression) list * expression
  18. | Cexit of int * expression list
  19. | Ctrywith of expression * Ident.t * expression

Not all cmm expressions currently have Debuginfo.t values attached to them. The ones that do are those that are likely to generate code that can fairly robustly be mapped back to a source location. In the future it might be the case that more Debuginfo.t annotations are desirable.

type codegen_option =
  1. | Reduce_code_size
  2. | No_CSE
type fundecl = {
  1. fun_name : string;
  2. fun_args : (Ident.t * machtype) list;
  3. fun_body : expression;
  4. fun_codegen_options : codegen_option list;
  5. fun_dbg : Debuginfo.t;
}
type data_item =
  1. | Cdefine_symbol of string
  2. | Cglobal_symbol of string
  3. | Cint8 of int
  4. | Cint16 of int
  5. | Cint32 of nativeint
  6. | Cint of nativeint
  7. | Csingle of float
  8. | Cdouble of float
  9. | Csymbol_address of string
  10. | Cstring of string
  11. | Cskip of int
  12. | Calign of int
type phrase =
  1. | Cfunction of fundecl
  2. | Cdata of data_item list
val ccatch : (int * Ident.t list * expression * expression) -> expression
val reset : unit -> unit