1*9880d681SAndroid Build Coastguard Worker /*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\ 2*9880d681SAndroid Build Coastguard Worker |* *| 3*9880d681SAndroid Build Coastguard Worker |* The LLVM Compiler Infrastructure *| 4*9880d681SAndroid Build Coastguard Worker |* *| 5*9880d681SAndroid Build Coastguard Worker |* This file is distributed under the University of Illinois Open Source *| 6*9880d681SAndroid Build Coastguard Worker |* License. See LICENSE.TXT for details. *| 7*9880d681SAndroid Build Coastguard Worker |* *| 8*9880d681SAndroid Build Coastguard Worker |*===----------------------------------------------------------------------===*| 9*9880d681SAndroid Build Coastguard Worker |* *| 10*9880d681SAndroid Build Coastguard Worker |* This header declares the C interface to libLLVMBitReader.a, which *| 11*9880d681SAndroid Build Coastguard Worker |* implements input of the LLVM bitcode format. *| 12*9880d681SAndroid Build Coastguard Worker |* *| 13*9880d681SAndroid Build Coastguard Worker |* Many exotic languages can interoperate with C code but have a harder time *| 14*9880d681SAndroid Build Coastguard Worker |* with C++ due to name mangling. So in addition to C, this interface enables *| 15*9880d681SAndroid Build Coastguard Worker |* tools written in such languages. *| 16*9880d681SAndroid Build Coastguard Worker |* *| 17*9880d681SAndroid Build Coastguard Worker \*===----------------------------------------------------------------------===*/ 18*9880d681SAndroid Build Coastguard Worker 19*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_C_BITREADER_H 20*9880d681SAndroid Build Coastguard Worker #define LLVM_C_BITREADER_H 21*9880d681SAndroid Build Coastguard Worker 22*9880d681SAndroid Build Coastguard Worker #include "llvm-c/Types.h" 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Worker #ifdef __cplusplus 25*9880d681SAndroid Build Coastguard Worker extern "C" { 26*9880d681SAndroid Build Coastguard Worker #endif 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Worker /** 29*9880d681SAndroid Build Coastguard Worker * @defgroup LLVMCBitReader Bit Reader 30*9880d681SAndroid Build Coastguard Worker * @ingroup LLVMC 31*9880d681SAndroid Build Coastguard Worker * 32*9880d681SAndroid Build Coastguard Worker * @{ 33*9880d681SAndroid Build Coastguard Worker */ 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Worker /* Builds a module from the bitcode in the specified memory buffer, returning a 36*9880d681SAndroid Build Coastguard Worker reference to the module via the OutModule parameter. Returns 0 on success. 37*9880d681SAndroid Build Coastguard Worker Optionally returns a human-readable error message via OutMessage. 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Worker This is deprecated. Use LLVMParseBitcode2. */ 40*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, 41*9880d681SAndroid Build Coastguard Worker char **OutMessage); 42*9880d681SAndroid Build Coastguard Worker 43*9880d681SAndroid Build Coastguard Worker /* Builds a module from the bitcode in the specified memory buffer, returning a 44*9880d681SAndroid Build Coastguard Worker reference to the module via the OutModule parameter. Returns 0 on success. */ 45*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf, 46*9880d681SAndroid Build Coastguard Worker LLVMModuleRef *OutModule); 47*9880d681SAndroid Build Coastguard Worker 48*9880d681SAndroid Build Coastguard Worker /* This is deprecated. Use LLVMParseBitcodeInContext2. */ 49*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, 50*9880d681SAndroid Build Coastguard Worker LLVMMemoryBufferRef MemBuf, 51*9880d681SAndroid Build Coastguard Worker LLVMModuleRef *OutModule, char **OutMessage); 52*9880d681SAndroid Build Coastguard Worker 53*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef, 54*9880d681SAndroid Build Coastguard Worker LLVMMemoryBufferRef MemBuf, 55*9880d681SAndroid Build Coastguard Worker LLVMModuleRef *OutModule); 56*9880d681SAndroid Build Coastguard Worker 57*9880d681SAndroid Build Coastguard Worker /** Reads a module from the specified path, returning via the OutMP parameter 58*9880d681SAndroid Build Coastguard Worker a module provider which performs lazy deserialization. Returns 0 on success. 59*9880d681SAndroid Build Coastguard Worker Optionally returns a human-readable error message via OutMessage. 60*9880d681SAndroid Build Coastguard Worker This is deprecated. Use LLVMGetBitcodeModuleInContext2. */ 61*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, 62*9880d681SAndroid Build Coastguard Worker LLVMMemoryBufferRef MemBuf, 63*9880d681SAndroid Build Coastguard Worker LLVMModuleRef *OutM, char **OutMessage); 64*9880d681SAndroid Build Coastguard Worker 65*9880d681SAndroid Build Coastguard Worker /** Reads a module from the specified path, returning via the OutMP parameter a 66*9880d681SAndroid Build Coastguard Worker * module provider which performs lazy deserialization. Returns 0 on success. */ 67*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef, 68*9880d681SAndroid Build Coastguard Worker LLVMMemoryBufferRef MemBuf, 69*9880d681SAndroid Build Coastguard Worker LLVMModuleRef *OutM); 70*9880d681SAndroid Build Coastguard Worker 71*9880d681SAndroid Build Coastguard Worker /* This is deprecated. Use LLVMGetBitcodeModule2. */ 72*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, 73*9880d681SAndroid Build Coastguard Worker char **OutMessage); 74*9880d681SAndroid Build Coastguard Worker 75*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM); 76*9880d681SAndroid Build Coastguard Worker 77*9880d681SAndroid Build Coastguard Worker /** 78*9880d681SAndroid Build Coastguard Worker * @} 79*9880d681SAndroid Build Coastguard Worker */ 80*9880d681SAndroid Build Coastguard Worker 81*9880d681SAndroid Build Coastguard Worker #ifdef __cplusplus 82*9880d681SAndroid Build Coastguard Worker } 83*9880d681SAndroid Build Coastguard Worker #endif 84*9880d681SAndroid Build Coastguard Worker 85*9880d681SAndroid Build Coastguard Worker #endif 86