llvm_sys/ir_reader.rs
1//! The IR reader
2
3use super::prelude::*;
4
5extern "C" {
6 /// Read LLVM IR from a memory buffer and convert it to an in-memory Module.
7 ///
8 /// Returns 0 on success, and an optional human-readable description of any
9 /// errors that occurred.
10 #[deprecated(since = "221.0.0", note = "Use LLVMParseIRInContext2 instead.")]
11 pub fn LLVMParseIRInContext(
12 ContextRef: LLVMContextRef,
13 MemBuf: LLVMMemoryBufferRef,
14 OutM: *mut LLVMModuleRef,
15 OutMessage: *mut *mut ::libc::c_char,
16 ) -> LLVMBool;
17 /// Read LLVM IR from a memory buffer and convert it into an in-memory Module
18 /// object. Returns 0 on success.
19 /// Optionally returns a human-readable description of any errors that
20 /// occurred during parsing IR. OutMessage must be disposed with
21 /// LLVMDisposeMessage.
22 /// The memory buffer is not consumed by this function. It is the responsibility
23 /// of the caller to free it with `LLVMDisposeMemoryBuffer`.
24 ///
25 /// See `llvm::ParseIR()`.
26 pub fn LLVMParseIRInContext2(
27 ContextRef: LLVMContextRef,
28 MemBuf: LLVMMemoryBufferRef,
29 OutM: *mut LLVMModuleRef,
30 OutMessage: *mut *mut ::libc::c_char,
31 ) -> LLVMBool;
32}