Skip to main content

llvm_sys/
bit_reader.rs

1//! Input of the LLVM bitcode format.
2
3use super::prelude::*;
4
5extern "C" {
6    /// Build a module from the bitcode in the specified memory buffer.
7    ///
8    /// Returns 0 on success and the generated module in `OutModule`.
9    /// Optionally returns a human-readable error message in `OutMessage`.
10    #[deprecated(
11        since = "38.0.0",
12        note = "Use of the global context is deprecated, use LLVMParseBitcodeInContext2 instead"
13    )]
14    pub fn LLVMParseBitcode(
15        MemBuf: LLVMMemoryBufferRef,
16        OutModule: *mut LLVMModuleRef,
17        OutMessage: *mut *mut ::libc::c_char,
18    ) -> LLVMBool;
19    /// Build a module from the bitcode in the specified memory buffer.
20    ///
21    /// Returns the created module in OutModule, returns 0 on success.
22    #[deprecated(
23        since = "221.0.0",
24        note = "Use of the global context is deprecated, use LLVMParseBitcodeInContext2 instead"
25    )]
26    pub fn LLVMParseBitcode2(
27        MemBuf: LLVMMemoryBufferRef,
28        OutModule: *mut LLVMModuleRef,
29    ) -> LLVMBool;
30
31    #[deprecated(since = "38.0.0", note = "Use LLVMParseBitcodeInContext2")]
32    pub fn LLVMParseBitcodeInContext(
33        ContextRef: LLVMContextRef,
34        MemBuf: LLVMMemoryBufferRef,
35        OutModule: *mut LLVMModuleRef,
36        OutMessage: *mut *mut ::libc::c_char,
37    ) -> LLVMBool;
38    pub fn LLVMParseBitcodeInContext2(
39        ContextRef: LLVMContextRef,
40        MemBuf: LLVMMemoryBufferRef,
41        OutModule: *mut LLVMModuleRef,
42    ) -> LLVMBool;
43
44    /// Read a module from the specified path, returning a module provider
45    /// performing lazy deserialization.
46    ///
47    /// Returns 0 on success and an optional error message.
48    #[deprecated(since = "38.0.0", note = "Use LLVMGetBitcodeModuleInContext2")]
49    pub fn LLVMGetBitcodeModuleInContext(
50        ContextRef: LLVMContextRef,
51        MemBuf: LLVMMemoryBufferRef,
52        OutM: *mut LLVMModuleRef,
53        OutMessage: *mut *mut ::libc::c_char,
54    ) -> LLVMBool;
55    /// Read a module from the specified path, returning a module provider
56    /// performing lazy deserialization.
57    ///
58    /// Returns 0 on success.
59    pub fn LLVMGetBitcodeModuleInContext2(
60        ContextRef: LLVMContextRef,
61        MemBuf: LLVMMemoryBufferRef,
62        OutM: *mut LLVMModuleRef,
63    ) -> LLVMBool;
64
65    #[deprecated(
66        since = "38.0.0",
67        note = "Use of the global context is deprecated, use LLVMParseBitcodeInContext2 instead"
68    )]
69    pub fn LLVMGetBitcodeModule(
70        MemBuf: LLVMMemoryBufferRef,
71        OutM: *mut LLVMModuleRef,
72        OutMessage: *mut *mut ::libc::c_char,
73    ) -> LLVMBool;
74    /// Read a module from the specified path.
75    ///
76    /// Outputs a module provider which performs lazy deserialization.
77    /// Returns 0 on success.
78    #[deprecated(
79        since = "221.0.0",
80        note = "Use of the global context is deprecated, use LLVMParseBitcodeInContext2 instead"
81    )]
82    pub fn LLVMGetBitcodeModule2(MemBuf: LLVMMemoryBufferRef, OutM: *mut LLVMModuleRef)
83        -> LLVMBool;
84}