rocm.bindings.llvm.c.irreader#

2026-09-24

5 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Functions#

has_symbol(→ bool)

LLVMParseIRInContext(ContextRef, MemBuf)

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

LLVMParseIRInContext2(ContextRef, MemBuf)

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

Module Contents#

rocm.bindings.llvm.c.irreader.has_symbol(name: str | bytes | bytearray) → bool#
rocm.bindings.llvm.c.irreader.LLVMParseIRInContext(ContextRef, MemBuf)#

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:

llvm::ParseIR()

Args:
ContextRef (Pointer/object):

(undocumented)

MemBuf (Pointer/object):

(undocumented)

Returns:

A tuple of size 3 that contains (in that order):

C signature

LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef * OutM, char ** OutMessage)
rocm.bindings.llvm.c.irreader.LLVMParseIRInContext2(ContextRef, MemBuf)#

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:

llvm::ParseIR()

Args:
ContextRef (Pointer/object):

(undocumented)

MemBuf (Pointer/object):

(undocumented)

Returns:

A tuple of size 3 that contains (in that order):

C signature

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