Source

ocaml-llvm-phantom / lib / gep.mli

Full commit
(** {6 Type-safe GEP tools} *)

open Type
open Value

type ('a, 'final, 'res) t
(** GEP phantom *)

val gen : ([ `int of int | `llvalue of Llvm.llvalue ] list -> 'res) -> (('a, 'final, 'res) t -> 'b) -> 'b
(** GEP generator *)

val end_ : ('final, 'final, 'res) t -> 'res
(** GEP finisher *)

(** {6 pointer/array/vector accessors} *)

val pos : int -> ([> `container of 'a], 'final, 'res) t -> (('a, 'final, 'res) t -> 'b) -> 'b
val pos_i32 : i32 v -> ([> `container of 'a], 'final, 'res) t -> (('a, 'final, 'res) t -> 'b) -> 'b

(** {6 struct member accessors} *)

val mem0 : (('a0 * _) struct_, 'final, 'res) t -> (('a0, 'final, 'res) t -> 'b) -> 'b
val mem1 : ((_ * ('a1 * _)) struct_, 'final, 'res) t -> (('a1, 'final, 'res) t -> 'b) -> 'b
val mem2 : ((_ * (_ * ('a2 * _))) struct_, 'final, 'res) t -> (('a2, 'final, 'res) t -> 'b) -> 'b
val mem3 : ((_ * (_ * (_ * ('a3 * _)))) struct_, 'final, 'res) t -> (('a3, 'final, 'res) t -> 'b) -> 'b
val mem4 : ((_ * (_ * (_ * (_ * ('a4 * _))))) struct_, 'final, 'res) t -> (('a4, 'final, 'res) t -> 'b) -> 'b
val mem5 : ((_ * (_ * (_ * (_ * (_ * ('a5 * _)))))) struct_, 'final, 'res) t -> (('a5, 'final, 'res) t -> 'b) -> 'b
val mem6 : ((_ * (_ * (_ * (_ * (_ * (_ * ('a6 * _))))))) struct_, 'final, 'res) t -> (('a6, 'final, 'res) t -> 'b) -> 'b
val mem7 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a7 * _)))))))) struct_, 'final, 'res) t -> (('a7, 'final, 'res) t -> 'b) -> 'b
val mem8 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a8 * _))))))))) struct_, 'final, 'res) t -> (('a8, 'final, 'res) t -> 'b) -> 'b
val mem9 : ((_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * (_ * ('a9 * _)))))))))) struct_, 'final, 'res) t -> (('a9, 'final, 'res) t -> 'b) -> 'b