rocm.bindings.llvm.c.target#

2026-09-24

13 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Attributes#

Classes#

LLVMByteOrdering

(No short description)

LLVMOpaqueTargetData

(No short description)

LLVMOpaqueTargetLibraryInfotData

(No short description)

Functions#

has_symbol(→ bool)

LLVMInitializeAllTargetInfos()

LLVMInitializeAllTargetInfos - The main program should call this function if

LLVMInitializeAllTargets()

LLVMInitializeAllTargets - The main program should call this function if it

LLVMInitializeAllTargetMCs()

LLVMInitializeAllTargetMCs - The main program should call this function if

LLVMInitializeAllAsmPrinters()

LLVMInitializeAllAsmPrinters - The main program should call this function if

LLVMInitializeAllAsmParsers()

LLVMInitializeAllAsmParsers - The main program should call this function if

LLVMInitializeAllDisassemblers()

LLVMInitializeAllDisassemblers - The main program should call this function

LLVMInitializeNativeTarget()

LLVMInitializeNativeTarget - The main program should call this function to

LLVMInitializeNativeAsmParser()

LLVMInitializeNativeTargetAsmParser - The main program should call this

LLVMInitializeNativeAsmPrinter()

LLVMInitializeNativeTargetAsmPrinter - The main program should call this

LLVMInitializeNativeDisassembler()

LLVMInitializeNativeTargetDisassembler - The main program should call this

LLVMGetModuleDataLayout(M)

Obtain the data layout for a module.

LLVMSetModuleDataLayout(M, DL)

Set the data layout for a module.

LLVMCreateTargetData(StringRep)

Creates target data from a target layout string.

LLVMDisposeTargetData(TD)

Deallocates a TargetData.

LLVMAddTargetLibraryInfo(TLI, PM)

Adds target library information to a pass manager.

LLVMCopyStringRepOfTargetData(TD)

Converts target data to a target layout string.

LLVMByteOrder(TD)

Returns the byte order of a target, either LLVMBigEndian or

LLVMPointerSize(TD)

Returns the pointer size in bytes for a target.

LLVMPointerSizeForAS(TD, AS)

Returns the pointer size in bytes for a target for a specified

LLVMIntPtrType(TD)

Returns the integer type that is the same size as a pointer on a target.

LLVMIntPtrTypeForAS(TD, AS)

Returns the integer type that is the same size as a pointer on a target.

LLVMIntPtrTypeInContext(C, TD)

Returns the integer type that is the same size as a pointer on a target.

LLVMIntPtrTypeForASInContext(C, TD, AS)

Returns the integer type that is the same size as a pointer on a target.

LLVMSizeOfTypeInBits(TD, Ty)

Computes the size of a type in bits for a target.

LLVMStoreSizeOfType(TD, Ty)

Computes the storage size of a type in bytes for a target.

LLVMABISizeOfType(TD, Ty)

Computes the ABI size of a type in bytes for a target.

LLVMABIAlignmentOfType(TD, Ty)

Computes the ABI alignment of a type in bytes for a target.

LLVMCallFrameAlignmentOfType(TD, Ty)

Computes the call frame alignment of a type in bytes for a target.

LLVMPreferredAlignmentOfType(TD, Ty)

Computes the preferred alignment of a type in bytes for a target.

LLVMPreferredAlignmentOfGlobal(TD, GlobalVar)

Computes the preferred alignment of a global variable in bytes for a target.

LLVMElementAtOffset(TD, StructTy, Offset)

Computes the structure element that contains the byte offset for a target.

LLVMOffsetOfElement(TD, StructTy, Element)

Computes the byte offset of the indexed struct element for a target.

Module Contents#

rocm.bindings.llvm.c.target.has_symbol(name: str | bytes | bytearray) → bool#
class rocm.bindings.llvm.c.target.LLVMByteOrdering#

Bases: enum.IntEnum

(No short description)

