LLVM API Documentation
00001 /*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\ 00002 |* *| 00003 |* The LLVM Compiler Infrastructure *| 00004 |* *| 00005 |* This file is distributed under the University of Illinois Open Source *| 00006 |* License. See LICENSE.TXT for details. *| 00007 |* *| 00008 |*===----------------------------------------------------------------------===*| 00009 |* *| 00010 |* This header declares the C interface to libLLVMBitReader.a, which *| 00011 |* implements input of the LLVM bitcode format. *| 00012 |* *| 00013 |* Many exotic languages can interoperate with C code but have a harder time *| 00014 |* with C++ due to name mangling. So in addition to C, this interface enables *| 00015 |* tools written in such languages. *| 00016 |* *| 00017 \*===----------------------------------------------------------------------===*/ 00018 00019 #ifndef LLVM_C_BITREADER_H 00020 #define LLVM_C_BITREADER_H 00021 00022 #include "llvm-c/Core.h" 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 /** 00029 * @defgroup LLVMCBitReader Bit Reader 00030 * @ingroup LLVMC 00031 * 00032 * @{ 00033 */ 00034 00035 /* Builds a module from the bitcode in the specified memory buffer, returning a 00036 reference to the module via the OutModule parameter. Returns 0 on success. 00037 Optionally returns a human-readable error message via OutMessage. */ 00038 LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, 00039 LLVMModuleRef *OutModule, char **OutMessage); 00040 00041 LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, 00042 LLVMMemoryBufferRef MemBuf, 00043 LLVMModuleRef *OutModule, char **OutMessage); 00044 00045 /** Reads a module from the specified path, returning via the OutMP parameter 00046 a module provider which performs lazy deserialization. Returns 0 on success. 00047 Optionally returns a human-readable error message via OutMessage. */ 00048 LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, 00049 LLVMMemoryBufferRef MemBuf, 00050 LLVMModuleRef *OutM, 00051 char **OutMessage); 00052 00053 LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, 00054 char **OutMessage); 00055 00056 00057 /** Deprecated: Use LLVMGetBitcodeModuleInContext instead. */ 00058 LLVMBool LLVMGetBitcodeModuleProviderInContext(LLVMContextRef ContextRef, 00059 LLVMMemoryBufferRef MemBuf, 00060 LLVMModuleProviderRef *OutMP, 00061 char **OutMessage); 00062 00063 /** Deprecated: Use LLVMGetBitcodeModule instead. */ 00064 LLVMBool LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf, 00065 LLVMModuleProviderRef *OutMP, 00066 char **OutMessage); 00067 00068 /** 00069 * @} 00070 */ 00071 00072 #ifdef __cplusplus 00073 } 00074 #endif 00075 00076 #endif