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