You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.167
Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
parent
e19d552987
commit
b084638f15
@ -1,5 +0,0 @@
|
||||
add_ocaml_library(llvm_bitreader
|
||||
OCAML llvm_bitreader
|
||||
OCAMLDEP llvm
|
||||
C bitreader_ocaml
|
||||
LLVM bitreader)
|
@ -1,42 +0,0 @@
|
||||
/*===-- bitwriter_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. *|
|
||||
|* *|
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
#include "llvm-c/BitReader.h"
|
||||
#include "llvm-c/Core.h"
|
||||
#include "caml/alloc.h"
|
||||
#include "caml/fail.h"
|
||||
#include "caml/memory.h"
|
||||
#include "caml/callback.h"
|
||||
|
||||
void llvm_raise(value Prototype, char *Message);
|
||||
|
||||
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
|
||||
CAMLprim LLVMModuleRef llvm_get_module(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
|
||||
LLVMModuleRef M;
|
||||
|
||||
if (LLVMGetBitcodeModuleInContext2(C, MemBuf, &M))
|
||||
llvm_raise(*caml_named_value("Llvm_bitreader.Error"), LLVMCreateMessage(""));
|
||||
|
||||
return M;
|
||||
}
|
||||
|
||||
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
|
||||
CAMLprim LLVMModuleRef llvm_parse_bitcode(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
|
||||
LLVMModuleRef M;
|
||||
|
||||
if (LLVMParseBitcodeInContext2(C, MemBuf, &M))
|
||||
llvm_raise(*caml_named_value("Llvm_bitreader.Error"), LLVMCreateMessage(""));
|
||||
|
||||
return M;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
(*===-- llvm_bitreader.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_bitreader.Error" (Error "")
|
||||
|
||||
external get_module
|
||||
: Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
|
||||
= "llvm_get_module"
|
||||
external parse_bitcode
|
||||
: Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
|
||||
= "llvm_parse_bitcode"
|
@ -1,27 +0,0 @@
|
||||
(*===-- llvm_bitreader.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.
|
||||
*
|
||||
*===----------------------------------------------------------------------===*)
|
||||
|
||||
(** Bitcode reader.
|
||||
|
||||
This interface provides an OCaml API for the LLVM bitcode reader, the
|
||||
classes in the Bitreader library. *)
|
||||
|
||||
exception Error of string
|
||||
|
||||
(** [get_module context mb] reads the bitcode for a new module [m] from the
|
||||
memory buffer [mb] in the context [context]. Returns [m] if successful, or
|
||||
raises [Error msg] otherwise, where [msg] is a description of the error
|
||||
encountered. See the function [llvm::getBitcodeModule]. *)
|
||||
val get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
|
||||
|
||||
(** [parse_bitcode context mb] parses the bitcode for a new module [m] from the
|
||||
memory buffer [mb] in the context [context]. Returns [m] if successful, or
|
||||
raises [Error msg] otherwise, where [msg] is a description of the error
|
||||
encountered. See the function [llvm::ParseBitcodeFile]. *)
|
||||
val parse_bitcode : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
|
Reference in New Issue
Block a user