LLVM  12.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/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
 This class represents lattice values for constants.
 
 llvm::orc
 

Functions

 DEFINE_SIMPLE_CONVERSION_FUNCTIONS (OrcV2CAPIHelper::PoolEntry, LLVMOrcSymbolStringPoolEntryRef) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MaterializationUnit
 
LLVMOrcMaterializationUnitRef DEFINE_SIMPLE_CONVERSION_FUNCTIONS (DefinitionGenerator, LLVMOrcDefinitionGeneratorRef) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ThreadSafeContext
 
LLVMOrcMaterializationUnitRef LLVMOrcThreadSafeContextRef DEFINE_SIMPLE_CONVERSION_FUNCTIONS (JITTargetMachineBuilder, LLVMOrcJITTargetMachineBuilderRef) 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 charLLVMOrcSymbolStringPoolEntryStr (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 LLVMOrcAbsoluteSymbols (LLVMOrcCSymbolMapPairs Syms, size_t NumPairs)
 Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw addresses. More...
 
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)
 
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...
 
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...
 
void lLVMOrcDisposeObjectLayer (LLVMOrcObjectLayerRef ObjLayer)
 
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 charLLVMOrcLLJITGetTripleString (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)
 Look up the given symbol in the main JITDylib of the given LLJIT instance. 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...
 

Function Documentation

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS() [1/3]

DEFINE_SIMPLE_CONVERSION_FUNCTIONS ( OrcV2CAPIHelper::PoolEntry  ,
LLVMOrcSymbolStringPoolEntryRef   
)

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS() [2/3]

LLVMOrcMaterializationUnitRef DEFINE_SIMPLE_CONVERSION_FUNCTIONS ( DefinitionGenerator  ,
LLVMOrcDefinitionGeneratorRef   
)

◆ DEFINE_SIMPLE_CONVERSION_FUNCTIONS() [3/3]

◆ LLVMOrcAbsoluteSymbols()

LLVMOrcMaterializationUnitRef LLVMOrcAbsoluteSymbols ( LLVMOrcCSymbolMapPairs  Syms,
size_t  NumPairs 
)

◆ LLVMOrcCreateCustomCAPIDefinitionGenerator()

LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator ( LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction  F,
void *  Ctx 
)

Create a custom generator.

Definition at line 302 of file OrcV2CBindings.cpp.

References F(), 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 308 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 424 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 400 of file OrcV2CBindings.cpp.

References llvm::wrap().

Referenced by LLVMOrcCreateLLJIT().

Here is the caller graph for this function:

◆ 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 333 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 347 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager()

LLVMOrcObjectLayerRef LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager ( LLVMOrcExecutionSessionRef  ES)

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

Definition at line 515 of file OrcV2CBindings.cpp.

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

◆ 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 231 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeJITTargetMachineBuilder()

void LLVMOrcDisposeJITTargetMachineBuilder ( LLVMOrcJITTargetMachineBuilderRef  JTMB)

Dispose of a JITTargetMachineBuilder.

Definition at line 391 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeLLJIT()

LLVMErrorRef LLVMOrcDisposeLLJIT ( LLVMOrcLLJITRef  J)

Dispose of an LLJIT instance.

Definition at line 443 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 404 of file OrcV2CBindings.cpp.

References Builder, and llvm::unwrap().

Referenced by LLVMOrcCreateLLJIT().

Here is the caller graph for this function:

◆ LLVMOrcDisposeMaterializationUnit()

void LLVMOrcDisposeMaterializationUnit ( LLVMOrcMaterializationUnitRef  MU)

Dispose of a MaterializationUnit.

Definition at line 235 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ lLVMOrcDisposeObjectLayer()

void lLVMOrcDisposeObjectLayer ( LLVMOrcObjectLayerRef  ObjLayer)

Definition at line 396 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeThreadSafeContext()

void LLVMOrcDisposeThreadSafeContext ( LLVMOrcThreadSafeContextRef  TSCtx)

Dispose of a ThreadSafeContext.

Definition at line 342 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 353 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ 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 260 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 266 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcExecutionSessionGetJITDylibByName()

LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName ( LLVMOrcExecutionSessionRef  ES,
const char Name 
)

Definition at line 277 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 174 of file OrcV2CBindings.cpp.

References 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 183 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::releaseSymbolStringPtr(), 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 166 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ 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 297 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 293 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 201 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 282 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 209 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. LLVMOrcCreateLLJITBuilder) or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.

Definition at line 372 of file OrcV2CBindings.cpp.

References LLVMDisposeTargetMachine(), llvm::SystemZISD::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. LLVMOrcCreateLLJITBuilder) or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.

Definition at line 357 of file OrcV2CBindings.cpp.

References assert(), llvm::orc::JITTargetMachineBuilder::detectHost(), LLVMErrorSuccess, llvm::move(), 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 484 of file OrcV2CBindings.cpp.

References llvm::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 491 of file OrcV2CBindings.cpp.

References llvm::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 470 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcLLJITAddObjectFileWithRT()

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 476 of file OrcV2CBindings.cpp.

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

Definition at line 408 of file OrcV2CBindings.cpp.

References Builder, and llvm::unwrap().

◆ LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator()

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

Set an ObjectLinkingLayer creator function for this LLJIT instance.

Definition at line 413 of file OrcV2CBindings.cpp.

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

◆ 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 448 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 460 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ 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 452 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 456 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcLLJITLookup()

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

Look up the given symbol in the main JITDylib of the given LLJIT instance.

This operation does not take ownership of the Name argument.

Definition at line 499 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 465 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcReleaseResourceTracker()

void LLVMOrcReleaseResourceTracker ( LLVMOrcResourceTrackerRef  RT)

Reduces the ref-count of a ResourceTracker.

Definition at line 215 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcReleaseSymbolStringPoolEntry()

void LLVMOrcReleaseSymbolStringPoolEntry ( LLVMOrcSymbolStringPoolEntryRef  S)

Reduces the ref-count for of a SymbolStringPool entry.

Definition at line 192 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcResourceTrackerRemove()

LLVMErrorRef LLVMOrcResourceTrackerRemove ( LLVMOrcResourceTrackerRef  RT)

Remove all resources associated with the given tracker.

See ResourceTracker::remove().

Definition at line 226 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 220 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcRetainSymbolStringPoolEntry()

void LLVMOrcRetainSymbolStringPoolEntry ( LLVMOrcSymbolStringPoolEntryRef  S)

Increments the ref-count for a SymbolStringPool entry.

Definition at line 188 of file OrcV2CBindings.cpp.

References llvm::orc::OrcV2CAPIHelper::retainPoolEntry(), 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 522 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 178 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcSymbolStringPoolEntryStr()

const char* LLVMOrcSymbolStringPoolEntryStr ( LLVMOrcSymbolStringPoolEntryRef  S)

Definition at line 196 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcThreadSafeContextGetContext()

LLVMContextRef LLVMOrcThreadSafeContextGetContext ( LLVMOrcThreadSafeContextRef  TSCtx)

Get a reference to the wrapped LLVMContext.

Definition at line 338 of file OrcV2CBindings.cpp.

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