Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 1 | /*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* The LLVM Compiler Infrastructure *| |
| 4 | |* *| |
Chris Lattner | 7ed47a1 | 2007-12-29 19:59:42 +0000 | [diff] [blame] | 5 | |* This file is distributed under the University of Illinois Open Source *| |
| 6 | |* License. See LICENSE.TXT for details. *| |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 7 | |* *| |
| 8 | |*===----------------------------------------------------------------------===*| |
| 9 | |* *| |
| 10 | |* This header declares the C interface to libLLVMBitReader.a, which *| |
| 11 | |* implements input of the LLVM bitcode format. *| |
| 12 | |* *| |
| 13 | |* Many exotic languages can interoperate with C code but have a harder time *| |
| 14 | |* with C++ due to name mangling. So in addition to C, this interface enables *| |
| 15 | |* tools written in such languages. *| |
| 16 | |* *| |
| 17 | \*===----------------------------------------------------------------------===*/ |
| 18 | |
| 19 | #ifndef LLVM_C_BITCODEREADER_H |
| 20 | #define LLVM_C_BITCODEREADER_H |
| 21 | |
| 22 | #include "llvm-c/Core.h" |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | |
Gordon Henriksen | da1435f | 2007-12-19 22:30:40 +0000 | [diff] [blame] | 29 | /* Builds a module from the bitcode in the specified memory buffer, returning a |
| 30 | reference to the module via the OutModule parameter. Returns 0 on success. |
| 31 | Optionally returns a human-readable error message via OutMessage. */ |
Chris Lattner | d686c8e | 2010-01-09 22:27:07 +0000 | [diff] [blame] | 32 | LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, |
| 33 | LLVMModuleRef *OutModule, char **OutMessage); |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 34 | |
Chris Lattner | d686c8e | 2010-01-09 22:27:07 +0000 | [diff] [blame] | 35 | LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, |
| 36 | LLVMMemoryBufferRef MemBuf, |
| 37 | LLVMModuleRef *OutModule, char **OutMessage); |
Owen Anderson | c8897d9 | 2009-07-02 07:17:57 +0000 | [diff] [blame] | 38 | |
Gordon Henriksen | da1435f | 2007-12-19 22:30:40 +0000 | [diff] [blame] | 39 | /* Reads a module from the specified path, returning via the OutMP parameter |
| 40 | a module provider which performs lazy deserialization. Returns 0 on success. |
| 41 | Optionally returns a human-readable error message via OutMessage. */ |
Chris Lattner | d686c8e | 2010-01-09 22:27:07 +0000 | [diff] [blame] | 42 | LLVMBool LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf, |
| 43 | LLVMModuleProviderRef *OutMP, |
| 44 | char **OutMessage); |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 45 | |
Chris Lattner | d686c8e | 2010-01-09 22:27:07 +0000 | [diff] [blame] | 46 | LLVMBool LLVMGetBitcodeModuleProviderInContext(LLVMContextRef ContextRef, |
| 47 | LLVMMemoryBufferRef MemBuf, |
| 48 | LLVMModuleProviderRef *OutMP, |
| 49 | char **OutMessage); |
Owen Anderson | c8897d9 | 2009-07-02 07:17:57 +0000 | [diff] [blame] | 50 | |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 51 | |
| 52 | #ifdef __cplusplus |
| 53 | } |
| 54 | #endif |
| 55 | |
| 56 | #endif |