Peter Zotov | 578267f | 2013-11-06 09:21:25 +0000 | [diff] [blame] | 1 | (*===-- llvm_irreader.mli - LLVM OCaml Interface --------------*- OCaml -*-===* |
| 2 | * |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | * See https://llvm.org/LICENSE.txt for license information. |
| 5 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Peter Zotov | 578267f | 2013-11-06 09:21:25 +0000 | [diff] [blame] | 6 | * |
| 7 | *===----------------------------------------------------------------------===*) |
| 8 | |
| 9 | (** IR reader. |
| 10 | |
| 11 | This interface provides an OCaml API for the LLVM assembly reader, the |
| 12 | classes in the IRReader library. *) |
| 13 | |
| 14 | exception Error of string |
| 15 | |
| 16 | (** [parse_ir context mb] parses the IR for a new module [m] from the |
| 17 | memory buffer [mb] in the context [context]. Returns [m] if successful, or |
| 18 | raises [Error msg] otherwise, where [msg] is a description of the error |
| 19 | encountered. See the function [llvm::ParseIR]. *) |
| 20 | val parse_ir : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule |