1 /*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\
3 |* The LLVM Compiler Infrastructure *|
5 |* This file is distributed under the University of Illinois Open Source *|
6 |* License. See LICENSE.TXT for details. *|
8 |*===----------------------------------------------------------------------===*|
10 |* This header declares the C interface to libLLVMBitReader.a, which *|
11 |* implements input of the LLVM bitcode format. *|
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. *|
17 \*===----------------------------------------------------------------------===*/
19 #ifndef LLVM_C_BITREADER_H
20 #define LLVM_C_BITREADER_H
22 #include "llvm-c/Core.h"
29 * @defgroup LLVMCBitReader Bit Reader
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.
37 Optionally returns a human-readable error message via OutMessage. */
38 LLVMBool
LLVMParseBitcode(LLVMMemoryBufferRef MemBuf
,
39 LLVMModuleRef
*OutModule
, char **OutMessage
);
41 LLVMBool
LLVMParseBitcodeInContext(LLVMContextRef ContextRef
,
42 LLVMMemoryBufferRef MemBuf
,
43 LLVMModuleRef
*OutModule
, char **OutMessage
);
45 /** Reads a module from the specified path, returning via the OutMP parameter
46 a module provider which performs lazy deserialization. Returns 0 on success.
47 Optionally returns a human-readable error message via OutMessage. */
48 LLVMBool
LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef
,
49 LLVMMemoryBufferRef MemBuf
,
53 LLVMBool
LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf
, LLVMModuleRef
*OutM
,
57 /** Deprecated: Use LLVMGetBitcodeModuleInContext instead. */
58 LLVMBool
LLVMGetBitcodeModuleProviderInContext(LLVMContextRef ContextRef
,
59 LLVMMemoryBufferRef MemBuf
,
60 LLVMModuleProviderRef
*OutMP
,
63 /** Deprecated: Use LLVMGetBitcodeModule instead. */
64 LLVMBool
LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf
,
65 LLVMModuleProviderRef
*OutMP
,