jon.recoil.org

Module Flambda2_parser.Fexpr

type location = Lambda.scoped_location
type 'a located = {
  1. txt : 'a;
  2. loc : location;
}
type variable = string located
type continuation_id = string located
type code_id = string located
type function_slot = string located
type value_slot = string located
type compilation_unit = {
  1. ident : string;
  2. linkage_name : string option;
}
type symbol = (compilation_unit option * string) located
type immediate = string
type targetint = int64
type special_continuation =
  1. | Done
  2. | Error
type continuation =
  1. | Named of continuation_id
  2. | Special of special_continuation
type result_continuation =
  1. | Return of continuation
  2. | Never_returns
type continuation_sort =
  1. | Normal
  2. | Exn
  3. | Define_root_symbol
type region =
  1. | Named of variable
  2. | Toplevel
type const =
  1. | Naked_immediate of immediate
  2. | Tagged_immediate of immediate
  3. | Naked_float32 of float
  4. | Naked_float of float
  5. | Naked_int8 of Flambda2_numbers.Numeric_types.Int8.t
  6. | Naked_int16 of Flambda2_numbers.Numeric_types.Int16.t
  7. | Naked_int32 of int32
  8. | Naked_int64 of int64
  9. | Naked_vec128 of Flambda2_numbers.Vector_types.Vec128.Bit_pattern.bits
  10. | Naked_vec256 of Flambda2_numbers.Vector_types.Vec256.Bit_pattern.bits
  11. | Naked_vec512 of Flambda2_numbers.Vector_types.Vec512.Bit_pattern.bits
  12. | Naked_nativeint of targetint
  13. | Null
type field_of_block =
  1. | Symbol of symbol
  2. | Tagged_immediate of immediate
  3. | Dynamically_computed of variable
type is_recursive =
  1. | Nonrecursive
  2. | Recursive
type tag_scannable = int
type mutability = Flambda2_terms.Mutability.t =
  1. | Mutable
  2. | Immutable
  3. | Immutable_unique
type 'a or_variable =
  1. | Const of 'a
  2. | Var of variable
type static_data =
  1. | Block of {
    1. tag : tag_scannable;
    2. mutability : mutability;
    3. elements : field_of_block list;
    }
  2. | Boxed_float32 of float or_variable
  3. | Boxed_float of float or_variable
  4. | Boxed_int32 of int32 or_variable
  5. | Boxed_int64 of int64 or_variable
  6. | Boxed_nativeint of targetint or_variable
  7. | Boxed_vec128 of Flambda2_numbers.Vector_types.Vec128.Bit_pattern.bits or_variable
  8. | Boxed_vec256 of Flambda2_numbers.Vector_types.Vec256.Bit_pattern.bits or_variable
  9. | Boxed_vec512 of Flambda2_numbers.Vector_types.Vec512.Bit_pattern.bits or_variable
  10. | Immutable_float_block of float or_variable list
  11. | Immutable_float_array of float or_variable list
  12. | Immutable_value_array of field_of_block list
  13. | Empty_array of empty_array_kind
  14. | Mutable_string of {
    1. initial_value : string;
    }
  15. | Immutable_string of string
type subkind =
  1. | Anything
  2. | Boxed_float32
  3. | Boxed_float
  4. | Boxed_int32
  5. | Boxed_int64
  6. | Boxed_nativeint
  7. | Boxed_vec128
  8. | Boxed_vec256
  9. | Boxed_vec512
  10. | Tagged_immediate
  11. | Variant of {
    1. consts : targetint list;
    2. non_consts : (tag_scannable * kind_with_subkind list) list;
    }
  12. | Float_block of {
    1. num_fields : int;
    }
  13. | Float_array
  14. | Immediate_array
  15. | Value_array
  16. | Generic_array
and kind_with_subkind =
  1. | Value of subkind
  2. | Naked_number of Flambda2_kinds.Flambda_kind.Naked_number_kind.t
  3. | Region
  4. | Rec_info
type static_data_binding = {
  1. symbol : symbol;
  2. defining_expr : static_data;
}
type raise_kind = Flambda2_terms.Trap_action.Raise_kind.t =
  1. | Regular
  2. | Reraise
  3. | No_trace
type trap_action =
  1. | Push of {
    1. exn_handler : continuation;
    }
  2. | Pop of {
    1. exn_handler : continuation;
    2. raise_kind : raise_kind option;
    }
type rec_info =
  1. | Depth of int
  2. | Infinity
  3. | Do_not_inline
  4. | Var of variable
  5. | Succ of rec_info
  6. | Unroll of int * rec_info
type coercion =
  1. | Id
  2. | Change_depth of {
    1. from : rec_info;
    2. to_ : rec_info;
    }
type kinded_parameter = {
  1. param : variable;
  2. kind : kind_with_subkind option;
}
type name =
  1. | Var of variable
  2. | Symbol of symbol
type simple =
  1. | Var of variable
  2. | Symbol of symbol
  3. | Const of const
  4. | Coerce of simple * coercion
