package ocaml-base-compiler

  1. Overview
  2. Docs
type compile_time_constant =
  1. | Big_endian
  2. | Word_size
  3. | Int_size
  4. | Max_wosize
  5. | Ostype_unix
  6. | Ostype_win32
  7. | Ostype_cygwin
  8. | Backend_type
type loc_kind =
  1. | Loc_FILE
  2. | Loc_LINE
  3. | Loc_MODULE
  4. | Loc_LOC
  5. | Loc_POS
type immediate_or_pointer =
  1. | Immediate
  2. | Pointer
type initialization_or_assignment =
  1. | Assignment
  2. | Heap_initialization
  3. | Root_initialization
type is_safe =
  1. | Safe
  2. | Unsafe
type primitive =
  1. | Pidentity
  2. | Pbytes_to_string
  3. | Pbytes_of_string
  4. | Pignore
  5. | Prevapply
  6. | Pdirapply
  7. | Ploc of loc_kind
  8. | Pgetglobal of Ident.t
  9. | Psetglobal of Ident.t
  10. | Pmakeblock of int * Asttypes.mutable_flag * block_shape
  11. | Pfield of int
  12. | Pfield_computed
  13. | Psetfield of int * immediate_or_pointer * initialization_or_assignment
  14. | Psetfield_computed of immediate_or_pointer * initialization_or_assignment
  15. | Pfloatfield of int
  16. | Psetfloatfield of int * initialization_or_assignment
  17. | Pduprecord of Types.record_representation * int
  18. | Plazyforce
  19. | Pccall of Primitive.description
  20. | Praise of raise_kind
  21. | Psequand
  22. | Psequor
  23. | Pnot
  24. | Pnegint
  25. | Paddint
  26. | Psubint
  27. | Pmulint
  28. | Pdivint of is_safe
  29. | Pmodint of is_safe
  30. | Pandint
  31. | Porint
  32. | Pxorint
  33. | Plslint
  34. | Plsrint
  35. | Pasrint
  36. | Pintcomp of comparison
  37. | Poffsetint of int
  38. | Poffsetref of int
  39. | Pintoffloat
  40. | Pfloatofint
  41. | Pnegfloat
  42. | Pabsfloat
  43. | Paddfloat
  44. | Psubfloat
  45. | Pmulfloat
  46. | Pdivfloat
  47. | Pfloatcomp of comparison
  48. | Pstringlength
  49. | Pstringrefu
  50. | Pstringrefs
  51. | Pbyteslength
  52. | Pbytesrefu
  53. | Pbytessetu
  54. | Pbytesrefs
  55. | Pbytessets
  56. | Pmakearray of array_kind * Asttypes.mutable_flag
  57. | Pduparray of array_kind * Asttypes.mutable_flag
    (*

    For Pduparray, the argument must be an immutable array. The arguments of Pduparray give the kind and mutability of the array being *produced* by the duplication.

    *)
  58. | Parraylength of array_kind
  59. | Parrayrefu of array_kind
  60. | Parraysetu of array_kind
  61. | Parrayrefs of array_kind
  62. | Parraysets of array_kind
  63. | Pisint
  64. | Pisout
  65. | Pbittest
  66. | Pbintofint of boxed_integer
  67. | Pintofbint of boxed_integer
  68. | Pcvtbint of boxed_integer * boxed_integer
  69. | Pnegbint of boxed_integer
  70. | Paddbint of boxed_integer
  71. | Psubbint of boxed_integer
  72. | Pmulbint of boxed_integer
  73. | Pdivbint of {
    1. size : boxed_integer;
    2. is_safe : is_safe;
    }
  74. | Pmodbint of {
    1. size : boxed_integer;
    2. is_safe : is_safe;
    }
  75. | Pandbint of boxed_integer
  76. | Porbint of boxed_integer
  77. | Pxorbint of boxed_integer
  78. | Plslbint of boxed_integer
  79. | Plsrbint of boxed_integer
  80. | Pasrbint of boxed_integer
  81. | Pbintcomp of boxed_integer * comparison
  82. | Pbigarrayref of bool * int * bigarray_kind * bigarray_layout
  83. | Pbigarrayset of bool * int * bigarray_kind * bigarray_layout
  84. | Pbigarraydim of int
  85. | Pstring_load_16 of bool
  86. | Pstring_load_32 of bool
  87. | Pstring_load_64 of bool
  88. | Pstring_set_16 of bool
  89. | Pstring_set_32 of bool
  90. | Pstring_set_64 of bool
  91. | Pbigstring_load_16 of bool
  92. | Pbigstring_load_32 of bool
  93. | Pbigstring_load_64 of bool
  94. | Pbigstring_set_16 of bool
  95. | Pbigstring_set_32 of bool
  96. | Pbigstring_set_64 of bool
  97. | Pctconst of compile_time_constant
  98. | Pbswap16
  99. | Pbbswap of boxed_integer
  100. | Pint_as_pointer
  101. | Popaque
and comparison =
  1. | Ceq
  2. | Cneq
  3. | Clt
  4. | Cgt
  5. | Cle
  6. | Cge
and array_kind =
  1. | Pgenarray
  2. | Paddrarray
  3. | Pintarray
  4. | Pfloatarray
and value_kind =
  1. | Pgenval
  2. | Pfloatval
  3. | Pboxedintval of boxed_integer
  4. | Pintval
and block_shape = value_kind list option
and boxed_integer = Primitive.boxed_integer =
  1. | Pnativeint
  2. | Pint32
  3. | Pint64
and bigarray_kind =
  1. | Pbigarray_unknown
  2. | Pbigarray_float32
  3. | Pbigarray_float64
  4. | Pbigarray_sint8
  5. | Pbigarray_uint8
  6. | Pbigarray_sint16
  7. | Pbigarray_uint16
  8. | Pbigarray_int32
  9. | Pbigarray_int64
  10. | Pbigarray_caml_int
  11. | Pbigarray_native_int
  12. | Pbigarray_complex32
  13. | Pbigarray_complex64
and bigarray_layout =
  1. | Pbigarray_unknown_layout
  2. | Pbigarray_c_layout
  3. | Pbigarray_fortran_layout
and raise_kind =
  1. | Raise_regular
  2. | Raise_reraise
  3. | Raise_notrace
type structured_constant =
  1. | Const_base of Asttypes.constant
  2. | Const_pointer of int
  3. | Const_block of int * structured_constant list
  4. | Const_float_array of string list
  5. | Const_immstring of string
type inline_attribute =
  1. | Always_inline
  2. | Never_inline
  3. | Unroll of int
  4. | Default_inline
type specialise_attribute =
  1. | Always_specialise
  2. | Never_specialise
  3. | Default_specialise
type function_kind =
  1. | Curried
  2. | Tupled
type let_kind =
  1. | Strict
  2. | Alias
  3. | StrictOpt
  4. | Variable
type meth_kind =
  1. | Self
  2. | Public
  3. | Cached
type shared_code = (int * int) list
type function_attribute = {
  1. inline : inline_attribute;
  2. specialise : specialise_attribute;
  3. is_a_functor : bool;
  4. stub : bool;
}
type lambda =
  1. | Lvar of Ident.t
  2. | Lconst of structured_constant
  3. | Lapply of lambda_apply
  4. | Lfunction of lfunction
  5. | Llet of let_kind * value_kind * Ident.t * lambda * lambda
  6. | Lletrec of (Ident.t * lambda) list * lambda
  7. | Lprim of primitive * lambda list * Location.t
  8. | Lswitch of lambda * lambda_switch
  9. | Lstringswitch of lambda * (string * lambda) list * lambda option * Location.t
  10. | Lstaticraise of int * lambda list
  11. | Lstaticcatch of lambda * int * Ident.t list * lambda
  12. | Ltrywith of lambda * Ident.t * lambda
  13. | Lifthenelse of lambda * lambda * lambda
  14. | Lsequence of lambda * lambda
  15. | Lwhile of lambda * lambda
  16. | Lfor of Ident.t * lambda * lambda * Asttypes.direction_flag * lambda
  17. | Lassign of Ident.t * lambda
  18. | Lsend of meth_kind * lambda * lambda * lambda list * Location.t
  19. | Levent of lambda * lambda_event
  20. | Lifused of Ident.t * lambda
and lfunction = {
  1. kind : function_kind;
  2. params : Ident.t list;
  3. body : lambda;
  4. attr : function_attribute;
  5. loc : Location.t;
}
and lambda_apply = {
  1. ap_func : lambda;
  2. ap_args : lambda list;
  3. ap_loc : Location.t;
  4. ap_should_be_tailcall : bool;
  5. ap_inlined : inline_attribute;
  6. ap_specialised : specialise_attribute;
}
and lambda_switch = {
  1. sw_numconsts : int;
  2. sw_consts : (int * lambda) list;
  3. sw_numblocks : int;
  4. sw_blocks : (int * lambda) list;
  5. sw_failaction : lambda option;
}
and lambda_event = {
  1. lev_loc : Location.t;
  2. lev_kind : lambda_event_kind;
  3. lev_repr : int Pervasives.ref option;
  4. lev_env : Env.summary;
}
and lambda_event_kind =
  1. | Lev_before
  2. | Lev_after of Types.type_expr
  3. | Lev_function
  4. | Lev_pseudo
type program = {
  1. module_ident : Ident.t;
  2. main_module_block_size : int;
  3. required_globals : Ident.Set.t;
  4. code : lambda;
}
val make_key : lambda -> lambda option
val const_unit : structured_constant
val lambda_unit : lambda
val name_lambda : let_kind -> lambda -> (Ident.t -> lambda) -> lambda
val name_lambda_list : lambda list -> (lambda list -> lambda) -> lambda
val iter : (lambda -> unit) -> lambda -> unit
module IdentSet : Set.S with type elt = Ident.t
val free_variables : lambda -> IdentSet.t
val free_methods : lambda -> IdentSet.t
val transl_normal_path : Path.t -> lambda
val transl_path : ?loc:Location.t -> Env.t -> Path.t -> lambda
val make_sequence : ('a -> lambda) -> 'a list -> lambda
val subst_lambda : lambda Ident.tbl -> lambda -> lambda
val map : (lambda -> lambda) -> lambda -> lambda
val bind : let_kind -> Ident.t -> lambda -> lambda -> lambda
val commute_comparison : comparison -> comparison
val negate_comparison : comparison -> comparison
val default_function_attribute : function_attribute
val default_stub_attribute : function_attribute
val next_raise_count : unit -> int
val next_negative_raise_count : unit -> int
val staticfail : lambda
val is_guarded : lambda -> bool
val patch_guarded : lambda -> lambda -> lambda
val raise_kind : raise_kind -> string
val lam_of_loc : loc_kind -> Location.t -> lambda
val reset : unit -> unit
OCaml

Innovation. Community. Security.