LLVM  14.0.0git
Classes | Namespaces | Functions
OrcV2CBindings.cpp File Reference
#include "llvm-c/LLJIT.h"
#include "llvm-c/Orc.h"
#include "llvm-c/OrcEE.h"
#include "llvm-c/TargetMachine.h"
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h"
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
Include dependency graph for OrcV2CBindings.cpp:

Go to the source code of this file.

Classes

class  llvm::orc::OrcV2CAPIHelper
 

Namespaces

 llvm
 ---------------------— PointerInfo ------------------------------------—
 
 llvm::orc
 

Functions

 DEFINE_SIMPLE_CONVERSION_FUNCTIONS (OrcV2CAPIHelper::PoolEntry, LLVMOrcSymbolStringPoolEntryRef) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MaterializationUnit
 
LLVMOrcMaterializationUnitRef DEFINE_SIMPLE_CONVERSION_FUNCTIONS (MaterializationResponsibility, LLVMOrcMaterializationResponsibilityRef) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(DefinitionGenerator
 
LLVMOrcMaterializationUnitRef LLVMOrcDefinitionGeneratorRef DEFINE_SIMPLE_CONVERSION_FUNCTIONS (ThreadSafeContext, LLVMOrcThreadSafeContextRef) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(JITTargetMachineBuilder
 
LLVMOrcMaterializationUnitRef LLVMOrcDefinitionGeneratorRef LLVMOrcJITTargetMachineBuilderRef DEFINE_SIMPLE_CONVERSION_FUNCTIONS (ObjectTransformLayer, LLVMOrcObjectTransformLayerRef) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IndirectStubsManager
 
LLVMOrcMaterializationUnitRef LLVMOrcDefinitionGeneratorRef LLVMOrcJITTargetMachineBuilderRef LLVMOrcIndirectStubsManagerRef DEFINE_SIMPLE_CONVERSION_FUNCTIONS (LazyCallThroughManager, LLVMOrcLazyCallThroughManagerRef) namespace llvm
 
void LLVMOrcExecutionSessionSetErrorReporter (LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError, void *Ctx)
 Attach a custom error reporter function to the ExecutionSession. More...
 
LLVMOrcSymbolStringPoolRef LLVMOrcExecutionSessionGetSymbolStringPool (LLVMOrcExecutionSessionRef ES)
 Return a reference to the SymbolStringPool for an ExecutionSession. More...
 
void LLVMOrcSymbolStringPoolClearDeadEntries (LLVMOrcSymbolStringPoolRef SSP)
 Clear all unreferenced symbol string pool entries. More...
 
LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern (LLVMOrcExecutionSessionRef ES, const char *Name)
 Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it. More...
 
void LLVMOrcRetainSymbolStringPoolEntry (LLVMOrcSymbolStringPoolEntryRef S)
 Increments the ref-count for a SymbolStringPool entry. More...
 
void LLVMOrcReleaseSymbolStringPoolEntry (LLVMOrcSymbolStringPoolEntryRef S)
 Reduces the ref-count for of a SymbolStringPool entry. More...
 
const char * LLVMOrcSymbolStringPoolEntryStr (LLVMOrcSymbolStringPoolEntryRef S)
 
LLVMOrcResourceTrackerRef LLVMOrcJITDylibCreateResourceTracker (LLVMOrcJITDylibRef JD)
 Return a reference to a newly created resource tracker associated with JD. More...
 
LLVMOrcResourceTrackerRef LLVMOrcJITDylibGetDefaultResourceTracker (LLVMOrcJITDylibRef JD)
 Return a reference to the default resource tracker for the given JITDylib. More...
 
void LLVMOrcReleaseResourceTracker (LLVMOrcResourceTrackerRef RT)
 Reduces the ref-count of a ResourceTracker. More...
 
void LLVMOrcResourceTrackerTransferTo (LLVMOrcResourceTrackerRef SrcRT, LLVMOrcResourceTrackerRef DstRT)
 Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT. More...
 
LLVMErrorRef LLVMOrcResourceTrackerRemove (LLVMOrcResourceTrackerRef RT)
 Remove all resources associated with the given tracker. More...
 
void LLVMOrcDisposeDefinitionGenerator (LLVMOrcDefinitionGeneratorRef DG)
 Dispose of a JITDylib::DefinitionGenerator. More...
 
void LLVMOrcDisposeMaterializationUnit (LLVMOrcMaterializationUnitRef MU)
 Dispose of a MaterializationUnit. More...
 
LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit (const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym, LLVMOrcMaterializationUnitMaterializeFunction Materialize, LLVMOrcMaterializationUnitDiscardFunction Discard, LLVMOrcMaterializationUnitDestroyFunction Destroy)
 Create a custom MaterializationUnit. More...
 
LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols (LLVMOrcCSymbolMapPairs Syms, size_t NumPairs)
 Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw addresses. More...
 
LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports (LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM, LLVMOrcJITDylibRef SourceJD, LLVMOrcCSymbolAliasMapPairs CallableAliases, size_t NumPairs)
 Create a MaterializationUnit to define lazy re-expots. More...
 
void LLVMOrcDisposeMaterializationResponsibility (LLVMOrcMaterializationResponsibilityRef MR)
 Disposes of the passed MaterializationResponsibility object. More...
 
LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib (LLVMOrcMaterializationResponsibilityRef MR)
 Returns the target JITDylib that these symbols are being materialized into. More...
 
LLVMOrcExecutionSessionRef LLVMOrcMaterializationResponsibilityGetExecutionSession (LLVMOrcMaterializationResponsibilityRef MR)
 Returns the ExecutionSession for this MaterializationResponsibility. More...
 
LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols (LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs)
 Returns the symbol flags map for this responsibility instance. More...
 
void LLVMOrcDisposeCSymbolFlagsMap (LLVMOrcCSymbolFlagsMapPairs Pairs)
 Disposes of the passed LLVMOrcCSymbolFlagsMap. More...
 
LLVMOrcSymbolStringPoolEntryRef LLVMOrcMaterializationResponsibilityGetInitializerSymbol (LLVMOrcMaterializationResponsibilityRef MR)
 Returns the initialization pseudo-symbol, if any. More...
 
LLVMOrcSymbolStringPoolEntryRefLLVMOrcMaterializationResponsibilityGetRequestedSymbols (LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols)
 Returns the names of any symbols covered by this MaterializationResponsibility object that have queries pending. More...
 
void LLVMOrcDisposeSymbols (LLVMOrcSymbolStringPoolEntryRef *Symbols)
 Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* . More...
 
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved (LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols, size_t NumPairs)
 
LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted (LLVMOrcMaterializationResponsibilityRef MR)
 Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by this MaterializationResponsibility instance have been emitted. More...
 
LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing (LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolFlagsMapPairs Syms, size_t NumSyms)
 Attempt to claim responsibility for new definitions. More...
 
LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace (LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcMaterializationUnitRef MU)
 Transfers responsibility to the given MaterializationUnit for all symbols defined by that MaterializationUnit. More...
 
LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate (LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols, LLVMOrcMaterializationResponsibilityRef *Result)
 Delegates responsibility for the given symbols to the returned materialization responsibility. More...
 
void LLVMOrcMaterializationResponsibilityAddDependencies (LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcSymbolStringPoolEntryRef Name, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs)
 Adds dependencies to a symbol that the MaterializationResponsibility is responsible for. More...
 
void LLVMOrcMaterializationResponsibilityAddDependenciesForAll (LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs)
 Adds dependencies to all symbols that the MaterializationResponsibility is responsible for. More...
 
void LLVMOrcMaterializationResponsibilityFailMaterialization (LLVMOrcMaterializationResponsibilityRef MR)
 Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has occurred. More...
 
void LLVMOrcIRTransformLayerEmit (LLVMOrcIRTransformLayerRef IRLayer, LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcThreadSafeModuleRef TSM)
 
LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib (LLVMOrcExecutionSessionRef ES, const char *Name)
 Create a "bare" JITDylib. More...
 
LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib (LLVMOrcExecutionSessionRef ES, LLVMOrcJITDylibRef *Result, const char *Name)
 Create a JITDylib. More...
 
LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName (LLVMOrcExecutionSessionRef ES, const char *Name)
 Returns the JITDylib with the given name, or NULL if no such JITDylib exists. More...
 
LLVMErrorRef LLVMOrcJITDylibDefine (LLVMOrcJITDylibRef JD, LLVMOrcMaterializationUnitRef MU)
 Add the given MaterializationUnit to the given JITDylib. More...
 
LLVMErrorRef LLVMOrcJITDylibClear (LLVMOrcJITDylibRef JD)
 Calls remove on all trackers associated with this JITDylib, see JITDylib::clear(). More...
 
void LLVMOrcJITDylibAddGenerator (LLVMOrcJITDylibRef JD, LLVMOrcDefinitionGeneratorRef DG)
 Add a DefinitionGenerator to the given JITDylib. More...
 
LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator (LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx)
 Create a custom generator. More...
 
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess (LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx)
 Get a DynamicLibrarySearchGenerator that will reflect process symbols into the JITDylib. More...
 
LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext (void)
 Create a ThreadSafeContext containing a new LLVMContext. More...
 
LLVMContextRef LLVMOrcThreadSafeContextGetContext (LLVMOrcThreadSafeContextRef TSCtx)
 Get a reference to the wrapped LLVMContext. More...
 
void LLVMOrcDisposeThreadSafeContext (LLVMOrcThreadSafeContextRef TSCtx)
 Dispose of a ThreadSafeContext. More...
 
LLVMErrorRef LLVMOrcThreadSafeModuleWithModuleDo (LLVMOrcThreadSafeModuleRef TSM, LLVMOrcGenericIRModuleOperationFunction F, void *Ctx)
 Apply the given function to the module contained in this ThreadSafeModule. More...
 
LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule (LLVMModuleRef M, LLVMOrcThreadSafeContextRef TSCtx)
 Create a ThreadSafeModule wrapper around the given LLVM module. More...
 
void LLVMOrcDisposeThreadSafeModule (LLVMOrcThreadSafeModuleRef TSM)
 Dispose of a ThreadSafeModule. More...
 
LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost (LLVMOrcJITTargetMachineBuilderRef *Result)
 Create a JITTargetMachineBuilder by detecting the host. More...
 
LLVMOrcJITTargetMachineBuilderRef LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine (LLVMTargetMachineRef TM)
 Create a JITTargetMachineBuilder from the given TargetMachine template. More...
 
void LLVMOrcDisposeJITTargetMachineBuilder (LLVMOrcJITTargetMachineBuilderRef JTMB)
 Dispose of a JITTargetMachineBuilder. More...
 
char * LLVMOrcJITTargetMachineBuilderGetTargetTriple (LLVMOrcJITTargetMachineBuilderRef JTMB)
 Returns the target triple for the given JITTargetMachineBuilder as a string. More...
 
void LLVMOrcJITTargetMachineBuilderSetTargetTriple (LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple)
 Sets the target triple for the given JITTargetMachineBuilder to the given string. More...
 
LLVMErrorRef LLVMOrcObjectLayerAddObjectFile (LLVMOrcObjectLayerRef ObjLayer, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
 Add an object to an ObjectLayer to the given JITDylib. More...
 
LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT (LLVMOrcObjectLayerRef ObjLayer, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer)
 
void LLVMOrcObjectLayerEmit (LLVMOrcObjectLayerRef ObjLayer, LLVMOrcMaterializationResponsibilityRef R, LLVMMemoryBufferRef ObjBuffer)
 Emit an object buffer to an ObjectLayer. More...
 
void LLVMOrcDisposeObjectLayer (LLVMOrcObjectLayerRef ObjLayer)
 Dispose of an ObjectLayer. More...
 
void LLVMOrcIRTransformLayerSetTransform (LLVMOrcIRTransformLayerRef IRTransformLayer, LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx)
 Set the transform function of the provided transform layer, passing through a pointer to user provided context. More...
 
void LLVMOrcObjectTransformLayerSetTransform (LLVMOrcObjectTransformLayerRef ObjTransformLayer, LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx)
 Set the transform function on an LLVMOrcObjectTransformLayer. More...
 
LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects (const char *DumpDir, const char *IdentifierOverride)
 Create a DumpObjects instance. More...
 
void LLVMOrcDisposeDumpObjects (LLVMOrcDumpObjectsRef DumpObjects)
 Dispose of a DumpObjects instance. More...
 
LLVMErrorRef LLVMOrcDumpObjects_CallOperator (LLVMOrcDumpObjectsRef DumpObjects, LLVMMemoryBufferRef *ObjBuffer)
 Dump the contents of the given MemoryBuffer. More...
 
LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder (void)
 Create an LLVMOrcLLJITBuilder. More...
 
void LLVMOrcDisposeLLJITBuilder (LLVMOrcLLJITBuilderRef Builder)
 Dispose of an LLVMOrcLLJITBuilderRef. More...
 
void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder (LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB)
 Set the JITTargetMachineBuilder to be used when constructing the LLJIT instance. More...
 
void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator (LLVMOrcLLJITBuilderRef Builder, LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction F, void *Ctx)
 Set an ObjectLinkingLayer creator function for this LLJIT instance. More...
 
LLVMErrorRef LLVMOrcCreateLLJIT (LLVMOrcLLJITRef *Result, LLVMOrcLLJITBuilderRef Builder)
 Create an LLJIT instance from an LLJITBuilder. More...
 
LLVMErrorRef LLVMOrcDisposeLLJIT (LLVMOrcLLJITRef J)
 Dispose of an LLJIT instance. More...
 
LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession (LLVMOrcLLJITRef J)
 Get a reference to the ExecutionSession for this LLJIT instance. More...
 
LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib (LLVMOrcLLJITRef J)
 Return a reference to the Main JITDylib. More...
 
const char * LLVMOrcLLJITGetTripleString (LLVMOrcLLJITRef J)
 Return the target triple for this LLJIT instance. More...
 
char LLVMOrcLLJITGetGlobalPrefix (LLVMOrcLLJITRef J)
 Returns the global prefix character according to the LLJIT's DataLayout. More...
 
LLVMOrcSymbolStringPoolEntryRef LLVMOrcLLJITMangleAndIntern (LLVMOrcLLJITRef J, const char *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. More...
 
LLVMErrorRef LLVMOrcLLJITAddObjectFile (LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMMemoryBufferRef ObjBuffer)
 Add a buffer representing an object file to the given JITDylib in the given LLJIT instance. More...
 
LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT (LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT, LLVMMemoryBufferRef ObjBuffer)
 Add a buffer representing an object file to the given ResourceTracker's JITDylib in the given LLJIT instance. More...
 
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule (LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMOrcThreadSafeModuleRef TSM)
 Add an IR module to the given JITDylib in the given LLJIT instance. More...
 
LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT (LLVMOrcLLJITRef J, LLVMOrcResourceTrackerRef RT, LLVMOrcThreadSafeModuleRef TSM)
 Add an IR module to the given ResourceTracker's JITDylib in the given LLJIT instance. More...
 
LLVMErrorRef LLVMOrcLLJITLookup (LLVMOrcLLJITRef J, LLVMOrcJITTargetAddress *Result, const char *Name)
 
LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer (LLVMOrcLLJITRef J)
 Returns a non-owning reference to the LLJIT instance's object linking layer. More...
 
LLVMOrcObjectTransformLayerRef LLVMOrcLLJITGetObjTransformLayer (LLVMOrcLLJITRef J)
 Returns a non-owning reference to the LLJIT instance's object linking layer. More...
 
LLVMOrcObjectLayerRef LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager (LLVMOrcExecutionSessionRef ES)
 Create a RTDyldObjectLinkingLayer instance using the standard SectionMemoryManager for memory management. More...
 
void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener (LLVMOrcObjectLayerRef RTDyldObjLinkingLayer, LLVMJITEventListenerRef Listener)
 Add the given listener to the given RTDyldObjectLinkingLayer. More...
 
LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer (LLVMOrcLLJITRef J)
 Returns a non-owning reference to the LLJIT instance's IR transform layer. More...
 
const char * LLVMOrcLLJITGetDataLayoutStr (LLVMOrcLLJITRef J)
 Get the LLJIT instance's default data layout string. More...
 
LLVMOrcIndirectStubsManagerRef LLVMOrcCreateLocalIndirectStubsManager (const char *TargetTriple)
 Create a LocalIndirectStubsManager from the given target triple. More...
 
void LLVMOrcDisposeIndirectStubsManager (LLVMOrcIndirectStubsManagerRef ISM)
 Dispose of an IndirectStubsManager. More...
 
LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager (const char *TargetTriple, LLVMOrcExecutionSessionRef ES, LLVMOrcJITTargetAddress ErrorHandlerAddr, LLVMOrcLazyCallThroughManagerRef *Result)
 
void LLVMOrcDisposeLazyCallThroughManager (LLVMOrcLazyCallThroughManagerRef LCM)
 Dispose of an LazyCallThroughManager. More...
 

Function Documentation

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS() [1/5]

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS() [2/5]

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS() [3/5]

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS() [4/5]

DEFINE_SIMPLE_CONVERSION_FUNCTIONS ( OrcV2CAPIHelper::PoolEntry  ,
LLVMOrcSymbolStringPoolEntryRef   
)

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS() [5/5]

◆ LLVMOrcAbsoluteSymbols()

LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols ( LLVMOrcCSymbolMapPairs  Syms,
size_t  NumPairs 
)

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.

Definition at line 379 of file OrcV2CBindings.cpp.

References llvm::orc::absoluteSymbols(), move, llvm::release, and llvm::wrap().

◆ LLVMOrcCreateCustomCAPIDefinitionGenerator()

LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator ( LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction  F,
void *  Ctx 
)

Create a custom generator.

Definition at line 591 of file OrcV2CBindings.cpp.

References F, and llvm::wrap().

◆ LLVMOrcCreateCustomMaterializationUnit()

LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit ( const char *  Name,
void *  Ctx,
LLVMOrcCSymbolFlagsMapPairs  Syms,
size_t  NumSyms,
LLVMOrcSymbolStringPoolEntryRef  InitSym,
LLVMOrcMaterializationUnitMaterializeFunction  Materialize,
LLVMOrcMaterializationUnitDiscardFunction  Discard,
LLVMOrcMaterializationUnitDestroyFunction  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 destroyingthe array itself.

The InitSym argument indicates whether or not this MaterializationUnit contains static initializers. If three 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 LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly 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 LLVMOrcJITDylibDefine) or disposing of it by calling LLVMOrcDisposeMaterializationUnit.

Definition at line 361 of file OrcV2CBindings.cpp.

References I, move, llvm::orc::OrcV2CAPIHelper::moveToSymbolStringPtr(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcCreateDumpObjects()

LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects ( const char *  DumpDir,
const char *  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.

Definition at line 765 of file OrcV2CBindings.cpp.

References assert(), and llvm::wrap().

◆ LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess()

LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess ( LLVMOrcDefinitionGeneratorRef Result,
char  GlobalPrefx,
LLVMOrcSymbolPredicate  Filter,
void *  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 LLVMOrcJITDylibAddGenerator,

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.

Definition at line 597 of file OrcV2CBindings.cpp.

References assert(), llvm::Filter, llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(), llvm::orc::OrcV2CAPIHelper::getRawPoolEntryPtr(), GlobalPrefix, LLVMErrorSuccess, and llvm::wrap().

◆ LLVMOrcCreateLLJIT()

LLVMErrorRef LLVMOrcCreateLLJIT ( LLVMOrcLLJITRef Result,
LLVMOrcLLJITBuilderRef  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 LLVMOrcLLJITAddLLVMIRModule). Disposing of the LLJIT instance will free all memory managed by the JIT, including JIT'd code and not-yet compiled modules.

Definition at line 813 of file OrcV2CBindings.cpp.

References assert(), Builder, LLVMErrorSuccess, LLVMOrcCreateLLJITBuilder(), LLVMOrcDisposeLLJITBuilder(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcCreateLLJITBuilder()

LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder ( void  )

Create an LLVMOrcLLJITBuilder.

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

Definition at line 788 of file OrcV2CBindings.cpp.

References llvm::wrap().

Referenced by LLVMOrcCreateLLJIT().

◆ LLVMOrcCreateLocalIndirectStubsManager()

LLVMOrcIndirectStubsManagerRef LLVMOrcCreateLocalIndirectStubsManager ( const char *  TargetTriple)

Create a LocalIndirectStubsManager from the given target triple.

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

Definition at line 938 of file OrcV2CBindings.cpp.

References builder, llvm::orc::createLocalIndirectStubsManagerBuilder(), llvm::release, and llvm::wrap().

◆ LLVMOrcCreateLocalLazyCallThroughManager()

LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager ( const char *  TargetTriple,
LLVMOrcExecutionSessionRef  ES,
LLVMOrcJITTargetAddress  ErrorHandlerAddr,
LLVMOrcLazyCallThroughManagerRef Result 
)

◆ LLVMOrcCreateNewThreadSafeContext()

LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext ( void  )

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.

Definition at line 622 of file OrcV2CBindings.cpp.

References llvm::wrap().

◆ LLVMOrcCreateNewThreadSafeModule()

LLVMOrcThreadSafeModuleRef LLVMOrcCreateNewThreadSafeModule ( LLVMModuleRef  M,
LLVMOrcThreadSafeContextRef  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 LLVMOrcLLJITAddLLVMIRModule) then the client is no longer responsible for it. If it is not transferred to the JIT then the client should call LLVMOrcDisposeThreadSafeModule to dispose of it.

Definition at line 644 of file OrcV2CBindings.cpp.

References M, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager()

LLVMOrcObjectLayerRef LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager ( LLVMOrcExecutionSessionRef  ES)

Create a RTDyldObjectLinkingLayer instance using the standard SectionMemoryManager for memory management.

Definition at line 913 of file OrcV2CBindings.cpp.

References assert(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcDisposeCSymbolFlagsMap()

void LLVMOrcDisposeCSymbolFlagsMap ( LLVMOrcCSymbolFlagsMapPairs  Pairs)

Disposes of the passed LLVMOrcCSymbolFlagsMap.

Does not release the entries themselves.

Definition at line 437 of file OrcV2CBindings.cpp.

◆ LLVMOrcDisposeDefinitionGenerator()

void LLVMOrcDisposeDefinitionGenerator ( LLVMOrcDefinitionGeneratorRef  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 LLVMOrcJITDylibAddGenerator).

Definition at line 353 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeDumpObjects()

void LLVMOrcDisposeDumpObjects ( LLVMOrcDumpObjectsRef  DumpObjects)

Dispose of a DumpObjects instance.

Definition at line 772 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeIndirectStubsManager()

void LLVMOrcDisposeIndirectStubsManager ( LLVMOrcIndirectStubsManagerRef  ISM)

Dispose of an IndirectStubsManager.

Definition at line 943 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeJITTargetMachineBuilder()

void LLVMOrcDisposeJITTargetMachineBuilder ( LLVMOrcJITTargetMachineBuilderRef  JTMB)

Dispose of a JITTargetMachineBuilder.

Definition at line 688 of file OrcV2CBindings.cpp.

References llvm::unwrap().

Referenced by LLVMOrcLLJITBuilderSetJITTargetMachineBuilder().

◆ LLVMOrcDisposeLazyCallThroughManager()

void LLVMOrcDisposeLazyCallThroughManager ( LLVMOrcLazyCallThroughManagerRef  LCM)

Dispose of an LazyCallThroughManager.

Definition at line 960 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeLLJIT()

LLVMErrorRef LLVMOrcDisposeLLJIT ( LLVMOrcLLJITRef  J)

Dispose of an LLJIT instance.

Definition at line 832 of file OrcV2CBindings.cpp.

References LLVMErrorSuccess, and llvm::unwrap().

◆ LLVMOrcDisposeLLJITBuilder()

void LLVMOrcDisposeLLJITBuilder ( LLVMOrcLLJITBuilderRef  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).

Definition at line 792 of file OrcV2CBindings.cpp.

References Builder, and llvm::unwrap().

Referenced by LLVMOrcCreateLLJIT().

◆ LLVMOrcDisposeMaterializationResponsibility()

void LLVMOrcDisposeMaterializationResponsibility ( LLVMOrcMaterializationResponsibilityRef  MR)

Disposes of the passed MaterializationResponsibility object.

This should only be done after the symbols covered by the object have either been resolved and emitted (via LLVMOrcMaterializationResponsibilityNotifyResolved and LLVMOrcMaterializationResponsibilityNotifyEmitted) or failed (via LLVMOrcMaterializationResponsibilityFailMaterialization).

Definition at line 404 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeMaterializationUnit()

void LLVMOrcDisposeMaterializationUnit ( LLVMOrcMaterializationUnitRef  MU)

Dispose of a MaterializationUnit.

Definition at line 357 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeObjectLayer()

void LLVMOrcDisposeObjectLayer ( LLVMOrcObjectLayerRef  ObjLayer)

Dispose of an ObjectLayer.

Definition at line 729 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeSymbols()

void LLVMOrcDisposeSymbols ( LLVMOrcSymbolStringPoolEntryRef Symbols)

Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* .

Does not release the symbols themselves.

Definition at line 465 of file OrcV2CBindings.cpp.

◆ LLVMOrcDisposeThreadSafeContext()

void LLVMOrcDisposeThreadSafeContext ( LLVMOrcThreadSafeContextRef  TSCtx)

Dispose of a ThreadSafeContext.

Definition at line 631 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeThreadSafeModule()

void LLVMOrcDisposeThreadSafeModule ( LLVMOrcThreadSafeModuleRef  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).

Definition at line 650 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDumpObjects_CallOperator()

LLVMErrorRef LLVMOrcDumpObjects_CallOperator ( LLVMOrcDumpObjectsRef  DumpObjects,
LLVMMemoryBufferRef ObjBuffer 
)

Dump the contents of the given MemoryBuffer.

Definition at line 776 of file OrcV2CBindings.cpp.

References LLVMErrorSuccess, move, llvm::X86II::OB, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcExecutionSessionCreateBareJITDylib()

LLVMOrcJITDylibRef LLVMOrcExecutionSessionCreateBareJITDylib ( LLVMOrcExecutionSessionRef  ES,
const char *  Name 
)

Create a "bare" JITDylib.

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

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

Definition at line 549 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcExecutionSessionCreateJITDylib()

LLVMErrorRef LLVMOrcExecutionSessionCreateJITDylib ( LLVMOrcExecutionSessionRef  ES,
LLVMOrcJITDylibRef Result,
const char *  Name 
)

Create a JITDylib.

The client is responsible for ensuring that the JITDylib's name is unique, e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName 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 LLVMExecutionSessionRefCreateBareJITDylib and will always return success.

Definition at line 555 of file OrcV2CBindings.cpp.

References LLVMErrorSuccess, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcExecutionSessionGetJITDylibByName()

LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName ( LLVMOrcExecutionSessionRef  ES,
const char *  Name 
)

Returns the JITDylib with the given name, or NULL if no such JITDylib exists.

Definition at line 566 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcExecutionSessionGetSymbolStringPool()

LLVMOrcSymbolStringPoolRef LLVMOrcExecutionSessionGetSymbolStringPool ( LLVMOrcExecutionSessionRef  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.

Definition at line 295 of file OrcV2CBindings.cpp.

References get, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcExecutionSessionIntern()

LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern ( LLVMOrcExecutionSessionRef  ES,
const char *  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 LLVMOrReleaseSymbolStringPoolEntry.

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.

Definition at line 305 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::moveFromSymbolStringPtr(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcExecutionSessionSetErrorReporter()

void LLVMOrcExecutionSessionSetErrorReporter ( LLVMOrcExecutionSessionRef  ES,
LLVMOrcErrorReporterFunction  ReportError,
void *  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).

Definition at line 287 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcIRTransformLayerEmit()

void LLVMOrcIRTransformLayerEmit ( LLVMOrcIRTransformLayerRef  IRLayer,
LLVMOrcMaterializationResponsibilityRef  MR,
LLVMOrcThreadSafeModuleRef  TSM 
)

Definition at line 539 of file OrcV2CBindings.cpp.

References move, and llvm::unwrap().

◆ LLVMOrcIRTransformLayerSetTransform()

void LLVMOrcIRTransformLayerSetTransform ( LLVMOrcIRTransformLayerRef  IRTransformLayer,
LLVMOrcIRTransformLayerTransformFunction  TransformFunction,
void *  Ctx 
)

Set the transform function of the provided transform layer, passing through a pointer to user provided context.

Definition at line 733 of file OrcV2CBindings.cpp.

References move, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcJITDylibAddGenerator()

void LLVMOrcJITDylibAddGenerator ( LLVMOrcJITDylibRef  JD,
LLVMOrcDefinitionGeneratorRef  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.

Definition at line 586 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcJITDylibClear()

LLVMErrorRef LLVMOrcJITDylibClear ( LLVMOrcJITDylibRef  JD)

Calls remove on all trackers associated with this JITDylib, see JITDylib::clear().

Definition at line 582 of file OrcV2CBindings.cpp.

References clear(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcJITDylibCreateResourceTracker()

LLVMOrcResourceTrackerRef LLVMOrcJITDylibCreateResourceTracker ( LLVMOrcJITDylibRef  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 LLVMOrcReleaseResourceTracker when no longer needed.

Definition at line 323 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcJITDylibDefine()

LLVMErrorRef LLVMOrcJITDylibDefine ( LLVMOrcJITDylibRef  JD,
LLVMOrcMaterializationUnitRef  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 LLVMOrcDisposeMaterializationUnit to destroy it.

Definition at line 571 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcJITDylibGetDefaultResourceTracker()

LLVMOrcResourceTrackerRef LLVMOrcJITDylibGetDefaultResourceTracker ( LLVMOrcJITDylibRef  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 LLVMOrcReleaseResourceTracker when the result is no longer needed.

Definition at line 331 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine()

LLVMOrcJITTargetMachineBuilderRef LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine ( LLVMTargetMachineRef  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. LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.

Definition at line 669 of file OrcV2CBindings.cpp.

References LLVMDisposeTargetMachine(), TM, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcJITTargetMachineBuilderDetectHost()

LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost ( LLVMOrcJITTargetMachineBuilderRef 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. LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.

Definition at line 654 of file OrcV2CBindings.cpp.

References assert(), llvm::orc::JITTargetMachineBuilder::detectHost(), LLVMErrorSuccess, move, and llvm::wrap().

◆ LLVMOrcJITTargetMachineBuilderGetTargetTriple()

char* LLVMOrcJITTargetMachineBuilderGetTargetTriple ( LLVMOrcJITTargetMachineBuilderRef  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

Definition at line 693 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcJITTargetMachineBuilderSetTargetTriple()

void LLVMOrcJITTargetMachineBuilderSetTargetTriple ( LLVMOrcJITTargetMachineBuilderRef  JTMB,
const char *  TargetTriple 
)

Sets the target triple for the given JITTargetMachineBuilder to the given string.

Definition at line 701 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcLazyReexports()

LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports ( LLVMOrcLazyCallThroughManagerRef  LCTM,
LLVMOrcIndirectStubsManagerRef  ISM,
LLVMOrcJITDylibRef  SourceRef,
LLVMOrcCSymbolAliasMapPairs  CallableAliases,
size_t  NumPairs 
)

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.

Definition at line 384 of file OrcV2CBindings.cpp.

References I, llvm::orc::lazyReexports(), move, llvm::orc::OrcV2CAPIHelper::moveToSymbolStringPtr(), llvm::release, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITAddLLVMIRModule()

LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule ( LLVMOrcLLJITRef  J,
LLVMOrcJITDylibRef  JD,
LLVMOrcThreadSafeModuleRef  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.

Definition at line 873 of file OrcV2CBindings.cpp.

References move, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITAddLLVMIRModuleWithRT()

LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT ( LLVMOrcLLJITRef  J,
LLVMOrcResourceTrackerRef  JD,
LLVMOrcThreadSafeModuleRef  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.

Definition at line 880 of file OrcV2CBindings.cpp.

References move, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITAddObjectFile()

LLVMErrorRef LLVMOrcLLJITAddObjectFile ( LLVMOrcLLJITRef  J,
LLVMOrcJITDylibRef  JD,
LLVMMemoryBufferRef  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.

Definition at line 859 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITAddObjectFileWithRT() [1/2]

LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT ( LLVMOrcLLJITRef  J,
LLVMOrcResourceTrackerRef  RT,
LLVMMemoryBufferRef  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.

Definition at line 865 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITAddObjectFileWithRT() [2/2]

LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT ( LLVMOrcObjectLayerRef  ObjLayer,
LLVMOrcResourceTrackerRef  RT,
LLVMMemoryBufferRef  ObjBuffer 
)

Definition at line 713 of file OrcV2CBindings.cpp.

References llvm::ARM_AM::add, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITBuilderSetJITTargetMachineBuilder()

void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder ( LLVMOrcLLJITBuilderRef  Builder,
LLVMOrcJITTargetMachineBuilderRef  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.

Definition at line 796 of file OrcV2CBindings.cpp.

References Builder, LLVMOrcDisposeJITTargetMachineBuilder(), move, and llvm::unwrap().

◆ LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator()

void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator ( LLVMOrcLLJITBuilderRef  Builder,
LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction  F,
void *  Ctx 
)

Set an ObjectLinkingLayer creator function for this LLJIT instance.

Definition at line 802 of file OrcV2CBindings.cpp.

References Builder, F, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITGetDataLayoutStr()

const char* LLVMOrcLLJITGetDataLayoutStr ( LLVMOrcLLJITRef  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.

Definition at line 933 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcLLJITGetExecutionSession()

LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession ( LLVMOrcLLJITRef  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.

Definition at line 837 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITGetGlobalPrefix()

char LLVMOrcLLJITGetGlobalPrefix ( LLVMOrcLLJITRef  J)

Returns the global prefix character according to the LLJIT's DataLayout.

Definition at line 849 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcLLJITGetIRTransformLayer()

LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer ( LLVMOrcLLJITRef  J)

Returns a non-owning reference to the LLJIT instance's IR transform layer.

Definition at line 929 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITGetMainJITDylib()

LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib ( LLVMOrcLLJITRef  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.

Definition at line 841 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITGetObjLinkingLayer()

LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer ( LLVMOrcLLJITRef  J)

Returns a non-owning reference to the LLJIT instance's object linking layer.

Definition at line 903 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITGetObjTransformLayer()

LLVMOrcObjectTransformLayerRef LLVMOrcLLJITGetObjTransformLayer ( LLVMOrcLLJITRef  J)

Returns a non-owning reference to the LLJIT instance's object linking layer.

Definition at line 908 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITGetTripleString()

const char* LLVMOrcLLJITGetTripleString ( LLVMOrcLLJITRef  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.

Definition at line 845 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcLLJITLookup()

LLVMErrorRef LLVMOrcLLJITLookup ( LLVMOrcLLJITRef  J,
LLVMOrcJITTargetAddress Result,
const char *  Name 
)

Definition at line 888 of file OrcV2CBindings.cpp.

References assert(), LLVMErrorSuccess, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcLLJITMangleAndIntern()

LLVMOrcSymbolStringPoolEntryRef LLVMOrcLLJITMangleAndIntern ( LLVMOrcLLJITRef  J,
const char *  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 LLVMOrcReleaseSymbolStringPoolEntry to decrement the ref-count on the pool entry once they are finished with this value.

Definition at line 854 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::moveFromSymbolStringPtr(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityAddDependencies()

void LLVMOrcMaterializationResponsibilityAddDependencies ( LLVMOrcMaterializationResponsibilityRef  MR,
LLVMOrcSymbolStringPoolEntryRef  Name,
LLVMOrcCDependenceMapPairs  Dependencies,
size_t  NumPairs 
)

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.

Definition at line 516 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::moveToSymbolStringPtr(), and llvm::unwrap().

◆ LLVMOrcMaterializationResponsibilityAddDependenciesForAll()

void LLVMOrcMaterializationResponsibilityAddDependenciesForAll ( LLVMOrcMaterializationResponsibilityRef  MR,
LLVMOrcCDependenceMapPairs  Dependencies,
size_t  NumPairs 
)

Adds dependencies to all symbols that the MaterializationResponsibility is responsible for.

See LLVMOrcMaterializationResponsibilityAddDependencies for notes about memory responsibility.

Definition at line 526 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcMaterializationResponsibilityDefineMaterializing()

LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing ( LLVMOrcMaterializationResponsibilityRef  MR,
LLVMOrcCSymbolFlagsMapPairs  Pairs,
size_t  NumPairs 
)

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)

Definition at line 481 of file OrcV2CBindings.cpp.

References I, move, llvm::orc::OrcV2CAPIHelper::moveToSymbolStringPtr(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityDelegate()

LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate ( LLVMOrcMaterializationResponsibilityRef  MR,
LLVMOrcSymbolStringPoolEntryRef Symbols,
size_t  NumSymbols,
LLVMOrcMaterializationResponsibilityRef 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.

Definition at line 499 of file OrcV2CBindings.cpp.

References I, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), LLVMErrorSuccess, llvm::orc::OrcV2CAPIHelper::moveToSymbolStringPtr(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityFailMaterialization()

void LLVMOrcMaterializationResponsibilityFailMaterialization ( LLVMOrcMaterializationResponsibilityRef  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.

Definition at line 534 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcMaterializationResponsibilityGetExecutionSession()

LLVMOrcExecutionSessionRef LLVMOrcMaterializationResponsibilityGetExecutionSession ( LLVMOrcMaterializationResponsibilityRef  MR)

Returns the ExecutionSession for this MaterializationResponsibility.

Definition at line 415 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityGetInitializerSymbol()

LLVMOrcSymbolStringPoolEntryRef LLVMOrcMaterializationResponsibilityGetInitializerSymbol ( LLVMOrcMaterializationResponsibilityRef  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.

Definition at line 442 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::getRawPoolEntryPtr(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityGetRequestedSymbols()

LLVMOrcSymbolStringPoolEntryRef* LLVMOrcMaterializationResponsibilityGetRequestedSymbols ( LLVMOrcMaterializationResponsibilityRef  MR,
size_t *  NumSymbols 
)

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.

Definition at line 449 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::getRawPoolEntryPtr(), I, llvm::safe_malloc(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityGetSymbols()

LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols ( LLVMOrcMaterializationResponsibilityRef  MR,
size_t *  NumPairs 
)

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 LLVMOrcDisposeCSymbolFlagsMap.

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

Definition at line 420 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::getRawPoolEntryPtr(), I, llvm::safe_malloc(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityGetTargetDylib()

LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib ( LLVMOrcMaterializationResponsibilityRef  MR)

Returns the target JITDylib that these symbols are being materialized into.

Definition at line 409 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityNotifyEmitted()

LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted ( LLVMOrcMaterializationResponsibilityRef  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 LLVMOrcMaterializationResponsibilityFailMaterialization. If no dependencies have been registered for the symbols covered by this MaterializationResponsibiility then this method is guaranteed to return LLVMErrorSuccess.

Definition at line 476 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityNotifyResolved()

LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved ( LLVMOrcMaterializationResponsibilityRef  MR,
LLVMOrcCSymbolMapPairs  Symbols,
size_t  NumPairs 
)

Definition at line 469 of file OrcV2CBindings.cpp.

References move, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcMaterializationResponsibilityReplace()

LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace ( LLVMOrcMaterializationResponsibilityRef  MR,
LLVMOrcMaterializationUnitRef  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).

Definition at line 492 of file OrcV2CBindings.cpp.

References move, llvm::replace(), llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcObjectLayerAddObjectFile()

LLVMErrorRef LLVMOrcObjectLayerAddObjectFile ( LLVMOrcObjectLayerRef  ObjLayer,
LLVMOrcJITDylibRef  JD,
LLVMMemoryBufferRef  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.

Definition at line 706 of file OrcV2CBindings.cpp.

References llvm::ARM_AM::add, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcObjectLayerEmit()

void LLVMOrcObjectLayerEmit ( LLVMOrcObjectLayerRef  ObjLayer,
LLVMOrcMaterializationResponsibilityRef  R,
LLVMMemoryBufferRef  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.

Definition at line 721 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcObjectTransformLayerSetTransform()

void LLVMOrcObjectTransformLayerSetTransform ( LLVMOrcObjectTransformLayerRef  ObjTransformLayer,
LLVMOrcObjectTransformLayerTransformFunction  TransformFunction,
void *  Ctx 
)

Set the transform function on an LLVMOrcObjectTransformLayer.

Definition at line 750 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcReleaseResourceTracker()

void LLVMOrcReleaseResourceTracker ( LLVMOrcResourceTrackerRef  RT)

Reduces the ref-count of a ResourceTracker.

Definition at line 337 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcReleaseSymbolStringPoolEntry()

void LLVMOrcReleaseSymbolStringPoolEntry ( LLVMOrcSymbolStringPoolEntryRef  S)

Reduces the ref-count for of a SymbolStringPool entry.

Definition at line 314 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::releasePoolEntry(), S, and llvm::unwrap().

◆ LLVMOrcResourceTrackerRemove()

LLVMErrorRef LLVMOrcResourceTrackerRemove ( LLVMOrcResourceTrackerRef  RT)

Remove all resources associated with the given tracker.

See ResourceTracker::remove().

Definition at line 348 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcResourceTrackerTransferTo()

void LLVMOrcResourceTrackerTransferTo ( LLVMOrcResourceTrackerRef  SrcRT,
LLVMOrcResourceTrackerRef  DstRT 
)

Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT.

Definition at line 342 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcRetainSymbolStringPoolEntry()

void LLVMOrcRetainSymbolStringPoolEntry ( LLVMOrcSymbolStringPoolEntryRef  S)

Increments the ref-count for a SymbolStringPool entry.

Definition at line 310 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::retainPoolEntry(), S, and llvm::unwrap().

◆ LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener()

void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener ( LLVMOrcObjectLayerRef  RTDyldObjLinkingLayer,
LLVMJITEventListenerRef  Listener 
)

Add the given listener to the given RTDyldObjectLinkingLayer.

Note: Layer must be an RTDyldObjectLinkingLayer instance or behavior is undefined.

Definition at line 920 of file OrcV2CBindings.cpp.

References assert(), and llvm::unwrap().

◆ LLVMOrcSymbolStringPoolClearDeadEntries()

void LLVMOrcSymbolStringPoolClearDeadEntries ( LLVMOrcSymbolStringPoolRef  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.

Definition at line 300 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcSymbolStringPoolEntryStr()

const char* LLVMOrcSymbolStringPoolEntryStr ( LLVMOrcSymbolStringPoolEntryRef  S)

Definition at line 318 of file OrcV2CBindings.cpp.

References S, and llvm::unwrap().

◆ LLVMOrcThreadSafeContextGetContext()

LLVMContextRef LLVMOrcThreadSafeContextGetContext ( LLVMOrcThreadSafeContextRef  TSCtx)

Get a reference to the wrapped LLVMContext.

Definition at line 627 of file OrcV2CBindings.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcThreadSafeModuleWithModuleDo()

LLVMErrorRef LLVMOrcThreadSafeModuleWithModuleDo ( LLVMOrcThreadSafeModuleRef  TSM,
LLVMOrcGenericIRModuleOperationFunction  F,
void *  Ctx 
)

Apply the given function to the module contained in this ThreadSafeModule.

Definition at line 636 of file OrcV2CBindings.cpp.

References F, M, llvm::unwrap(), and llvm::wrap().