Class LLVMOrc


  • public class LLVMOrc
    extends java.lang.Object
    Requires LLVM 12 or higher.
    • Method Detail

      • nLLVMOrcExecutionSessionSetErrorReporter

        public static void nLLVMOrcExecutionSessionSetErrorReporter​(long ES,
                                                                    long ReportError,
                                                                    long Ctx)
      • LLVMOrcExecutionSessionSetErrorReporter

        public static void LLVMOrcExecutionSessionSetErrorReporter​(long ES,
                                                                   LLVMOrcErrorReporterFunctionI ReportError,
                                                                   long Ctx)
        Attach a custom error reporter function to the ExecutionSession.

        The error reporter will be called to deliver failure notices that can not be directly reported to a caller. For example, failure to resolve symbols in the JIT linker is typically reported via the error reporter (callers requesting definitions from the JIT will typically be delivered a FailureToMaterialize error instead).

      • LLVMOrcExecutionSessionGetSymbolStringPool

        public static long LLVMOrcExecutionSessionGetSymbolStringPool​(long ES)
        Return a reference to the SymbolStringPool for an ExecutionSession.

        Ownership of the pool remains with the ExecutionSession: The caller is not required to free the pool.

      • LLVMOrcSymbolStringPoolClearDeadEntries

        public static void LLVMOrcSymbolStringPoolClearDeadEntries​(long SSP)
        Clear all unreferenced symbol string pool entries.

        This can be called at any time to release unused entries in the ExecutionSession's string pool. Since it locks the pool (preventing interning of any new strings) it is recommended that it only be called infrequently, ideally when the caller has reason to believe that some entries will have become unreferenced, e.g. after removing a module or closing a JITDylib.

      • nLLVMOrcExecutionSessionIntern

        public static long nLLVMOrcExecutionSessionIntern​(long ES,
                                                          long Name)
        Unsafe version of: OrcExecutionSessionIntern
      • LLVMOrcExecutionSessionIntern

        public static long LLVMOrcExecutionSessionIntern​(long ES,
                                                         java.nio.ByteBuffer Name)
        
        public static long LLVMOrcExecutionSessionIntern​(long ES,
                                                         java.lang.CharSequence Name)
        
        Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it. This increments the ref-count of the pool entry, and the returned value should be released once the client is done with it by calling OrcReleaseSymbolStringPoolEntry.

        Since strings are uniqued within the SymbolStringPool LLVMOrcSymbolStringPoolEntryRefs can be compared by value to test string equality.

        Note that this function does not perform linker-mangling on the string.

      • LLVMOrcRetainSymbolStringPoolEntry

        public static void LLVMOrcRetainSymbolStringPoolEntry​(long S)
        Increments the ref-count for a SymbolStringPool entry.
      • LLVMOrcReleaseSymbolStringPoolEntry

        public static void LLVMOrcReleaseSymbolStringPoolEntry​(long S)
        Reduces the ref-count for of a SymbolStringPool entry.
      • nLLVMOrcSymbolStringPoolEntryStr

        public static long nLLVMOrcSymbolStringPoolEntryStr​(long S)
      • LLVMOrcSymbolStringPoolEntryStr

        @Nullable
        public static java.lang.String LLVMOrcSymbolStringPoolEntryStr​(long S)
      • LLVMOrcReleaseResourceTracker

        public static void LLVMOrcReleaseResourceTracker​(long RT)
        Reduces the ref-count of a ResourceTracker.
      • LLVMOrcResourceTrackerTransferTo

        public static void LLVMOrcResourceTrackerTransferTo​(long SrcRT,
                                                            long DstRT)
        Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT.
      • LLVMOrcResourceTrackerRemove

        public static long LLVMOrcResourceTrackerRemove​(long RT)
        Remove all resources associated with the given tracker. See ResourceTracker::remove().
      • LLVMOrcDisposeDefinitionGenerator

        public static void LLVMOrcDisposeDefinitionGenerator​(long DG)
        Dispose of a JITDylib::DefinitionGenerator. This should only be called if ownership has not been passed to a JITDylib (e.g. because some error prevented the client from calling OrcJITDylibAddGenerator).
      • LLVMOrcDisposeMaterializationUnit

        public static void LLVMOrcDisposeMaterializationUnit​(long MU)
        Dispose of a MaterializationUnit.
      • nLLVMOrcCreateCustomMaterializationUnit

        public static long nLLVMOrcCreateCustomMaterializationUnit​(long Name,
                                                                   long Ctx,
                                                                   long Syms,
                                                                   long NumSyms,
                                                                   long InitSym,
                                                                   long Materialize,
                                                                   long Discard,
                                                                   long Destroy)
      • LLVMOrcCreateCustomMaterializationUnit

        public static long LLVMOrcCreateCustomMaterializationUnit​(java.nio.ByteBuffer Name,
                                                                  long Ctx,
                                                                  LLVMOrcCSymbolFlagsMapPair.Buffer Syms,
                                                                  long InitSym,
                                                                  LLVMOrcMaterializationUnitMaterializeFunctionI Materialize,
                                                                  LLVMOrcMaterializationUnitDiscardFunctionI Discard,
                                                                  LLVMOrcMaterializationUnitDestroyFunctionI Destroy)
        
        public static long LLVMOrcCreateCustomMaterializationUnit​(java.lang.CharSequence Name,
                                                                  long Ctx,
                                                                  LLVMOrcCSymbolFlagsMapPair.Buffer Syms,
                                                                  long InitSym,
                                                                  LLVMOrcMaterializationUnitMaterializeFunctionI Materialize,
                                                                  LLVMOrcMaterializationUnitDiscardFunctionI Discard,
                                                                  LLVMOrcMaterializationUnitDestroyFunctionI Destroy)
        
        Create a custom MaterializationUnit.

        Name is a name for this MaterializationUnit to be used for identification and logging purposes (e.g. if this MaterializationUnit produces an object buffer then the name of that buffer will be derived from this name).

        The Syms list contains the names and linkages of the symbols provided by this unit. This function takes ownership of the elements of the Syms array. The Name fields of the array elements are taken to have been retained for this function. The client should not release the elements of the array, but is still responsible for destroying the array itself.

        The InitSym argument indicates whether or not this MaterializationUnit contains static initializers. If there are no static initializers (the common case) then this argument should be null. If there are static initializers then InitSym should be set to a unique name that also appears in the Syms list with the JITSymbolGenericFlagsMaterializationSideEffectsOnly flag set. This function takes ownership of the InitSym, which should have been retained twice on behalf of this function: once for the Syms entry and once for InitSym. If clients wish to use the InitSym value after this function returns they must retain it once more for themselves.

        If any of the symbols in the Syms list is looked up then the Materialize function will be called.

        If any of the symbols in the Syms list is overridden then the Discard function will be called.

        The caller owns the underling MaterializationUnit and is responsible for either passing it to a JITDylib (via OrcJITDylibDefine) or disposing of it by calling OrcDisposeMaterializationUnit.

        Since:
        13
      • nLLVMOrcAbsoluteSymbols

        public static long nLLVMOrcAbsoluteSymbols​(long Syms,
                                                   long NumPairs)
        Unsafe version of: OrcAbsoluteSymbols
      • LLVMOrcAbsoluteSymbols

        public static long LLVMOrcAbsoluteSymbols​(LLVMJITCSymbolMapPair.Buffer Syms)
        Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw addresses.

        This function takes ownership of the elements of the Syms array. The Name fields of the array elements are taken to have been retained for this function. This allows the following pattern...

        
         size_t NumPairs;
         LLVMOrcCSymbolMapPairs Sym;
         -- Build Syms array --
         LLVMOrcMaterializationUnitRef MU =
             LLVMOrcAbsoluteSymbols(Syms, NumPairs);

        ... without requiring cleanup of the elements of the Sym array afterwards.

        The client is still responsible for deleting the Sym array itself.

        If a client wishes to reuse elements of the Sym array after this call they must explicitly retain each of the elements for themselves.

      • nLLVMOrcLazyReexports

        public static long nLLVMOrcLazyReexports​(long LCTM,
                                                 long ISM,
                                                 long SourceRef,
                                                 long CallableAliases,
                                                 long NumPairs)
        Unsafe version of: OrcLazyReexports
      • LLVMOrcLazyReexports

        public static long LLVMOrcLazyReexports​(long LCTM,
                                                long ISM,
                                                long SourceRef,
                                                LLVMOrcCSymbolAliasMapPair.Buffer CallableAliases)
        Create a MaterializationUnit to define lazy re-expots. These are callable entry points that call through to the given symbols.

        This function takes ownership of the CallableAliases array. The Name fields of the array elements are taken to have been retained for this function. This allows the following pattern...

        
         size_t NumPairs;
         LLVMOrcCSymbolAliasMapPairs CallableAliases;
         -- Build CallableAliases array --
         LLVMOrcMaterializationUnitRef MU =
             LLVMOrcLazyReexports(LCTM, ISM, JD, CallableAliases, NumPairs);

        ... without requiring cleanup of the elements of the CallableAliases array afterwards.

        The client is still responsible for deleting the CallableAliases array itself.

        If a client wishes to reuse elements of the CallableAliases array after this call they must explicitly retain each of the elements for themselves.

        Since:
        13
      • LLVMOrcMaterializationResponsibilityGetTargetDylib

        public static long LLVMOrcMaterializationResponsibilityGetTargetDylib​(long MR)
        Returns the target JITDylib that these symbols are being materialized into.
        Since:
        13
      • LLVMOrcMaterializationResponsibilityGetExecutionSession

        public static long LLVMOrcMaterializationResponsibilityGetExecutionSession​(long MR)
        Returns the ExecutionSession for this MaterializationResponsibility.
        Since:
        13
      • LLVMOrcMaterializationResponsibilityGetSymbols

        @Nullable
        public static LLVMOrcCSymbolFlagsMapPair.Buffer LLVMOrcMaterializationResponsibilityGetSymbols​(long MR)
        Returns the symbol flags map for this responsibility instance.

        The length of the array is returned in NumPairs and the caller is responsible for the returned memory and needs to call OrcDisposeCSymbolFlagsMap.

        To use the returned symbols beyond the livetime of the MaterializationResponsibility requires the caller to retain the symbols explicitly.

        Since:
        13
      • nLLVMOrcDisposeCSymbolFlagsMap

        public static void nLLVMOrcDisposeCSymbolFlagsMap​(long Pairs)
        Unsafe version of: OrcDisposeCSymbolFlagsMap
      • LLVMOrcDisposeCSymbolFlagsMap

        public static void LLVMOrcDisposeCSymbolFlagsMap​(LLVMOrcCSymbolFlagsMapPair Pairs)
        Disposes of the passed LLVMOrcCSymbolFlagsMap.

        Does not release the entries themselves.

        Since:
        13
      • LLVMOrcMaterializationResponsibilityGetInitializerSymbol

        public static long LLVMOrcMaterializationResponsibilityGetInitializerSymbol​(long MR)
        Returns the initialization pseudo-symbol, if any. This symbol will also be present in the SymbolFlagsMap for this MaterializationResponsibility object.

        The returned symbol is not retained over any mutating operation of the MaterializationResponsbility or beyond the lifetime thereof.

        Since:
        13
      • LLVMOrcMaterializationResponsibilityGetRequestedSymbols

        @Nullable
        public static org.lwjgl.PointerBuffer LLVMOrcMaterializationResponsibilityGetRequestedSymbols​(long MR)
        Returns the names of any symbols covered by this MaterializationResponsibility object that have queries pending. This information can be used to return responsibility for unrequested symbols back to the JITDylib via the delegate method.
        Since:
        13
      • nLLVMOrcDisposeSymbols

        public static void nLLVMOrcDisposeSymbols​(long Symbols)
        Unsafe version of: OrcDisposeSymbols
      • LLVMOrcDisposeSymbols

        public static void LLVMOrcDisposeSymbols​(org.lwjgl.PointerBuffer Symbols)
        Disposes of the passed LLVMOrcSymbolStringPoolEntryRef*.

        Does not release the symbols themselves.

        Since:
        13
      • nLLVMOrcMaterializationResponsibilityNotifyResolved

        public static long nLLVMOrcMaterializationResponsibilityNotifyResolved​(long MR,
                                                                               long Symbols,
                                                                               long NumPairs)
      • LLVMOrcMaterializationResponsibilityNotifyResolved

        public static long LLVMOrcMaterializationResponsibilityNotifyResolved​(long MR,
                                                                              LLVMJITCSymbolMapPair.Buffer Symbols)
        Notifies the target JITDylib that the given symbols have been resolved. This will update the given symbols' addresses in the JITDylib, and notify any pending queries on the given symbols of their resolution. The given symbols must be ones covered by this MaterializationResponsibility instance. Individual calls to this method may resolve a subset of the symbols, but all symbols must have been resolved prior to calling emit.

        This method will return an error if any symbols being resolved have been moved to the error state due to the failure of a dependency. If this method returns an error then clients should log it and call OrcMaterializationResponsibilityFailMaterialization. If no dependencies have been registered for the symbols covered by this MaterializationResponsibility then this method is guaranteed to return ErrorSuccess.

        Since:
        13
      • LLVMOrcMaterializationResponsibilityNotifyEmitted

        public static long LLVMOrcMaterializationResponsibilityNotifyEmitted​(long MR)
        Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by this MaterializationResponsibility instance have been emitted.

        This method will return an error if any symbols being resolved have been moved to the error state due to the failure of a dependency. If this method returns an error then clients should log it and call OrcMaterializationResponsibilityFailMaterialization. If no dependencies have been registered for the symbols covered by this MaterializationResponsibiility then this method is guaranteed to return ErrorSuccess.

        Since:
        13
      • LLVMOrcMaterializationResponsibilityDefineMaterializing

        public static long LLVMOrcMaterializationResponsibilityDefineMaterializing​(long MR,
                                                                                   LLVMOrcCSymbolFlagsMapPair.Buffer Pairs)
        Attempt to claim responsibility for new definitions. This method can be used to claim responsibility for symbols that are added to a materialization unit during the compilation process (e.g. literal pool symbols). Symbol linkage rules are the same as for symbols that are defined up front: duplicate strong definitions will result in errors. Duplicate weak definitions will be discarded (in which case they will not be added to this responsibility instance).

        This method can be used by materialization units that want to add additional symbols at materialization time (e.g. stubs, compile callbacks, metadata)

        Since:
        13
      • LLVMOrcMaterializationResponsibilityFailMaterialization

        public static void LLVMOrcMaterializationResponsibilityFailMaterialization​(long MR)
        Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has occurred. This will remove all symbols covered by this MaterializationResponsibilty from the target JITDylib, and send an error to any queries waiting on these symbols.
        Since:
        13
      • LLVMOrcMaterializationResponsibilityReplace

        public static long LLVMOrcMaterializationResponsibilityReplace​(long MR,
                                                                       long MU)
        Transfers responsibility to the given MaterializationUnit for all symbols defined by that MaterializationUnit. This allows materializers to break up work based on run-time information (e.g. by introspecting which symbols have actually been looked up and materializing only those).
        Since:
        13
      • nLLVMOrcMaterializationResponsibilityDelegate

        public static long nLLVMOrcMaterializationResponsibilityDelegate​(long MR,
                                                                         long Symbols,
                                                                         long NumSymbols,
                                                                         long Result)
      • LLVMOrcMaterializationResponsibilityDelegate

        public static long LLVMOrcMaterializationResponsibilityDelegate​(long MR,
                                                                        org.lwjgl.PointerBuffer Symbols,
                                                                        org.lwjgl.PointerBuffer Result)
        Delegates responsibility for the given symbols to the returned materialization responsibility. Useful for breaking up work between threads, or different kinds of materialization processes.

        The caller retains responsibility of the the passed MaterializationResponsibility.

        Since:
        13
      • nLLVMOrcMaterializationResponsibilityAddDependencies

        public static void nLLVMOrcMaterializationResponsibilityAddDependencies​(long MR,
                                                                                long Name,
                                                                                long Dependencies,
                                                                                long NumPairs)
      • LLVMOrcMaterializationResponsibilityAddDependencies

        public static void LLVMOrcMaterializationResponsibilityAddDependencies​(long MR,
                                                                               long Name,
                                                                               LLVMOrcCDependenceMapPair.Buffer Dependencies)
        Adds dependencies to a symbol that the MaterializationResponsibility is responsible for.

        This function takes ownership of Dependencies struct. The Names array have been retained for this function. This allows the following pattern...

        
         LLVMOrcSymbolStringPoolEntryRef Names[] = {...};
         LLVMOrcCDependenceMapPair Dependence = {JD, {Names, sizeof(Names)}}
         LLVMOrcMaterializationResponsibilityAddDependencies(JD, Name, &Dependence, 1);

        ... without requiring cleanup of the elements of the Names array afterwards.

        The client is still responsible for deleting the Dependencies.Names array itself.

        Since:
        13
      • nLLVMOrcExecutionSessionCreateBareJITDylib

        public static long nLLVMOrcExecutionSessionCreateBareJITDylib​(long ES,
                                                                      long Name)
      • LLVMOrcExecutionSessionCreateBareJITDylib

        public static long LLVMOrcExecutionSessionCreateBareJITDylib​(long ES,
                                                                     java.nio.ByteBuffer Name)
        
        public static long LLVMOrcExecutionSessionCreateBareJITDylib​(long ES,
                                                                     java.lang.CharSequence Name)
        
        Create a "bare" JITDylib.

        The client is responsible for ensuring that the JITDylib's name is unique, e.g. by calling OrcExecutionSessionGetJITDylibByName first.

        This call does not install any library code or symbols into the newly created JITDylib. The client is responsible for all configuration.

      • nLLVMOrcExecutionSessionCreateJITDylib

        public static long nLLVMOrcExecutionSessionCreateJITDylib​(long ES,
                                                                  long Result,
                                                                  long Name)
      • LLVMOrcExecutionSessionCreateJITDylib

        public static long LLVMOrcExecutionSessionCreateJITDylib​(long ES,
                                                                 org.lwjgl.PointerBuffer Result,
                                                                 java.nio.ByteBuffer Name)
        
        public static long LLVMOrcExecutionSessionCreateJITDylib​(long ES,
                                                                 org.lwjgl.PointerBuffer Result,
                                                                 java.lang.CharSequence Name)
        
        Create a JITDylib.

        The client is responsible for ensuring that the JITDylib's name is unique, e.g. by calling OrcExecutionSessionGetJITDylibByName first.

        If a Platform is attached to the ExecutionSession then Platform::setupJITDylib will be called to install standard platform symbols (e.g. standard library interposes). If no Platform is installed then this call is equivalent to OrcExecutionSessionCreateBareJITDylib and will always return success.

      • nLLVMOrcExecutionSessionGetJITDylibByName

        public static long nLLVMOrcExecutionSessionGetJITDylibByName​(long ES,
                                                                     long Name)
      • LLVMOrcExecutionSessionGetJITDylibByName

        public static long LLVMOrcExecutionSessionGetJITDylibByName​(long ES,
                                                                    java.nio.ByteBuffer Name)
        
        public static long LLVMOrcExecutionSessionGetJITDylibByName​(long ES,
                                                                    java.lang.CharSequence Name)
        
        Returns the JITDylib with the given name, or NULL if no such JITDylib exists.
      • LLVMOrcJITDylibCreateResourceTracker

        public static long LLVMOrcJITDylibCreateResourceTracker​(long JD)
        Return a reference to a newly created resource tracker associated with JD. The tracker is returned with an initial ref-count of 1, and must be released with OrcReleaseResourceTracker when no longer needed.
      • LLVMOrcJITDylibGetDefaultResourceTracker

        public static long LLVMOrcJITDylibGetDefaultResourceTracker​(long JD)
        Return a reference to the default resource tracker for the given JITDylib. This operation will increase the retain count of the tracker: Clients should call OrcReleaseResourceTracker when the result is no longer needed.
      • LLVMOrcJITDylibDefine

        public static long LLVMOrcJITDylibDefine​(long JD,
                                                 long MU)
        Add the given MaterializationUnit to the given JITDylib.

        If this operation succeeds then JITDylib JD will take ownership of MU. If the operation fails then ownership remains with the caller who should call OrcDisposeMaterializationUnit to destroy it.

      • LLVMOrcJITDylibClear

        public static long LLVMOrcJITDylibClear​(long JD)
        Calls remove on all trackers associated with this JITDylib, see JITDylib::clear().
      • LLVMOrcJITDylibAddGenerator

        public static void LLVMOrcJITDylibAddGenerator​(long JD,
                                                       long DG)
        Add a DefinitionGenerator to the given JITDylib.

        The JITDylib will take ownership of the given generator: The client is no longer responsible for managing its memory.

      • nLLVMOrcCreateCustomCAPIDefinitionGenerator

        public static long nLLVMOrcCreateCustomCAPIDefinitionGenerator​(long F,
                                                                       long Ctx)
      • nLLVMOrcCreateDynamicLibrarySearchGeneratorForProcess

        public static long nLLVMOrcCreateDynamicLibrarySearchGeneratorForProcess​(long Result,
                                                                                 byte GlobalPrefx,
                                                                                 long Filter,
                                                                                 long FilterCtx)
      • LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess

        public static long LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess​(org.lwjgl.PointerBuffer Result,
                                                                                byte GlobalPrefx,
                                                                                @Nullable
                                                                                LLVMOrcSymbolPredicateI Filter,
                                                                                long FilterCtx)
        Get a DynamicLibrarySearchGenerator that will reflect process symbols into the JITDylib. On success the resulting generator is owned by the client. Ownership is typically transferred by adding the instance to a JITDylib using OrcJITDylibAddGenerator.

        The GlobalPrefix argument specifies the character that appears on the front of linker-mangled symbols for the target platform (e.g. '_' on MachO). If non-null, this character will be stripped from the start of all symbol strings before passing the remaining substring to dlsym.

        The optional Filter and Ctx arguments can be used to supply a symbol name filter: Only symbols for which the filter returns true will be visible to JIT'd code. If the Filter argument is null then all process symbols will be visible to JIT'd code. Note that the symbol name passed to the Filter function is the full mangled symbol: The client is responsible for stripping the global prefix if present.

      • LLVMOrcCreateNewThreadSafeContext

        public static long LLVMOrcCreateNewThreadSafeContext()
        Create a ThreadSafeContext containing a new LLVMContext.

        Ownership of the underlying ThreadSafeContext data is shared: Clients can and should dispose of their ThreadSafeContext as soon as they no longer need to refer to it directly. Other references (e.g. from ThreadSafeModules) will keep the data alive as long as it is needed.

      • LLVMOrcThreadSafeContextGetContext

        public static long LLVMOrcThreadSafeContextGetContext​(long TSCtx)
        Get a reference to the wrapped LLVMContext.
      • LLVMOrcDisposeThreadSafeContext

        public static void LLVMOrcDisposeThreadSafeContext​(long TSCtx)
        Dispose of a ThreadSafeContext.
      • LLVMOrcCreateNewThreadSafeModule

        public static long LLVMOrcCreateNewThreadSafeModule​(long M,
                                                            long TSCtx)
        Create a ThreadSafeModule wrapper around the given LLVM module. This takes ownership of the M argument which should not be disposed of or referenced after this function returns.

        Ownership of the ThreadSafeModule is unique: If it is transferred to the JIT (e.g. by OrcLLJITAddLLVMIRModule) then the client is no longer responsible for it. If it is not transferred to the JIT then the client should call OrcDisposeThreadSafeModule to dispose of it.

      • LLVMOrcDisposeThreadSafeModule

        public static void LLVMOrcDisposeThreadSafeModule​(long TSM)
        Dispose of a ThreadSafeModule. This should only be called if ownership has not been passed to LLJIT (e.g. because some error prevented the client from adding this to the JIT).
      • nLLVMOrcThreadSafeModuleWithModuleDo

        public static long nLLVMOrcThreadSafeModuleWithModuleDo​(long TSM,
                                                                long F,
                                                                long Ctx)
      • LLVMOrcThreadSafeModuleWithModuleDo

        public static long LLVMOrcThreadSafeModuleWithModuleDo​(long TSM,
                                                               LLVMOrcGenericIRModuleOperationFunctionI F,
                                                               long Ctx)
        Apply the given function to the module contained in this ThreadSafeModule.
        Since:
        13
      • LLVMOrcJITTargetMachineBuilderDetectHost

        public static long LLVMOrcJITTargetMachineBuilderDetectHost​(org.lwjgl.PointerBuffer Result)
        Create a JITTargetMachineBuilder by detecting the host.

        On success the client owns the resulting JITTargetMachineBuilder. It must be passed to a consuming operation (e.g. OrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling OrcDisposeJITTargetMachineBuilder.

      • LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine

        public static long LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine​(long TM)
        Create a JITTargetMachineBuilder from the given TargetMachine template.

        This operation takes ownership of the given TargetMachine and destroys it before returing. The resulting JITTargetMachineBuilder is owned by the client and must be passed to a consuming operation (e.g. OrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling OrcDisposeJITTargetMachineBuilder.

      • LLVMOrcDisposeJITTargetMachineBuilder

        public static void LLVMOrcDisposeJITTargetMachineBuilder​(long JTMB)
        Dispose of a JITTargetMachineBuilder.
      • LLVMOrcJITTargetMachineBuilderGetTargetTriple

        @Nullable
        public static java.lang.String LLVMOrcJITTargetMachineBuilderGetTargetTriple​(long JTMB)
        Returns the target triple for the given JITTargetMachineBuilder as a string.

        The caller owns the resulting string as must dispose of it by calling LLVMDisposeMessage.

        Since:
        13
      • nLLVMOrcJITTargetMachineBuilderSetTargetTriple

        public static void nLLVMOrcJITTargetMachineBuilderSetTargetTriple​(long JTMB,
                                                                          long TargetTriple)
      • LLVMOrcJITTargetMachineBuilderSetTargetTriple

        public static void LLVMOrcJITTargetMachineBuilderSetTargetTriple​(long JTMB,
                                                                         java.nio.ByteBuffer TargetTriple)
        
        public static void LLVMOrcJITTargetMachineBuilderSetTargetTriple​(long JTMB,
                                                                         java.lang.CharSequence TargetTriple)
        
        Sets the target triple for the given JITTargetMachineBuilder to the given string.
        Since:
        13
      • LLVMOrcObjectLayerAddObjectFile

        public static long LLVMOrcObjectLayerAddObjectFile​(long ObjLayer,
                                                           long JD,
                                                           long ObjBuffer)
        Add an object to an ObjectLayer to the given JITDylib.

        Adds a buffer representing an object file to the given JITDylib using the given ObjectLayer instance. This operation transfers ownership of the buffer to the ObjectLayer 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 ResourceTracker.

        Since:
        13
      • LLVMOrcObjectLayerAddObjectFileWithRT

        public static long LLVMOrcObjectLayerAddObjectFileWithRT​(long ObjLayer,
                                                                 long RT,
                                                                 long ObjBuffer)
        Add an object to an ObjectLayer using the given ResourceTracker.

        Adds a buffer representing an object file to the given ResourceTracker's JITDylib using the given ObjectLayer instance. This operation transfers ownership of the buffer to the ObjectLayer 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:
        13
      • LLVMOrcObjectLayerEmit

        public static void LLVMOrcObjectLayerEmit​(long ObjLayer,
                                                  long R,
                                                  long ObjBuffer)
        Emit an object buffer to an ObjectLayer.

        Ownership of the responsibility object and object buffer pass to this function. The client is not responsible for cleanup.

        Since:
        13
      • LLVMOrcDisposeObjectLayer

        public static void LLVMOrcDisposeObjectLayer​(long ObjLayer)
        Dispose of an ObjectLayer.
      • LLVMOrcIRTransformLayerEmit

        public static void LLVMOrcIRTransformLayerEmit​(long IRTransformLayer,
                                                       long MR,
                                                       long TSM)
        Since:
        13
      • nLLVMOrcIRTransformLayerSetTransform

        public static void nLLVMOrcIRTransformLayerSetTransform​(long IRTransformLayer,
                                                                long TransformFunction,
                                                                long Ctx)
      • LLVMOrcIRTransformLayerSetTransform

        public static void LLVMOrcIRTransformLayerSetTransform​(long IRTransformLayer,
                                                               LLVMOrcIRTransformLayerTransformFunctionI TransformFunction,
                                                               long Ctx)
        Set the transform function of the provided transform layer, passing through a pointer to user provided context.
        Since:
        13
      • nLLVMOrcObjectTransformLayerSetTransform

        public static void nLLVMOrcObjectTransformLayerSetTransform​(long ObjTransformLayer,
                                                                    long TransformFunction,
                                                                    long Ctx)
      • LLVMOrcObjectTransformLayerSetTransform

        public static void LLVMOrcObjectTransformLayerSetTransform​(long ObjTransformLayer,
                                                                   LLVMOrcObjectTransformLayerTransformFunctionI TransformFunction,
                                                                   long Ctx)
        Set the transform function on an LLVMOrcObjectTransformLayer.
        Since:
        13
      • nLLVMOrcCreateLocalIndirectStubsManager

        public static long nLLVMOrcCreateLocalIndirectStubsManager​(long TargetTriple)
      • LLVMOrcCreateLocalIndirectStubsManager

        public static long LLVMOrcCreateLocalIndirectStubsManager​(java.nio.ByteBuffer TargetTriple)
        
        public static long LLVMOrcCreateLocalIndirectStubsManager​(java.lang.CharSequence TargetTriple)
        
        Create a LocalIndirectStubsManager from the given target triple.

        The resulting IndirectStubsManager is owned by the client and must be disposed of by calling OrcDisposeIndirectStubsManager.

        Since:
        13
      • LLVMOrcDisposeIndirectStubsManager

        public static void LLVMOrcDisposeIndirectStubsManager​(long ISM)
        Dispose of an IndirectStubsManager.
        Since:
        13
      • nLLVMOrcCreateLocalLazyCallThroughManager

        public static long nLLVMOrcCreateLocalLazyCallThroughManager​(long TargetTriple,
                                                                     long ES,
                                                                     long ErrorHandlerAddr,
                                                                     long LCTM)
      • LLVMOrcCreateLocalLazyCallThroughManager

        public static long LLVMOrcCreateLocalLazyCallThroughManager​(java.nio.ByteBuffer TargetTriple,
                                                                    long ES,
                                                                    long ErrorHandlerAddr,
                                                                    org.lwjgl.PointerBuffer LCTM)
        
        public static long LLVMOrcCreateLocalLazyCallThroughManager​(java.lang.CharSequence TargetTriple,
                                                                    long ES,
                                                                    long ErrorHandlerAddr,
                                                                    org.lwjgl.PointerBuffer LCTM)
        
        Since:
        13
      • LLVMOrcDisposeLazyCallThroughManager

        public static void LLVMOrcDisposeLazyCallThroughManager​(long LCTM)
        Dispose of an LazyCallThroughManager.
        Since:
        13
      • nLLVMOrcCreateDumpObjects

        public static long nLLVMOrcCreateDumpObjects​(long DumpDir,
                                                     long IdentifierOverride)
        Unsafe version of: OrcCreateDumpObjects
      • LLVMOrcCreateDumpObjects

        public static long LLVMOrcCreateDumpObjects​(java.nio.ByteBuffer DumpDir,
                                                    java.nio.ByteBuffer IdentifierOverride)
        
        public static long LLVMOrcCreateDumpObjects​(java.lang.CharSequence DumpDir,
                                                    java.lang.CharSequence IdentifierOverride)
        
        Create a DumpObjects instance.

        DumpDir specifies the path to write dumped objects to. DumpDir may be empty in which case files will be dumped to the working directory.

        IdentifierOverride specifies a file name stem to use when dumping objects. If empty then each MemoryBuffer's identifier will be used (with a .o suffix added if not already present). If an identifier override is supplied it will be used instead, along with an incrementing counter (since all buffers will use the same identifier, the resulting files will be named <ident>.o, <ident>.2.o, <ident>.3.o, and so on). IdentifierOverride should not contain an extension, as a .o suffix will be added by DumpObjects.

        Since:
        13
      • LLVMOrcDisposeDumpObjects

        public static void LLVMOrcDisposeDumpObjects​(long DumpObjects)
        Dispose of a DumpObjects instance.
        Since:
        13
      • nLLVMOrcDumpObjects_CallOperator

        public static long nLLVMOrcDumpObjects_CallOperator​(long DumpObjects,
                                                            long ObjBuffer)
        Unsafe version of: OrcDumpObjects_CallOperator
      • LLVMOrcDumpObjects_CallOperator

        public static long LLVMOrcDumpObjects_CallOperator​(long DumpObjects,
                                                           org.lwjgl.PointerBuffer ObjBuffer)
        Dump the contents of the given MemoryBuffer.
        Since:
        13