summaryrefslogtreecommitdiff
path: root/bindings/ocaml/linker/llvm_linker.mli
blob: 9752b65e4b205b8257ed14e02db639c52ce2064b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(*===-- llvm_linker.mli - LLVM OCaml Interface -----------------*- OCaml -*-===*
 *
 *                     The LLVM Compiler Infrastructure
 *
 * This file is distributed under the University of Illinois Open Source
 * License. See LICENSE.TXT for details.
 *
 *===----------------------------------------------------------------------===*)

(** Linker.

    This interface provides an OCaml API for LLVM bitcode linker,
    the classes in the Linker library. *)

exception Error of string

(** Linking mode. *)
module Mode : sig
  type t =
  | DestroySource
  | PreserveSource
end

(** [link_modules dst src mode] links [src] into [dst], raising [Error]
    if the linking fails. *)
external link_modules : Llvm.llmodule -> Llvm.llmodule -> Mode.t -> unit
                      = "llvm_link_modules"