* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
module GenericValue: sig
(** [GenericValue.t] is a boxed union type used to portably pass arguments to
and receive values from the execution engine. It supports only a limited
selection of types; for more complex argument types, it is necessary to
generate a stub function by hand or to pass parameters by reference.
module GenericValue: sig
(** [GenericValue.t] is a boxed union type used to portably pass arguments to
and receive values from the execution engine. It supports only a limited
selection of types; for more complex argument types, it is necessary to
generate a stub function by hand or to pass parameters by reference.
- according to the floating point type [fpty]. See the fields
- [llvm::GenericValue::DoubleVal] and [llvm::GenericValue::FloatVal]. **)
+ according to the floating point type [fpty]. See the fields
+ [llvm::GenericValue::DoubleVal] and [llvm::GenericValue::FloatVal]. *)
val of_float: Llvm.lltype -> float -> t
(** [of_pointer v] boxes the pointer value [v] in a generic value. See the
val of_float: Llvm.lltype -> float -> t
(** [of_pointer v] boxes the pointer value [v] in a generic value. See the
val of_int32: Llvm.lltype -> int32 -> t
(** [of_int n w] boxes the int [i] in a generic value with the bitwidth
val of_int32: Llvm.lltype -> int32 -> t
(** [of_int n w] boxes the int [i] in a generic value with the bitwidth
val of_int: Llvm.lltype -> int -> t
(** [of_natint n w] boxes the native int [i] in a generic value with the
val of_int: Llvm.lltype -> int -> t
(** [of_natint n w] boxes the native int [i] in a generic value with the
val of_nativeint: Llvm.lltype -> nativeint -> t
(** [of_int64 n w] boxes the int64 [i] in a generic value with the bitwidth
val of_nativeint: Llvm.lltype -> nativeint -> t
(** [of_int64 n w] boxes the int64 [i] in a generic value with the bitwidth
val of_int64: Llvm.lltype -> int64 -> t
(** [as_float fpty gv] unboxes the floating point-valued generic value [gv] of
floating point type [fpty]. See the fields [llvm::GenericValue::DoubleVal]
val of_int64: Llvm.lltype -> int64 -> t
(** [as_float fpty gv] unboxes the floating point-valued generic value [gv] of
floating point type [fpty]. See the fields [llvm::GenericValue::DoubleVal]
val as_float: Llvm.lltype -> t -> float
(** [as_pointer gv] unboxes the pointer-valued generic value [gv]. See the
val as_float: Llvm.lltype -> t -> float
(** [as_pointer gv] unboxes the pointer-valued generic value [gv]. See the
val as_pointer: t -> 'a
(** [as_int32 gv] unboxes the integer-valued generic value [gv] as an [int32].
Is invalid if [gv] has a bitwidth greater than 32 bits. See the field
val as_pointer: t -> 'a
(** [as_int32 gv] unboxes the integer-valued generic value [gv] as an [int32].
Is invalid if [gv] has a bitwidth greater than 32 bits. See the field
val as_int32: t -> int32
(** [as_int gv] unboxes the integer-valued generic value [gv] as an [int].
Is invalid if [gv] has a bitwidth greater than the host bit width (but the
most significant bit may be lost). See the field
val as_int32: t -> int32
(** [as_int gv] unboxes the integer-valued generic value [gv] as an [int].
Is invalid if [gv] has a bitwidth greater than the host bit width (but the
most significant bit may be lost). See the field
val as_int: t -> int
(** [as_natint gv] unboxes the integer-valued generic value [gv] as a
[nativeint]. Is invalid if [gv] has a bitwidth greater than
val as_int: t -> int
(** [as_natint gv] unboxes the integer-valued generic value [gv] as a
[nativeint]. Is invalid if [gv] has a bitwidth greater than
val as_nativeint: t -> nativeint
(** [as_int64 gv] returns the integer-valued generic value [gv] as an [int64].
Is invalid if [gv] has a bitwidth greater than [int64]. See the field
val as_nativeint: t -> nativeint
(** [as_int64 gv] returns the integer-valued generic value [gv] as an [int64].
Is invalid if [gv] has a bitwidth greater than [int64]. See the field
module ExecutionEngine: sig
(** An execution engine is either a JIT compiler or an interpreter, capable of
directly loading an LLVM module and executing its functions without first
module ExecutionEngine: sig
(** An execution engine is either a JIT compiler or an interpreter, capable of
directly loading an LLVM module and executing its functions without first
type t
(** [create mp] creates a new execution engine, taking ownership of the
module provider [mp] if successful. Creates a JIT if possible, else falls
back to an interpreter. Raises [Error msg] if an error occurrs. The
execution engine is not garbage collected and must be destroyed with
type t
(** [create mp] creates a new execution engine, taking ownership of the
module provider [mp] if successful. Creates a JIT if possible, else falls
back to an interpreter. Raises [Error msg] if an error occurrs. The
execution engine is not garbage collected and must be destroyed with
val create: Llvm.llmoduleprovider -> t
(** [create_interpreter mp] creates a new interpreter, taking ownership of the
module provider [mp] if successful. Raises [Error msg] if an error
occurrs. The execution engine is not garbage collected and must be
destroyed with [dispose ee].
val create: Llvm.llmoduleprovider -> t
(** [create_interpreter mp] creates a new interpreter, taking ownership of the
module provider [mp] if successful. Raises [Error msg] if an error
occurrs. The execution engine is not garbage collected and must be
destroyed with [dispose ee].
val create_interpreter: Llvm.llmoduleprovider -> t
(** [create_jit mp] creates a new JIT (just-in-time compiler), taking
ownership of the module provider [mp] if successful. Raises [Error msg] if
an error occurrs. The execution engine is not garbage collected and must
be destroyed with [dispose ee].
val create_interpreter: Llvm.llmoduleprovider -> t
(** [create_jit mp] creates a new JIT (just-in-time compiler), taking
ownership of the module provider [mp] if successful. Raises [Error msg] if
an error occurrs. The execution engine is not garbage collected and must
be destroyed with [dispose ee].
val create_jit: Llvm.llmoduleprovider -> t
(** [dispose ee] releases the memory used by the execution engine and must be
val create_jit: Llvm.llmoduleprovider -> t
(** [dispose ee] releases the memory used by the execution engine and must be
val add_module_provider: Llvm.llmoduleprovider -> t -> unit
(** [remove_module_provider mp ee] removes the module provider [mp] from the
execution engine [ee], disposing of [mp] and the module referenced by
val add_module_provider: Llvm.llmoduleprovider -> t -> unit
(** [remove_module_provider mp ee] removes the module provider [mp] from the
execution engine [ee], disposing of [mp] and the module referenced by
val find_function: string -> t -> Llvm.llvalue option
(** [run_function f args ee] synchronously executes the function [f] with the
val find_function: string -> t -> Llvm.llvalue option
(** [run_function f args ee] synchronously executes the function [f] with the
val run_function: Llvm.llvalue -> GenericValue.t array -> t ->
GenericValue.t
(** [run_static_ctors ee] executes the static constructors of each module in
val run_function: Llvm.llvalue -> GenericValue.t array -> t ->
GenericValue.t
(** [run_static_ctors ee] executes the static constructors of each module in
val run_static_ctors: t -> unit
(** [run_static_dtors ee] executes the static destructors of each module in
val run_static_ctors: t -> unit
(** [run_static_dtors ee] executes the static destructors of each module in
- [args], and [envp] as specified by the array [env]. Returns the integer
- return value of the function. **)
+ [args], and [envp] as specified by the array [env]. Returns the integer
+ return value of the function. *)
val run_function_as_main: Llvm.llvalue -> string array ->
(string * string) array -> t -> int
(** [free_machine_code f ee] releases the memory in the execution engine [ee]
val run_function_as_main: Llvm.llvalue -> string array ->
(string * string) array -> t -> int
(** [free_machine_code f ee] releases the memory in the execution engine [ee]