blob: 435134337e076d7730dc0731391740f30585cda4 [file] [log] [blame]
Peter Zotov662538a2014-10-29 08:15:54 +00001(*===-- llvm_bitreader.mli - LLVM OCaml Interface -------------*- OCaml -*-===*
Gordon Henriksen2b0eed22007-12-11 00:20:48 +00002 *
3 * The LLVM Compiler Infrastructure
4 *
Chris Lattner6787a452007-12-29 22:59:10 +00005 * This file is distributed under the University of Illinois Open Source
6 * License. See LICENSE.TXT for details.
Gordon Henriksen2b0eed22007-12-11 00:20:48 +00007 *
Gordon Henriksen2b0eed22007-12-11 00:20:48 +00008 *===----------------------------------------------------------------------===*)
9
Gordon Henriksen95f4b772008-03-09 07:17:38 +000010(** Bitcode reader.
11
Sylvestre Ledru493cd8c2013-11-01 00:26:01 +000012 This interface provides an OCaml API for the LLVM bitcode reader, the
Gordon Henriksen95f4b772008-03-09 07:17:38 +000013 classes in the Bitreader library. *)
Gordon Henriksen2b0eed22007-12-11 00:20:48 +000014
Gordon Henriksen34eb6d82007-12-19 22:30:40 +000015exception Error of string
Gordon Henriksen2b0eed22007-12-11 00:20:48 +000016
Erick Tryzelaar98b05d62010-03-02 23:59:00 +000017(** [get_module context mb] reads the bitcode for a new module [m] from the
18 memory buffer [mb] in the context [context]. Returns [m] if successful, or
19 raises [Error msg] otherwise, where [msg] is a description of the error
20 encountered. See the function [llvm::getBitcodeModule]. *)
Torok Edwin5abf51b2010-12-23 15:49:26 +000021val get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
22
Erick Tryzelaar5c35b5c2009-08-19 06:40:29 +000023(** [parse_bitcode context mb] parses the bitcode for a new module [m] from the
24 memory buffer [mb] in the context [context]. Returns [m] if successful, or
Bill Wendlingbd8e5d52012-07-19 00:23:13 +000025 raises [Error msg] otherwise, where [msg] is a description of the error
26 encountered. See the function [llvm::ParseBitcodeFile]. *)
Torok Edwin5abf51b2010-12-23 15:49:26 +000027val parse_bitcode : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule