You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.205
Former-commit-id: 7f59f7e792705db773f1caecdaa823092f4e2927
This commit is contained in:
parent
5cd5df71cc
commit
8e12397d70
5
external/llvm/bindings/ocaml/linker/CMakeLists.txt
vendored
Normal file
5
external/llvm/bindings/ocaml/linker/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
add_ocaml_library(llvm_linker
|
||||
OCAML llvm_linker
|
||||
OCAMLDEP llvm
|
||||
C linker_ocaml
|
||||
LLVM linker)
|
33
external/llvm/bindings/ocaml/linker/linker_ocaml.c
vendored
Normal file
33
external/llvm/bindings/ocaml/linker/linker_ocaml.c
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/*===-- linker_ocaml.c - LLVM OCaml Glue ------------------------*- C++ -*-===*\
|
||||
|* *|
|
||||
|* The LLVM Compiler Infrastructure *|
|
||||
|* *|
|
||||
|* This file is distributed under the University of Illinois Open Source *|
|
||||
|* License. See LICENSE.TXT for details. *|
|
||||
|* *|
|
||||
|*===----------------------------------------------------------------------===*|
|
||||
|* *|
|
||||
|* This file glues LLVM's OCaml interface to its C interface. These functions *|
|
||||
|* are by and large transparent wrappers to the corresponding C functions. *|
|
||||
|* *|
|
||||
|* Note that these functions intentionally take liberties with the CAMLparamX *|
|
||||
|* macros, since most of the parameters are not GC heap objects. *|
|
||||
|* *|
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
#include "llvm-c/Core.h"
|
||||
#include "llvm-c/Linker.h"
|
||||
#include "caml/alloc.h"
|
||||
#include "caml/memory.h"
|
||||
#include "caml/fail.h"
|
||||
#include "caml/callback.h"
|
||||
|
||||
void llvm_raise(value Prototype, char *Message);
|
||||
|
||||
/* llmodule -> llmodule -> unit */
|
||||
CAMLprim value llvm_link_modules(LLVMModuleRef Dst, LLVMModuleRef Src) {
|
||||
if (LLVMLinkModules2(Dst, Src))
|
||||
llvm_raise(*caml_named_value("Llvm_linker.Error"), LLVMCreateMessage("Linking failed"));
|
||||
|
||||
return Val_unit;
|
||||
}
|
15
external/llvm/bindings/ocaml/linker/llvm_linker.ml
vendored
Normal file
15
external/llvm/bindings/ocaml/linker/llvm_linker.ml
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
(*===-- llvm_linker.ml - 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.
|
||||
*
|
||||
*===----------------------------------------------------------------------===*)
|
||||
|
||||
exception Error of string
|
||||
|
||||
let () = Callback.register_exception "Llvm_linker.Error" (Error "")
|
||||
|
||||
external link_modules' : Llvm.llmodule -> Llvm.llmodule -> unit
|
||||
= "llvm_link_modules"
|
19
external/llvm/bindings/ocaml/linker/llvm_linker.mli
vendored
Normal file
19
external/llvm/bindings/ocaml/linker/llvm_linker.mli
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(*===-- 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
|
||||
|
||||
(** [link_modules' dst src] links [src] into [dst], raising [Error]
|
||||
if the linking fails. The src module is destroyed. *)
|
||||
val link_modules' : Llvm.llmodule -> Llvm.llmodule -> unit
|
Reference in New Issue
Block a user