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 | |
Benjamin Kramer | 00e08fc | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 19 | #ifndef LLVM_C_BITREADER_H |
| 20 | #define LLVM_C_BITREADER_H |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 21 | |
Eric Christopher | cca8dbe | 2015-12-18 01:46:52 +0000 | [diff] [blame] | 22 | #include "llvm-c/Types.h" |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
Gregory Szorc | 6244b51 | 2012-03-21 03:54:29 +0000 | [diff] [blame] | 28 | /** |
| 29 | * @defgroup LLVMCBitReader Bit Reader |
| 30 | * @ingroup LLVMC |
| 31 | * |
| 32 | * @{ |
| 33 | */ |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 34 | |
Gordon Henriksen | da1435f | 2007-12-19 22:30:40 +0000 | [diff] [blame] | 35 | /* Builds a module from the bitcode in the specified memory buffer, returning a |
| 36 | reference to the module via the OutModule parameter. Returns 0 on success. |
Rafael Espindola | 8d184ad | 2015-12-18 23:46:42 +0000 | [diff] [blame] | 37 | Optionally returns a human-readable error message via OutMessage. |
| 38 | |
| 39 | This is deprecated. Use LLVMParseBitcode2. */ |
Rafael Espindola | 1fef99c | 2015-12-18 03:04:52 +0000 | [diff] [blame] | 40 | LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, |
| 41 | char **OutMessage); |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 42 | |
Rafael Espindola | 8d184ad | 2015-12-18 23:46:42 +0000 | [diff] [blame] | 43 | /* Builds a module from the bitcode in the specified memory buffer, returning a |
| 44 | reference to the module via the OutModule parameter. Returns 0 on success. */ |
| 45 | LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf, |
| 46 | LLVMModuleRef *OutModule); |
| 47 | |
| 48 | /* This is deprecated. Use LLVMParseBitcodeInContext2. */ |
Chris Lattner | d686c8e | 2010-01-09 22:27:07 +0000 | [diff] [blame] | 49 | LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, |
| 50 | LLVMMemoryBufferRef MemBuf, |
| 51 | LLVMModuleRef *OutModule, char **OutMessage); |
Owen Anderson | c8897d9 | 2009-07-02 07:17:57 +0000 | [diff] [blame] | 52 | |
Rafael Espindola | 8d184ad | 2015-12-18 23:46:42 +0000 | [diff] [blame] | 53 | LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef, |
| 54 | LLVMMemoryBufferRef MemBuf, |
| 55 | LLVMModuleRef *OutModule); |
| 56 | |
Erick Tryzelaar | df7df07 | 2010-03-02 23:58:54 +0000 | [diff] [blame] | 57 | /** Reads a module from the specified path, returning via the OutMP parameter |
| 58 | a module provider which performs lazy deserialization. Returns 0 on success. |
Rafael Espindola | 8d184ad | 2015-12-18 23:46:42 +0000 | [diff] [blame] | 59 | Optionally returns a human-readable error message via OutMessage. |
| 60 | This is deprecated. Use LLVMGetBitcodeModuleInContext2. */ |
Erick Tryzelaar | df7df07 | 2010-03-02 23:58:54 +0000 | [diff] [blame] | 61 | LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, |
| 62 | LLVMMemoryBufferRef MemBuf, |
Rafael Espindola | 1fef99c | 2015-12-18 03:04:52 +0000 | [diff] [blame] | 63 | LLVMModuleRef *OutM, char **OutMessage); |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 64 | |
Rafael Espindola | 8d184ad | 2015-12-18 23:46:42 +0000 | [diff] [blame] | 65 | /** Reads a module from the specified path, returning via the OutMP parameter a |
| 66 | * module provider which performs lazy deserialization. Returns 0 on success. */ |
| 67 | LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef, |
| 68 | LLVMMemoryBufferRef MemBuf, |
| 69 | LLVMModuleRef *OutM); |
| 70 | |
| 71 | /* This is deprecated. Use LLVMGetBitcodeModule2. */ |
Erick Tryzelaar | df7df07 | 2010-03-02 23:58:54 +0000 | [diff] [blame] | 72 | LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, |
| 73 | char **OutMessage); |
| 74 | |
Rafael Espindola | 8d184ad | 2015-12-18 23:46:42 +0000 | [diff] [blame] | 75 | LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM); |
| 76 | |
Gregory Szorc | 6244b51 | 2012-03-21 03:54:29 +0000 | [diff] [blame] | 77 | /** |
| 78 | * @} |
| 79 | */ |
| 80 | |
Gordon Henriksen | bbc6597 | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 81 | #ifdef __cplusplus |
| 82 | } |
| 83 | #endif |
| 84 | |
| 85 | #endif |