type cont_extra_arg = simple * kind_with_subkind
type alloc_mode_for_allocations =
  1. | Heap
  2. | Local of {
    1. region : region;
    }
type alloc_mode_for_applications =
  1. | Heap
  2. | Local of {
    1. region : region;
    2. ghost_region : region;
    }
type alloc_mode_for_assignments =
  1. | Heap
  2. | Local
type prim_param =
  1. | Labeled of string located * prim_param list
  2. | Anonymous of prim_param list
type prim_op = {
  1. prim : string;
  2. params : prim_param list;
}
type prim = prim_op * simple list
type arity = kind_with_subkind list
type function_call =
  1. | Direct of {
    1. code_id : code_id;
    2. function_slot : function_slot option;
    }
  2. | Indirect
type method_kind =
  1. | Self
  2. | Public
  3. | Cached
type call_kind =
  1. | Function of function_call
  2. | C_call of {
    1. alloc : bool;
    }
type function_arities = {
  1. params_arity : arity option;
  2. ret_arity : arity;
}
type inline_attribute = Flambda2_terms.Inline_attribute.t =
  1. | Always_inline
  2. | Available_inline
  3. | Never_inline
  4. | Unroll of int
  5. | Default_inline
type inlined_attribute =
  1. | Always_inlined
  2. | Hint_inlined
  3. | Never_inlined
  4. | Unroll of int
  5. | Default_inlined
type inlining_state = {
  1. depth : int;
}
type loopify_attribute = Flambda2_terms.Loopify_attribute.t =
  1. | Always_loopify
  2. | Never_loopify
  3. | Already_loopified
  4. | Default_loopify_and_tailrec
  5. | Default_loopify_and_not_tailrec
type apply = {
  1. func : simple option;
  2. continuation : result_continuation;
  3. exn_continuation : continuation * cont_extra_arg list;
  4. args : simple list;
  5. call_kind : call_kind;
  6. alloc_mode : alloc_mode_for_applications;
  7. arities : function_arities option;
  8. inlined : inlined_attribute option;
  9. inlining_state : inlining_state option;
}
type size = int
type apply_cont = {
  1. cont : continuation;
  2. trap_action : trap_action option;
  3. args : simple list;
}
type is_cont_recursive =
  1. | Nonrecursive
  2. | Recursive of kinded_parameter list
type expr =
  1. | Let of let_
  2. | Let_cont of let_cont
  3. | Let_symbol of let_symbol
  4. | Apply of apply
  5. | Apply_cont of apply_cont
  6. | Switch of {
    1. scrutinee : simple;
    2. cases : (int * apply_or_inlined_cont) list;
    }
  7. | Invalid of {
    1. message : string;
    }
and apply_or_inlined_cont =
  1. | Inlined_goto of expr
  2. | Named_cont of apply_cont
and value_slots = one_value_slot list
and one_value_slot = {
  1. var : value_slot;
  2. value : simple;
}
and let_ = {
  1. bindings : let_binding list;
  2. value_slots : value_slots option;
  3. body : expr;
}
and let_binding = {
  1. var : variable;
  2. defining_expr : named;
}
and named =
  1. | Simple of simple
  2. | Prim of prim
  3. | Closure of fun_decl
  4. | Rec_info of rec_info
and fun_decl = {
  1. code_id : code_id;
  2. function_slot : function_slot option;
  3. alloc : alloc_mode_for_allocations;
}
and let_cont = {
  1. recursive : is_cont_recursive;
  2. body : expr;
  3. bindings : continuation_binding list;
}
and continuation_binding = {
  1. name : continuation_id;
  2. params : kinded_parameter list;
  3. sort : continuation_sort option;
  4. handler : expr;
}
and let_symbol = {
  1. bindings : symbol_binding list;
  2. value_slots : value_slots option;
  3. body : expr;
}
and symbol_binding =
  1. | Data of static_data_binding
  2. | Code of code
  3. | Deleted_code of code_id
  4. | Closure of static_closure_binding
  5. | Set_of_closures of static_set_of_closures
and static_set_of_closures = {
  1. bindings : static_closure_binding list;
  2. elements : value_slots option;
}
and code = {
  1. id : code_id;
  2. newer_version_of : code_id option;
  3. param_arity : arity option;
  4. ret_arity : arity option;
  5. recursive : is_recursive;
  6. inline : inline_attribute option;
  7. params_and_body : params_and_body;
  8. code_size : code_size;
  9. is_tupled : bool;
  10. stub : bool;
  11. loopify : loopify_attribute option;
  12. result_mode : alloc_mode_for_assignments;
}
and code_size = int
and params_and_body = {
  1. params : kinded_parameter list;
  2. closure_var : variable;
  3. region_var : variable;
  4. ghost_region_var : variable;
  5. depth_var : variable;
  6. ret_cont : continuation_id;
  7. exn_cont : continuation_id;
  8. body : expr;
}
and static_closure_binding = {
  1. symbol : symbol;
  2. fun_decl : fun_decl;
}
type flambda_unit = {
  1. body : expr;
}