• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef LLVM_C_BITREADER_H
20 #define LLVM_C_BITREADER_H
21 
22 #include "llvm-c/Types.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /**
29  * @defgroup LLVMCBitReader Bit Reader
30  * @ingroup LLVMC
31  *
32  * @{
33  */
34 
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 
39    This is deprecated. Use LLVMParseBitcode2. */
40 LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
41                           char **OutMessage);
42 
43 /* Builds a module from the bitcode in the specified memory buffer, returning a
44    reference to the module via the OutModule parameter. Returns 0 on success. */
45 LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
46                            LLVMModuleRef *OutModule);
47 
48 /* This is deprecated. Use LLVMParseBitcodeInContext2. */
49 LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
50                                    LLVMMemoryBufferRef MemBuf,
51                                    LLVMModuleRef *OutModule, char **OutMessage);
52 
53 LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
54                                     LLVMMemoryBufferRef MemBuf,
55                                     LLVMModuleRef *OutModule);
56 
57 /** Reads a module from the specified path, returning via the OutMP parameter
58     a module provider which performs lazy deserialization. Returns 0 on success.
59     Optionally returns a human-readable error message via OutMessage.
60     This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
61 LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
62                                        LLVMMemoryBufferRef MemBuf,
63                                        LLVMModuleRef *OutM, char **OutMessage);
64 
65 /** Reads a module from the specified path, returning via the OutMP parameter a
66  * module provider which performs lazy deserialization. Returns 0 on success. */
67 LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
68                                         LLVMMemoryBufferRef MemBuf,
69                                         LLVMModuleRef *OutM);
70 
71 /* This is deprecated. Use LLVMGetBitcodeModule2. */
72 LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
73                               char **OutMessage);
74 
75 LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
76 
77 /**
78  * @}
79  */
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
86