LLVM 22.0.0git
BitReader.h
Go to the documentation of this file.
1/*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\
2|* *|
3|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4|* Exceptions. *|
5|* See https://llvm.org/LICENSE.txt for license information. *|
6|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
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/Deprecated.h"
23#include "llvm-c/ExternC.h"
24#include "llvm-c/Types.h"
25#include "llvm-c/Visibility.h"
26
28
29/**
30 * @defgroup LLVMCBitReader Bit Reader
31 * @ingroup LLVMC
32 *
33 * @{
34 */
35
36/* Builds a module from the bitcode in the specified memory buffer, returning a
37 reference to the module via the OutModule parameter. Returns 0 on success.
38 Optionally returns a human-readable error message via OutMessage.
39
40 This is deprecated. Use LLVMParseBitcode2. */
43 LLVMModuleRef *OutModule, char **OutMessage),
44 "Use of the global context is deprecated, use LLVMParseBitcodeInContext2 "
45 "instead");
46
47/* Builds a module from the bitcode in the specified memory buffer, returning a
48 reference to the module via the OutModule parameter. Returns 0 on success. */
51 LLVMModuleRef *OutModule),
52 "Use of the global context is deprecated, use LLVMParseBitcodeInContext2 "
53 "instead");
54
55/* This is deprecated. Use LLVMParseBitcodeInContext2. */
58 LLVMModuleRef *OutModule,
59 char **OutMessage);
60
63 LLVMModuleRef *OutModule);
64
65/** Reads a module from the specified path, returning via the OutMP parameter
66 a module provider which performs lazy deserialization. Returns 0 on success.
67 Optionally returns a human-readable error message via OutMessage.
68 This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
71 LLVMModuleRef *OutM,
72 char **OutMessage);
73
74/** Reads a module from the given memory buffer, returning via the OutMP
75 * parameter a module provider which performs lazy deserialization.
76 *
77 * Returns 0 on success.
78 *
79 * Takes ownership of \p MemBuf if (and only if) the module was read
80 * successfully. */
83 LLVMModuleRef *OutM);
84
85/* This is deprecated. Use LLVMGetBitcodeModule2. */
88 LLVMModuleRef *OutM, char **OutMessage),
89 "Use of the global context is deprecated, use "
90 "LLVMGetBitcodeModuleInContext2 instead");
91
94 LLVMModuleRef *OutM),
95 "Use of the global context is deprecated, use "
96 "LLVMGetBitcodeModuleInContext2 instead");
97
98/**
99 * @}
100 */
101
103
104#endif
LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule)
Definition BitReader.cpp:29
LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage)
Definition BitReader.cpp:23
LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM)
LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage)
#define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message)
Definition Deprecated.h:34
#define LLVM_C_EXTERN_C_BEGIN
Definition ExternC.h:35
#define LLVM_C_EXTERN_C_END
Definition ExternC.h:36
#define LLVM_C_ABI
LLVM_C_ABI is the export/visibility macro used to mark symbols declared in llvm-c as exported when bu...
Definition Visibility.h:40
LLVM_C_ABI LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule)
Definition BitReader.cpp:58
LLVM_C_ABI LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage)
Reads a module from the specified path, returning via the OutMP parameter a module provider which per...
Definition BitReader.cpp:78
LLVM_C_ABI LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage)
Definition BitReader.cpp:35
LLVM_C_ABI LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM)
Reads a module from the given memory buffer, returning via the OutMP parameter a module provider whic...
int LLVMBool
Definition Types.h:28
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition Types.h:48
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition Types.h:53
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition Types.h:61