1*06f32e7eSjoerg(*===-- llvm_bitreader.mli - LLVM OCaml Interface -------------*- OCaml -*-===*
2*06f32e7eSjoerg *
3*06f32e7eSjoerg * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*06f32e7eSjoerg * See https://llvm.org/LICENSE.txt for license information.
5*06f32e7eSjoerg * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*06f32e7eSjoerg *
7*06f32e7eSjoerg *===----------------------------------------------------------------------===*)
8*06f32e7eSjoerg
9*06f32e7eSjoerg(** Bitcode reader.
10*06f32e7eSjoerg
11*06f32e7eSjoerg    This interface provides an OCaml API for the LLVM bitcode reader, the
12*06f32e7eSjoerg    classes in the Bitreader library. *)
13*06f32e7eSjoerg
14*06f32e7eSjoergexception Error of string
15*06f32e7eSjoerg
16*06f32e7eSjoerg(** [get_module context mb] reads the bitcode for a new module [m] from the
17*06f32e7eSjoerg    memory buffer [mb] in the context [context].  Returns [m] if successful, or
18*06f32e7eSjoerg    raises [Error msg] otherwise, where [msg] is a description of the error
19*06f32e7eSjoerg    encountered. See the function [llvm::getBitcodeModule]. *)
20*06f32e7eSjoergval get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
21*06f32e7eSjoerg
22*06f32e7eSjoerg(** [parse_bitcode context mb] parses the bitcode for a new module [m] from the
23*06f32e7eSjoerg    memory buffer [mb] in the context [context]. Returns [m] if successful, or
24*06f32e7eSjoerg    raises [Error msg] otherwise, where [msg] is a description of the error
25*06f32e7eSjoerg    encountered. See the function [llvm::ParseBitcodeFile]. *)
26*06f32e7eSjoergval parse_bitcode : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
27