| Gordon Henriksen | 2b0eed2 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 1 | (*===-- llvm_bitreader.mli - LLVM Ocaml Interface ---------------*- C++ -*-===* |
| 2 | * |
| 3 | * The LLVM Compiler Infrastructure |
| 4 | * |
| 5 | * This file was developed by Gordon Henriksen and is distributed under the |
| 6 | * University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | * |
| 8 | *===----------------------------------------------------------------------=== |
| 9 | * |
| 10 | * This interface provides an ocaml API for the LLVM bitcode reader, the |
| 11 | * classes in the Bitreader library. |
| 12 | * |
| 13 | *===----------------------------------------------------------------------===*) |
| 14 | |
| 15 | |
| Gordon Henriksen | 34eb6d8 | 2007-12-19 22:30:40 +0000 | [diff] [blame^] | 16 | exception Error of string |
| Gordon Henriksen | 2b0eed2 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 17 | |
| Gordon Henriksen | 34eb6d8 | 2007-12-19 22:30:40 +0000 | [diff] [blame^] | 18 | (** [read_bitcode_file path] reads the bitcode for a new module [m] from the |
| 19 | file at [path]. Returns [Success m] if successful, and [Failure msg] |
| 20 | otherwise, where [msg] is a description of the error encountered. |
| 21 | See the function [llvm::getBitcodeModuleProvider]. **) |
| 22 | external get_module_provider : Llvm.llmemorybuffer -> Llvm.llmoduleprovider |
| 23 | = "llvm_get_module_provider" |
| Gordon Henriksen | 2b0eed2 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 24 | |
| Gordon Henriksen | 34eb6d8 | 2007-12-19 22:30:40 +0000 | [diff] [blame^] | 25 | (** [parse_bitcode mb] parses the bitcode for a new module [m] from the memory |
| 26 | buffer [mb]. Returns [Success m] if successful, and [Failure msg] otherwise, |
| 27 | where [msg] is a description of the error encountered. |
| 28 | See the function [llvm::ParseBitcodeFile]. **) |
| 29 | external parse_bitcode : Llvm.llmemorybuffer -> Llvm.llmodule |
| 30 | = "llvm_parse_bitcode" |