LLVM 22.0.0git
Collaboration diagram for IR Reader:

Functions

LLVM_C_ABI LLVMBool LLVMParseIRInContext (LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage)
 Read LLVM IR from a memory buffer and convert it into an in-memory Module object.
LLVM_C_ABI LLVMBool LLVMParseIRInContext2 (LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage)
 Read LLVM IR from a memory buffer and convert it into an in-memory Module object.

Detailed Description

Function Documentation

◆ LLVMParseIRInContext()

LLVM_C_ABI LLVMBool LLVMParseIRInContext ( LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef * OutM,
char ** OutMessage )

Read LLVM IR from a memory buffer and convert it into an in-memory Module object.

Returns 0 on success. Optionally returns a human-readable description of any errors that occurred during parsing IR. OutMessage must be disposed with LLVMDisposeMessage. The memory buffer is consumed by this function. This is deprecated. Use LLVMParseIRInContext2 instead.

See also
llvm::ParseIR()

Definition at line 118 of file IRReader.cpp.

References LLVMParseIRInContext2(), llvm::unwrap(), and llvm::wrap().

◆ LLVMParseIRInContext2()

LLVM_C_ABI LLVMBool LLVMParseIRInContext2 ( LLVMContextRef ContextRef,
LLVMMemoryBufferRef MemBuf,
LLVMModuleRef * OutM,
char ** OutMessage )

Read LLVM IR from a memory buffer and convert it into an in-memory Module object.

Returns 0 on success. Optionally returns a human-readable description of any errors that occurred during parsing IR. OutMessage must be disposed with LLVMDisposeMessage. The memory buffer is not consumed by this function. It is the responsibility of the caller to free it with LLVMDisposeMemoryBuffer.

See also
llvm::ParseIR()

Definition at line 125 of file IRReader.cpp.

References llvm::parseIR(), llvm::SMDiagnostic::print(), llvm::release, llvm::unwrap(), and llvm::wrap().

Referenced by LLVMParseIRInContext().