rocm.bindings.llvm.c.disassembler#

2026-09-24

7 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Functions#

has_symbol(→ bool)

LLVMCreateDisasm(TripleName, DisInfo, TagType, ...)

Create a disassembler for the TripleName.

LLVMCreateDisasmCPU(Triple, CPU, DisInfo, TagType, ...)

Create a disassembler for the TripleName and a specific CPU.

LLVMCreateDisasmCPUFeatures(Triple, CPU, Features, ...)

Create a disassembler for the TripleName, a specific CPU and specific feature

LLVMSetDisasmOptions(DC, Options)

Set the disassembler's options.

LLVMDisasmDispose(DC)

Dispose of a disassembler context.

LLVMDisasmInstruction(DC, Bytes, BytesSize, PC, ...)

Disassemble a single instruction using the disassembler context specified in

Module Contents#

rocm.bindings.llvm.c.disassembler.has_symbol(name: str | bytes | bytearray) → bool#
rocm.bindings.llvm.c.disassembler.LLVMCreateDisasm(TripleName, DisInfo, TagType, GetOpInfo, SymbolLookUp)#

Create a disassembler for the TripleName.

Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed as NULL. If successful, this returns a disassembler context. If not, it returns NULL. This function is equivalent to calling LLVMCreateDisasmCPUFeatures() with an empty CPU name and feature set.

Args:
TripleName (CStr/object):

(undocumented)

DisInfo (Pointer/object):

(undocumented)

TagType (int):

(undocumented)

GetOpInfo (Pointer/object):

(undocumented)

SymbolLookUp (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMDisasmContextRef LLVMCreateDisasm(const char * TripleName, void * DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp)
rocm.bindings.llvm.c.disassembler.LLVMCreateDisasmCPU(Triple, CPU, DisInfo, TagType, GetOpInfo, SymbolLookUp)#

Create a disassembler for the TripleName and a specific CPU.

Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed * as NULL. If successful, this returns a disassembler context. If not, it returns NULL. This function is equivalent to calling LLVMCreateDisasmCPUFeatures() with an empty feature set.

Args:
Triple (CStr/object):

(undocumented)

CPU (CStr/object):

(undocumented)

DisInfo (Pointer/object):

(undocumented)

TagType (int):

(undocumented)

GetOpInfo (Pointer/object):

(undocumented)

SymbolLookUp (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMDisasmContextRef LLVMCreateDisasmCPU(const char * Triple, const char * CPU, void * DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp)
rocm.bindings.llvm.c.disassembler.LLVMCreateDisasmCPUFeatures(Triple, CPU, Features, DisInfo, TagType, GetOpInfo, SymbolLookUp)#

Create a disassembler for the TripleName, a specific CPU and specific feature string.

Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed * as NULL. If successful, this returns a disassembler context. If not, it returns NULL.

Args:
Triple (CStr/object):

(undocumented)

CPU (CStr/object):

(undocumented)

Features (CStr/object):

(undocumented)

DisInfo (Pointer/object):

(undocumented)

TagType (int):

(undocumented)

GetOpInfo (Pointer/object):

(undocumented)

SymbolLookUp (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMDisasmContextRef LLVMCreateDisasmCPUFeatures(const char * Triple, const char * CPU, const char * Features, void * DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp)
rocm.bindings.llvm.c.disassembler.LLVMSetDisasmOptions(DC, Options)#

Set the disassembler’s options.

Returns 1 if it can set the Options and 0 otherwise.

Args:
DC (Pointer/object):

(undocumented)

Options (int):

(undocumented)

Returns:

int: (undocumented)

C signature

int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options)
rocm.bindings.llvm.c.disassembler.LLVMDisasmDispose(DC)#

Dispose of a disassembler context.

Args:
DC (Pointer/object):

(undocumented)

C signature

void LLVMDisasmDispose(LLVMDisasmContextRef DC)
rocm.bindings.llvm.c.disassembler.LLVMDisasmInstruction(DC, Bytes, BytesSize, PC, OutString, OutStringSize)#

Disassemble a single instruction using the disassembler context specified in the parameter DC.

The bytes of the instruction are specified in the parameter Bytes, and contains at least BytesSize number of bytes. The instruction is at the address specified by the PC parameter. If a valid instruction can be disassembled, its string is returned indirectly in OutString whose size is specified in the parameter OutStringSize. This function returns the number of bytes in the instruction or zero if there was no valid instruction.

Args:
DC (Pointer/object):

(undocumented)

Bytes (Pointer/object):

(undocumented)

BytesSize (int):

(undocumented)

PC (int):

(undocumented)

OutString (CStr/object):

(undocumented)

OutStringSize (int):

(undocumented)

Returns:

int: (undocumented)

C signature

size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t * Bytes, uint64_t BytesSize, uint64_t PC, char * OutString, size_t OutStringSize)