LLVMBigEndian: int#
LLVMLittleEndian: int#
class rocm.bindings.llvm.c.target.LLVMOpaqueTargetData(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.target.LLVMTargetDataRef#
class rocm.bindings.llvm.c.target.LLVMOpaqueTargetLibraryInfotData(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.target.LLVMTargetLibraryInfoRef#
rocm.bindings.llvm.c.target.LLVMInitializeAllTargetInfos()#

LLVMInitializeAllTargetInfos - The main program should call this function if it wants access to all available targets that LLVM is configured to support.

C signature

void LLVMInitializeAllTargetInfos()
rocm.bindings.llvm.c.target.LLVMInitializeAllTargets()#

LLVMInitializeAllTargets - The main program should call this function if it wants to link in all available targets that LLVM is configured to support.

C signature

void LLVMInitializeAllTargets()
rocm.bindings.llvm.c.target.LLVMInitializeAllTargetMCs()#

LLVMInitializeAllTargetMCs - The main program should call this function if it wants access to all available target MC that LLVM is configured to support.

C signature

void LLVMInitializeAllTargetMCs()
rocm.bindings.llvm.c.target.LLVMInitializeAllAsmPrinters()#

LLVMInitializeAllAsmPrinters - The main program should call this function if it wants all asm printers that LLVM is configured to support, to make them available via the TargetRegistry.

C signature

void LLVMInitializeAllAsmPrinters()
rocm.bindings.llvm.c.target.LLVMInitializeAllAsmParsers()#

LLVMInitializeAllAsmParsers - The main program should call this function if it wants all asm parsers that LLVM is configured to support, to make them available via the TargetRegistry.

C signature

void LLVMInitializeAllAsmParsers()
rocm.bindings.llvm.c.target.LLVMInitializeAllDisassemblers()#

LLVMInitializeAllDisassemblers - The main program should call this function if it wants all disassemblers that LLVM is configured to support, to make them available via the TargetRegistry.

C signature

void LLVMInitializeAllDisassemblers()
rocm.bindings.llvm.c.target.LLVMInitializeNativeTarget()#

LLVMInitializeNativeTarget - The main program should call this function to initialize the native target corresponding to the host.

This is useful for JIT applications to ensure that the target gets linked in correctly.

Returns:

int: (undocumented)

C signature

LLVMBool LLVMInitializeNativeTarget()
rocm.bindings.llvm.c.target.LLVMInitializeNativeAsmParser()#

LLVMInitializeNativeTargetAsmParser - The main program should call this function to initialize the parser for the native target corresponding to the host.

Returns:

int: (undocumented)

C signature

LLVMBool LLVMInitializeNativeAsmParser()
rocm.bindings.llvm.c.target.LLVMInitializeNativeAsmPrinter()#

LLVMInitializeNativeTargetAsmPrinter - The main program should call this function to initialize the printer for the native target corresponding to the host.

Returns:

int: (undocumented)

C signature

LLVMBool LLVMInitializeNativeAsmPrinter()
rocm.bindings.llvm.c.target.LLVMInitializeNativeDisassembler()#

LLVMInitializeNativeTargetDisassembler - The main program should call this function to initialize the disassembler for the native target corresponding to the host.

Returns:

int: (undocumented)

C signature

LLVMBool LLVMInitializeNativeDisassembler()
rocm.bindings.llvm.c.target.LLVMGetModuleDataLayout(M)#

Obtain the data layout for a module.

See:

Module::getDataLayout()

Args:
M (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M)
rocm.bindings.llvm.c.target.LLVMSetModuleDataLayout(M, DL)#

Set the data layout for a module.

See:

Module::setDataLayout()

Args:
M (Pointer/object):

(undocumented)

DL (LLVMOpaqueTargetData/object):

(undocumented)

C signature

void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL)
rocm.bindings.llvm.c.target.LLVMCreateTargetData(StringRep)#

Creates target data from a target layout string.

See the constructor llvm::DataLayout::DataLayout.

Args:
StringRep (CStr/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMTargetDataRef LLVMCreateTargetData(const char * StringRep)
rocm.bindings.llvm.c.target.LLVMDisposeTargetData(TD)#

Deallocates a TargetData.

See the destructor llvm::DataLayout::~DataLayout.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

C signature

void LLVMDisposeTargetData(LLVMTargetDataRef TD)
rocm.bindings.llvm.c.target.LLVMAddTargetLibraryInfo(TLI, PM)#

Adds target library information to a pass manager.

This does not take ownership of the target library info. See the method llvm::PassManagerBase::add.

Args:
TLI (LLVMOpaqueTargetLibraryInfotData/object):

(undocumented)

PM (Pointer/object):

(undocumented)

C signature

void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI, LLVMPassManagerRef PM)
rocm.bindings.llvm.c.target.LLVMCopyStringRepOfTargetData(TD)#

Converts target data to a target layout string.

The string must be disposed with LLVMDisposeMessage. See the constructor llvm::DataLayout::DataLayout.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

char * LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD)
rocm.bindings.llvm.c.target.LLVMByteOrder(TD)#

