Class LLVMLLJIT

java.lang.Object
org.lwjgl.llvm.LLVMLLJIT

public class LLVMLLJIT extends Object
Requires LLVM 11.0 or higher.
  • Method Details

    • LLVMOrcCreateLLJITBuilder

      public static long LLVMOrcCreateLLJITBuilder()
      Create an LLVMOrcLLJITBuilder.

      The client owns the resulting LLJITBuilder and should dispose of it using OrcDisposeLLJITBuilder once they are done with it.

    • LLVMOrcDisposeLLJITBuilder

      public static void LLVMOrcDisposeLLJITBuilder(long Builder)
      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).

    • LLVMOrcLLJITBuilderSetJITTargetMachineBuilder

      public static void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(long Builder, long JTMB)
      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.

    • nLLVMOrcLLJITBuilderSetObjectLinkingLayerCreator

      public static void nLLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(long Builder, long F, long Ctx)
    • LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator

      public static void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(long Builder, LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunctionI F, long Ctx)
      Set an ObjectLinkingLayer creator function for this LLJIT instance.
      Since:
      12
    • nLLVMOrcCreateLLJIT

      public static long nLLVMOrcCreateLLJIT(long Result, long Builder)
      Unsafe version of: OrcCreateLLJIT
    • LLVMOrcCreateLLJIT

      public static long LLVMOrcCreateLLJIT(org.lwjgl.PointerBuffer Result, long Builder)
      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 OrcLLJITAddLLVMIRModule). Disposing of the LLJIT instance will free all memory managed by the JIT, including JIT'd code and not-yet compiled modules.

    • LLVMOrcDisposeLLJIT

      public static long LLVMOrcDisposeLLJIT(long J)
      Dispose of an LLJIT instance.
    • LLVMOrcLLJITGetExecutionSession

      public static long LLVMOrcLLJITGetExecutionSession(long J)
      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.

    • LLVMOrcLLJITGetMainJITDylib

      public static long LLVMOrcLLJITGetMainJITDylib(long J)
      Return a reference to the Main JITDylib.

      The JITDylib is owned by the LLJIT instance. The client is not responsible for managing its memory.

    • nLLVMOrcLLJITGetTripleString

      public static long nLLVMOrcLLJITGetTripleString(long J)
      Unsafe version of: OrcLLJITGetTripleString
    • LLVMOrcLLJITGetTripleString

      public static @Nullable String LLVMOrcLLJITGetTripleString(long J)
      Return the target triple for this LLJIT instance. This string is owned by the LLJIT instance and should not be freed by the client.
    • LLVMOrcLLJITGetGlobalPrefix

      public static byte LLVMOrcLLJITGetGlobalPrefix(long J)
      Returns the global prefix character according to the LLJIT's DataLayout.
    • nLLVMOrcLLJITMangleAndIntern

      public static long nLLVMOrcLLJITMangleAndIntern(long J, long UnmangledName)
      Unsafe version of: OrcLLJITMangleAndIntern
    • LLVMOrcLLJITMangleAndIntern

      public static long LLVMOrcLLJITMangleAndIntern(long J, ByteBuffer UnmangledName)
      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 OrcReleaseSymbolStringPoolEntry to decrement the ref-count on the pool entry once they are finished with this value.

    • LLVMOrcLLJITMangleAndIntern

      public static long LLVMOrcLLJITMangleAndIntern(long J, CharSequence UnmangledName)
      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 OrcReleaseSymbolStringPoolEntry to decrement the ref-count on the pool entry once they are finished with this value.

    • LLVMOrcLLJITAddObjectFile

      public static long LLVMOrcLLJITAddObjectFile(long J, long JD, long ObjBuffer)
      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.

    • LLVMOrcLLJITAddObjectFileWithRT

      public static long LLVMOrcLLJITAddObjectFileWithRT(long J, long RT, long ObjBuffer)
      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.

      Since:
      12
    • LLVMOrcLLJITAddLLVMIRModule

      public static long LLVMOrcLLJITAddLLVMIRModule(long J, long JD, long TSM)
      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.

    • LLVMOrcLLJITAddLLVMIRModuleWithRT

      public static long LLVMOrcLLJITAddLLVMIRModuleWithRT(long J, long JD, long TSM)
      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.

      Since:
      12
    • nLLVMOrcLLJITLookup

      public static long nLLVMOrcLLJITLookup(long J, long Result, long Name)
      Unsafe version of: OrcLLJITLookup
    • LLVMOrcLLJITLookup

      public static long LLVMOrcLLJITLookup(long J, LongBuffer Result, ByteBuffer Name)
      Look up the given symbol in the main JITDylib of the given LLJIT instance.

      This operation does not take ownership of the Name argument.

    • LLVMOrcLLJITLookup

      public static long LLVMOrcLLJITLookup(long J, LongBuffer Result, CharSequence Name)
      Look up the given symbol in the main JITDylib of the given LLJIT instance.

      This operation does not take ownership of the Name argument.

    • LLVMOrcLLJITGetObjLinkingLayer

      public static long LLVMOrcLLJITGetObjLinkingLayer(long J)
      Returns a non-owning reference to the LLJIT instance's object linking layer.
      Since:
      12
    • LLVMOrcLLJITGetObjTransformLayer

      public static long LLVMOrcLLJITGetObjTransformLayer(long J)
      Returns a non-owning reference to the LLJIT instance's object linking layer.
      Since:
      12
    • LLVMOrcLLJITGetIRTransformLayer

      public static long LLVMOrcLLJITGetIRTransformLayer(long J)
      Returns a non-owning reference to the LLJIT instance's IR transform layer.
      Since:
      12
    • nLLVMOrcLLJITGetDataLayoutStr

      public static long nLLVMOrcLLJITGetDataLayoutStr(long J)
      Unsafe version of: OrcLLJITGetDataLayoutStr
    • LLVMOrcLLJITGetDataLayoutStr

      public static @Nullable String LLVMOrcLLJITGetDataLayoutStr(long J)
      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.

      Since:
      12