166b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman(*===-- llvm_bitreader.mli - LLVM Ocaml Interface ---------------*- C++ -*-===* 266b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * 366b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * The LLVM Compiler Infrastructure 466b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * 566b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * This file is distributed under the University of Illinois Open Source 666b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * License. See LICENSE.TXT for details. 766b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * 866b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman *===----------------------------------------------------------------------===*) 966b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman 1066b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman(** Bitcode reader. 1166b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman 1266b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman This interface provides an ocaml API for the LLVM bitcode reader, the 1366b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman classes in the Bitreader library. *) 1466b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman 1566b8ab22586debccb1f787d4d52b7f042d4ddeb8John Baumanexception Error of string 1666b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman 1766b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman(** [get_module context mb] reads the bitcode for a new module [m] from the 1866b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman memory buffer [mb] in the context [context]. Returns [m] if successful, or 1966b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman raises [Error msg] otherwise, where [msg] is a description of the error 2066b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman encountered. See the function [llvm::getBitcodeModule]. *) 2166b8ab22586debccb1f787d4d52b7f042d4ddeb8John Baumanval get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule 2266b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman 2366b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman 2466b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman(** [parse_bitcode context mb] parses the bitcode for a new module [m] from the 2566b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman memory buffer [mb] in the context [context]. Returns [m] if successful, or 2666b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman raises [Error msg] otherwise, where [msg] is a description of the error 2766b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman encountered. See the function [llvm::ParseBitcodeFile]. *) 2866b8ab22586debccb1f787d4d52b7f042d4ddeb8John Baumanval parse_bitcode : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule 2966b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman 30