Returns the byte order of a target, either LLVMBigEndian or LLVMLittleEndian.

See the method llvm::DataLayout::isLittleEndian.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Returns:

LLVMByteOrdering: (undocumented)

C signature

enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD)
rocm.bindings.llvm.c.target.LLVMPointerSize(TD)#

Returns the pointer size in bytes for a target.

See the method llvm::DataLayout::getPointerSize.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int LLVMPointerSize(LLVMTargetDataRef TD)
rocm.bindings.llvm.c.target.LLVMPointerSizeForAS(TD, AS)#

Returns the pointer size in bytes for a target for a specified address space.

See the method llvm::DataLayout::getPointerSize.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

AS (int):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned int AS)
rocm.bindings.llvm.c.target.LLVMIntPtrType(TD)#

Returns the integer type that is the same size as a pointer on a target.

See the method llvm::DataLayout::getIntPtrType.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD)
rocm.bindings.llvm.c.target.LLVMIntPtrTypeForAS(TD, AS)#

Returns the integer type that is the same size as a pointer on a target.

This version allows the address space to be specified. See the method llvm::DataLayout::getIntPtrType.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

AS (int):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned int AS)
rocm.bindings.llvm.c.target.LLVMIntPtrTypeInContext(C, TD)#

Returns the integer type that is the same size as a pointer on a target.

See the method llvm::DataLayout::getIntPtrType.

Args:
C (Pointer/object):

(undocumented)

TD (LLVMOpaqueTargetData/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD)
rocm.bindings.llvm.c.target.LLVMIntPtrTypeForASInContext(C, TD, AS)#

Returns the integer type that is the same size as a pointer on a target.

This version allows the address space to be specified. See the method llvm::DataLayout::getIntPtrType.

Args:
C (Pointer/object):

(undocumented)

TD (LLVMOpaqueTargetData/object):

(undocumented)

AS (int):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD, unsigned int AS)
rocm.bindings.llvm.c.target.LLVMSizeOfTypeInBits(TD, Ty)#

Computes the size of a type in bits for a target.

See the method llvm::DataLayout::getTypeSizeInBits.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Ty (Pointer/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty)
rocm.bindings.llvm.c.target.LLVMStoreSizeOfType(TD, Ty)#

Computes the storage size of a type in bytes for a target.

See the method llvm::DataLayout::getTypeStoreSize.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Ty (Pointer/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
rocm.bindings.llvm.c.target.LLVMABISizeOfType(TD, Ty)#

Computes the ABI size of a type in bytes for a target.

See the method llvm::DataLayout::getTypeAllocSize.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Ty (Pointer/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
rocm.bindings.llvm.c.target.LLVMABIAlignmentOfType(TD, Ty)#

Computes the ABI alignment of a type in bytes for a target.

See the method llvm::DataLayout::getTypeABISize.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Ty (Pointer/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
rocm.bindings.llvm.c.target.LLVMCallFrameAlignmentOfType(TD, Ty)#

Computes the call frame alignment of a type in bytes for a target.

See the method llvm::DataLayout::getTypeABISize.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Ty (Pointer/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
rocm.bindings.llvm.c.target.LLVMPreferredAlignmentOfType(TD, Ty)#

Computes the preferred alignment of a type in bytes for a target.

See the method llvm::DataLayout::getTypeABISize.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

Ty (Pointer/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
rocm.bindings.llvm.c.target.LLVMPreferredAlignmentOfGlobal(TD, GlobalVar)#

Computes the preferred alignment of a global variable in bytes for a target.

See the method llvm::DataLayout::getPreferredAlignment.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

GlobalVar (Pointer/object):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD, LLVMValueRef GlobalVar)
rocm.bindings.llvm.c.target.LLVMElementAtOffset(TD, StructTy, Offset)#

Computes the structure element that contains the byte offset for a target.

See the method llvm::StructLayout::getElementContainingOffset.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

StructTy (Pointer/object):

(undocumented)

Offset (int):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned int LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned long long Offset)
rocm.bindings.llvm.c.target.LLVMOffsetOfElement(TD, StructTy, Element)#

Computes the byte offset of the indexed struct element for a target.

See the method llvm::StructLayout::getElementContainingOffset.

Args:
TD (LLVMOpaqueTargetData/object):

(undocumented)

StructTy (Pointer/object):

(undocumented)

Element (int):

(undocumented)

Returns:

int: (undocumented)

C signature

unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned int Element)