Peter Zotov | 662538a | 2014-10-29 08:15:54 +0000 | [diff] [blame] | 1 | (*===-- llvm_bitreader.mli - LLVM OCaml Interface -------------*- OCaml -*-===* |
Gordon Henriksen | 2b0eed2 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 2 | * |
| 3 | * The LLVM Compiler Infrastructure |
| 4 | * |
Chris Lattner | 6787a45 | 2007-12-29 22:59:10 +0000 | [diff] [blame] | 5 | * This file is distributed under the University of Illinois Open Source |
| 6 | * License. See LICENSE.TXT for details. |
Gordon Henriksen | 2b0eed2 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 7 | * |
Gordon Henriksen | 2b0eed2 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 8 | *===----------------------------------------------------------------------===*) |
| 9 | |
Gordon Henriksen | 95f4b77 | 2008-03-09 07:17:38 +0000 | [diff] [blame] | 10 | (** Bitcode reader. |
| 11 | |
Sylvestre Ledru | 493cd8c | 2013-11-01 00:26:01 +0000 | [diff] [blame] | 12 | This interface provides an OCaml API for the LLVM bitcode reader, the |
Gordon Henriksen | 95f4b77 | 2008-03-09 07:17:38 +0000 | [diff] [blame] | 13 | classes in the Bitreader library. *) |
Gordon Henriksen | 2b0eed2 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 14 | |
Gordon Henriksen | 34eb6d8 | 2007-12-19 22:30:40 +0000 | [diff] [blame] | 15 | exception Error of string |
Gordon Henriksen | 2b0eed2 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 16 | |
Erick Tryzelaar | 98b05d6 | 2010-03-02 23:59:00 +0000 | [diff] [blame] | 17 | (** [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 Edwin | 5abf51b | 2010-12-23 15:49:26 +0000 | [diff] [blame] | 21 | val get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule |
| 22 | |
Erick Tryzelaar | 5c35b5c | 2009-08-19 06:40:29 +0000 | [diff] [blame] | 23 | (** [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 Wendling | bd8e5d5 | 2012-07-19 00:23:13 +0000 | [diff] [blame] | 25 | raises [Error msg] otherwise, where [msg] is a description of the error |
| 26 | encountered. See the function [llvm::ParseBitcodeFile]. *) |
Torok Edwin | 5abf51b | 2010-12-23 15:49:26 +0000 | [diff] [blame] | 27 | val parse_bitcode : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule |