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(since = "38.0.0", note = "Use LLVMParseBitcode2")]
11    pub fn LLVMParseBitcode(
12        MemBuf: LLVMMemoryBufferRef,
13        OutModule: *mut LLVMModuleRef,
14        OutMessage: *mut *mut ::libc::c_char,
15    ) -> LLVMBool;
16    /// Build a module from the bitcode in the specified memory buffer.
17    ///
18    /// Returns the created module in OutModule, returns 0 on success.
19    pub fn LLVMParseBitcode2(
20        MemBuf: LLVMMemoryBufferRef,
21        OutModule: *mut LLVMModuleRef,
22    ) -> LLVMBool;
23
24    #[deprecated(since = "38.0.0", note = "Use LLVMParseBitcodeInContext2")]
25    pub fn LLVMParseBitcodeInContext(
26        ContextRef: LLVMContextRef,
27        MemBuf: LLVMMemoryBufferRef,
28        OutModule: *mut LLVMModuleRef,
29        OutMessage: *mut *mut ::libc::c_char,
30    ) -> LLVMBool;
31    pub fn LLVMParseBitcodeInContext2(
32        ContextRef: LLVMContextRef,
33        MemBuf: LLVMMemoryBufferRef,
34        OutModule: *mut LLVMModuleRef,
35    ) -> LLVMBool;
36
37    /// Read a module from the specified path, returning a module provider
38    /// performing lazy deserialization.
39    ///
40    /// Returns 0 on success and an optional error message.
41    #[deprecated(since = "38.0.0", note = "Use LLVMGetBitcodeModuleInContext2")]
42    pub fn LLVMGetBitcodeModuleInContext(
43        ContextRef: LLVMContextRef,
44        MemBuf: LLVMMemoryBufferRef,
45        OutM: *mut LLVMModuleRef,
46        OutMessage: *mut *mut ::libc::c_char,
47    ) -> LLVMBool;
48    /// Read a module from the specified path, returning a module provider
49    /// performing lazy deserialization.
50    ///
51    /// Returns 0 on success.
52    pub fn LLVMGetBitcodeModuleInContext2(
53        ContextRef: LLVMContextRef,
54        MemBuf: LLVMMemoryBufferRef,
55        OutM: *mut LLVMModuleRef,
56    ) -> LLVMBool;
57
58    #[deprecated(since = "38.0.0", note = "Use LLVMGetBitcodeModule2")]
59    pub fn LLVMGetBitcodeModule(
60        MemBuf: LLVMMemoryBufferRef,
61        OutM: *mut LLVMModuleRef,
62        OutMessage: *mut *mut ::libc::c_char,
63    ) -> LLVMBool;
64    /// Read a module from the specified path.
65    ///
66    /// Outputs a module provider which performs lazy deserialization.
67    /// Returns 0 on success.
68    pub fn LLVMGetBitcodeModule2(MemBuf: LLVMMemoryBufferRef, OutM: *mut LLVMModuleRef)
69        -> LLVMBool;
70}