Gordon Henriksen | 688bc4b | 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 | |* *| |
| 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 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 | |
| 29 | /* Reads a module from the specified path, returning a reference to the module |
| 30 | via the OutModule parameter. Returns 0 on success. Optionally returns a |
| 31 | human-readable error message. */ |
| 32 | int LLVMReadBitcodeFromFile(const char *Path, LLVMModuleRef *OutModule, |
| 33 | char **OutMessage); |
| 34 | |
Gordon Henriksen | a79e848 | 2007-12-12 01:04:30 +0000 | [diff] [blame] | 35 | /* Reads a module from the specified path, returning a reference to a lazy |
| 36 | module provider via the OutModule parameter. Returns 0 on success. Optionally |
| 37 | returns a human-readable error message. */ |
| 38 | int LLVMCreateModuleProviderFromFile(const char *Path, |
| 39 | LLVMModuleProviderRef *OutMP, |
| 40 | char **OutMessage); |
| 41 | |
Gordon Henriksen | 688bc4b | 2007-12-11 00:20:48 +0000 | [diff] [blame] | 42 | /* Disposes of the message allocated by the bitcode reader, if any. */ |
| 43 | void LLVMDisposeBitcodeReaderMessage(char *Message); |
| 44 | |
| 45 | |
| 46 | #ifdef __cplusplus |
| 47 | } |
| 48 | #endif |
| 49 | |
| 50 | #endif |