1 /*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\
2 |*                                                                            *|
3 |*                     The LLVM Compiler Infrastructure                       *|
4 |*                                                                            *|
5 |* This file is distributed under the University of Illinois Open Source      *|
6 |* 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 module llvm.c.bitReader;
20 
21 public import llvm.c.types;
22 
23 extern(C) nothrow:
24 
25 /**
26  * @defgroup LLVMCBitReader Bit Reader
27  * @ingroup LLVMC
28  *
29  * @{
30  */
31 
32 /* Builds a module from the bitcode in the specified memory buffer, returning a
33    reference to the module via the OutModule parameter. Returns 0 on success.
34    Optionally returns a human-readable error message via OutMessage.
35 
36    This is deprecated. Use LLVMParseBitcode2. */
37 LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef* OutModule,
38                           char** OutMessage);
39 
40 /* Builds a module from the bitcode in the specified memory buffer, returning a
41    reference to the module via the OutModule parameter. Returns 0 on success. */
42 LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
43                            LLVMModuleRef* OutModule);
44 
45 /* This is deprecated. Use LLVMParseBitcodeInContext2. */
46 LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
47                                    LLVMMemoryBufferRef MemBuf,
48                                    LLVMModuleRef* OutModule, char** OutMessage);
49 
50 LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
51                                     LLVMMemoryBufferRef MemBuf,
52                                     LLVMModuleRef* OutModule);
53 
54 /** Reads a module from the specified path, returning via the OutMP parameter
55     a module provider which performs lazy deserialization. Returns 0 on success.
56     Optionally returns a human-readable error message via OutMessage.
57     This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
58 LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
59                                        LLVMMemoryBufferRef MemBuf,
60                                        LLVMModuleRef* OutM, char** OutMessage);
61 
62 /** Reads a module from the specified path, returning via the OutMP parameter a
63  * module provider which performs lazy deserialization. Returns 0 on success. */
64 LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
65                                         LLVMMemoryBufferRef MemBuf,
66                                         LLVMModuleRef* OutM);
67 
68 /* This is deprecated. Use LLVMGetBitcodeModule2. */
69 LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef* OutM,
70                               char** OutMessage);
71 
72 LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef* OutM);
73 
74 /**
75  * @}
76  */