Source

ocaml-llvm-phantom / lib / genvalue.mli

open Type
open Llvm_executionengine

(** {6 LLVM value with phantom type} *)

type 'a v = ('a, GenericValue.t) Phantom.t
type 'a vs = ('a, GenericValue.t) Phantom.ts

(** {6 LLVM <=> OCaml value conversions} *)

(* val unsafe_annotate : GenericValue.t -> 'a v _t = v *)

val of_float : ([>`floating] as 'a) typ -> float -> 'a v
val unsafe_of_pointer : 'a (* unsafe *) -> 'b pointer v
val of_int32 : ([>`int] as 'a) typ -> int32 -> 'a v
val of_int : ([>`int] as 'a) typ -> int -> 'a v
val of_nativeint : ([>`int] as 'a) typ -> nativeint -> 'a v
val of_int64 : ([>`int] as 'a) typ -> int64 -> 'a v

val as_float : ([>`floating] as 'a) typ -> 'a v -> float
val as_unsafe_pointer : 'a pointer v -> 'b (* unsafe *)
val as_int32 : ([>`int] as 'a) v -> int32
val as_int : ([>`int] as 'a) v -> int
val as_nativeint : ([>`int] as 'a) v -> nativeint
val as_int64 : ([>`int] as 'a) v -> int64