rocm.bindings.llvm.c.cylljit

rocm.bindings.llvm.c.cylljit#

2026-09-24

9 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Cython declarations for the C-level interface. Use cimport rocm.bindings.llvm.c.cylljit from your Cython code to access these declarations directly.

See also

The high-level Python API is documented at rocm.bindings.llvm.c.lljit.

# MIT License
#
# Copyright (c) 2021-2026 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


# This file has been autogenerated, do not modify.

from libc.stdint cimport *
ctypedef bint _Bool # bool is not a reserved keyword in C, _Bool is
from rocm.bindings.llvm.c.cyerror cimport *
from rocm.bindings.llvm.c.cyorc cimport *
from rocm.bindings.llvm.c.cytargetmachine cimport *
from rocm.bindings.llvm.c.cytypes cimport *
from rocm.bindings.llvm.c.cyvisibility cimport *
cdef extern from "llvm-c/LLJIT.h":

    ctypedef LLVMOrcObjectLayerRef (*LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction) (void *,LLVMOrcExecutionSessionRef,const char *)

    cdef struct LLVMOrcOpaqueLLJITBuilder:
        pass

    ctypedef LLVMOrcOpaqueLLJITBuilder * LLVMOrcLLJITBuilderRef

    cdef struct LLVMOrcOpaqueLLJIT:
        pass

    ctypedef LLVMOrcOpaqueLLJIT * LLVMOrcLLJITRef

# 
# Create an LLVMOrcLLJITBuilder.
# 
# The client owns the resulting LLJITBuilder and should dispose of it using
# LLVMOrcDisposeLLJITBuilder once they are done with it.
cdef LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder() except? NULL nogil


# 
# Dispose of an LLVMOrcLLJITBuilderRef. This should only be called if ownership
# has not been passed to LLVMOrcCreateLLJIT (e.g. because some error prevented
# that function from being called).
cdef void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder) noexcept nogil


# 
# Set the JITTargetMachineBuilder to be used when constructing the LLJIT
# instance. Calling this function is optional: if it is not called then the
# LLJITBuilder will use JITTargeTMachineBuilder::detectHost to construct a
# JITTargetMachineBuilder.
# 
# This function takes ownership of the JTMB argument: clients should not
# dispose of the JITTargetMachineBuilder after calling this function.
cdef void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(LLVMOrcLLJITBuilderRef Builder,LLVMOrcJITTargetMachineBuilderRef JTMB) noexcept nogil


# 
# Set an ObjectLinkingLayer creator function for this LLJIT instance.
cdef void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(LLVMOrcLLJITBuilderRef Builder,LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction F,void * Ctx)


# 
# Create an LLJIT instance from an LLJITBuilder.
# 
# This operation takes ownership of the Builder argument: clients should not
# dispose of the builder after calling this function (even if the function
# returns an error). If a null Builder argument is provided then a
# default-constructed LLJITBuilder will be used.
# 
# On success the resulting LLJIT instance is uniquely owned by the client and
# automatically manages the memory of all JIT'd code and all modules that are
# transferred to it (e.g. via LLVMOrcLLJITAddLLVMIRModule). Disposing of the
# LLJIT instance will free all memory managed by the JIT, including JIT'd code
# and not-yet compiled modules.
cdef LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef * Result,LLVMOrcLLJITBuilderRef Builder) except? NULL nogil


# 
# Dispose of an LLJIT instance.
cdef LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J) except? NULL nogil


# 
# Get a reference to the ExecutionSession for this LLJIT instance.
# 
# The ExecutionSession is owned by the LLJIT instance. The client is not
# responsible for managing its memory.
cdef LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J) except? NULL nogil


# 
# Return a reference to the Main JITDylib.
# 
# The JITDylib is owned by the LLJIT instance. The client is not responsible
# for managing its memory.
cdef LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J) except? NULL nogil


# 
# Return the target triple for this LLJIT instance. This string is owned by
# the LLJIT instance and should not be freed by the client.
cdef const char * LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J) except? NULL nogil


# 
# Returns the global prefix character according to the LLJIT's DataLayout.
cdef char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J) except? -1 nogil


# 
# Mangles the given string according to the LLJIT instance's DataLayout, then
# interns the result in the SymbolStringPool and returns a reference to the
# pool entry. Clients should call LLVMOrcReleaseSymbolStringPoolEntry to
# decrement the ref-count on the pool entry once they are finished with this
# value.
cdef LLVMOrcSymbolStringPoolEntryRef LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J,const char * UnmangledName) except? NULL nogil


# 
# Add a buffer representing an object file to the given JITDylib in the given
# LLJIT instance. This operation transfers ownership of the buffer to the
# LLJIT instance. The buffer should not be disposed of or referenced once this
# function returns.
# 
# Resources associated with the given object will be tracked by the given
# JITDylib's default resource tracker.
cdef LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J,LLVMOrcJITDylibRef JD,LLVMMemoryBufferRef ObjBuffer) except? NULL nogil


# 
# Add a buffer representing an object file to the given ResourceTracker's
# JITDylib in the given LLJIT instance. This operation transfers ownership of
# the buffer to the LLJIT instance. The buffer should not be disposed of or
# referenced once this function returns.
# 
# Resources associated with the given object will be tracked by ResourceTracker
# RT.
cdef LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J,LLVMOrcResourceTrackerRef RT,LLVMMemoryBufferRef ObjBuffer) except? NULL nogil


# 
# Add an IR module to the given JITDylib in the given LLJIT instance. This
# operation transfers ownership of the TSM argument to the LLJIT instance.
# The TSM argument should not be disposed of or referenced once this
# function returns.
# 
# Resources associated with the given Module will be tracked by the given
# JITDylib's default resource tracker.
cdef LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,LLVMOrcJITDylibRef JD,LLVMOrcThreadSafeModuleRef TSM) except? NULL nogil


# 
# Add an IR module to the given ResourceTracker's JITDylib in the given LLJIT
# instance. This operation transfers ownership of the TSM argument to the LLJIT
# instance. The TSM argument should not be disposed of or referenced once this
# function returns.
# 
# Resources associated with the given Module will be tracked by ResourceTracker
# RT.
cdef LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J,LLVMOrcResourceTrackerRef JD,LLVMOrcThreadSafeModuleRef TSM) except? NULL nogil


# 
# Look up the given symbol in the main JITDylib of the given LLJIT instance.
# 
# This operation does not take ownership of the Name argument.
cdef LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J,uint64_t * Result,const char * Name) except? NULL nogil


# 
# Returns a non-owning reference to the LLJIT instance's object linking layer.
cdef LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J) except? NULL nogil


# 
# Returns a non-owning reference to the LLJIT instance's object linking layer.
cdef LLVMOrcObjectTransformLayerRef LLVMOrcLLJITGetObjTransformLayer(LLVMOrcLLJITRef J) except? NULL nogil


# 
# Returns a non-owning reference to the LLJIT instance's IR transform layer.
cdef LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J) except? NULL nogil


# 
# Get the LLJIT instance's default data layout string.
# 
# This string is owned by the LLJIT instance and does not need to be freed
# by the caller.
cdef const char * LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J) except? NULL nogil


cdef bint __lljit_has_symbol(const char* name) noexcept nogil