LLVM  12.0.0git
Typedefs | Functions | Variables
Orc.h File Reference
#include "llvm-c/Error.h"
#include "llvm-c/TargetMachine.h"
#include "llvm-c/Types.h"
Include dependency graph for Orc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct LLVMOrcOpaqueExecutionSession * LLVMOrcExecutionSessionRef
 A reference to an orc::ExecutionSession instance. More...
 
typedef struct LLVMOrcQuaqueSymbolStringPoolEntryPtr * LLVMOrcSymbolStringPoolEntryRef
 A reference to an orc::SymbolStringPool table entry. More...
 
typedef struct LLVMOrcOpaqueJITDylib * LLVMOrcJITDylibRef
 A reference to an orc::JITDylib instance. More...
 
typedef struct LLVMOrcOpaqueJITDylibDefinitionGenerator * LLVMOrcJITDylibDefinitionGeneratorRef
 A reference to an orc::JITDylib::DefinitionGenerator. More...
 
typedef int(* LLVMOrcSymbolPredicate) (LLVMOrcSymbolStringPoolEntryRef Sym, void *Ctx)
 Predicate function for SymbolStringPoolEntries. More...
 
typedef struct LLVMOrcOpaqueThreadSafeContext * LLVMOrcThreadSafeContextRef
 A reference to an orc::ThreadSafeContext instance. More...
 
typedef struct LLVMOrcOpaqueThreadSafeModule * LLVMOrcThreadSafeModuleRef
 A reference to an orc::ThreadSafeModule instance. More...
 
typedef struct LLVMOrcOpaqueJITTargetMachineBuilder * LLVMOrcJITTargetMachineBuilderRef
 A reference to an orc::JITTargetMachineBuilder instance. More...
 
typedef struct LLVMOrcOpaqueLLJITBuilder * LLVMOrcLLJITBuilderRef
 A reference to an orc::LLJITBuilder instance. More...
 
typedef struct LLVMOrcOpaqueLLJIT * LLVMOrcLLJITRef
 A reference to an orc::LLJIT instance. More...
 

Functions

LLVMOrcSymbolStringPoolEntryRef LLVMOrcExecutionSessionIntern (LLVMOrcExecutionSessionRef ES, const char *Name)
 Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it. More...
 
void LLVMOrcReleaseSymbolStringPoolEntry (LLVMOrcSymbolStringPoolEntryRef S)
 Reduces the ref-count for of a SymbolStringPool entry. More...
 
void LLVMOrcDisposeJITDylibDefinitionGenerator (LLVMOrcJITDylibDefinitionGeneratorRef DG)
 Dispose of a JITDylib::DefinitionGenerator. More...
 
void LLVMOrcJITDylibAddGenerator (LLVMOrcJITDylibRef JD, LLVMOrcJITDylibDefinitionGeneratorRef DG)
 Add a JITDylib::DefinitionGenerator to the given JITDylib. More...
 
LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess (LLVMOrcJITDylibDefinitionGeneratorRef *Result, char GlobalPrefx, 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...
 
LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder (void)
 Create an LLJITTargetMachineBuilder. 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...
 
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 LLVMOrcLLJITAddLLVMIRModule (LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD, LLVMOrcThreadSafeModuleRef TSM)
 Add an IR module to the given JITDylib of 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...
 

Variables

LLVM_C_EXTERN_C_BEGIN typedef uint64_t LLVMOrcJITTargetAddress
 Represents an address in the target process. More...
 

Typedef Documentation

◆ LLVMOrcExecutionSessionRef

typedef struct LLVMOrcOpaqueExecutionSession* LLVMOrcExecutionSessionRef

A reference to an orc::ExecutionSession instance.

Definition at line 44 of file Orc.h.

◆ LLVMOrcJITDylibDefinitionGeneratorRef

typedef struct LLVMOrcOpaqueJITDylibDefinitionGenerator* LLVMOrcJITDylibDefinitionGeneratorRef

A reference to an orc::JITDylib::DefinitionGenerator.

Definition at line 60 of file Orc.h.

◆ LLVMOrcJITDylibRef

typedef struct LLVMOrcOpaqueJITDylib* LLVMOrcJITDylibRef

A reference to an orc::JITDylib instance.

Definition at line 55 of file Orc.h.

◆ LLVMOrcJITTargetMachineBuilderRef

typedef struct LLVMOrcOpaqueJITTargetMachineBuilder* LLVMOrcJITTargetMachineBuilderRef

A reference to an orc::JITTargetMachineBuilder instance.

Definition at line 82 of file Orc.h.

◆ LLVMOrcLLJITBuilderRef

typedef struct LLVMOrcOpaqueLLJITBuilder* LLVMOrcLLJITBuilderRef

A reference to an orc::LLJITBuilder instance.

Definition at line 88 of file Orc.h.

◆ LLVMOrcLLJITRef

typedef struct LLVMOrcOpaqueLLJIT* LLVMOrcLLJITRef

A reference to an orc::LLJIT instance.

Definition at line 93 of file Orc.h.

◆ LLVMOrcSymbolPredicate

typedef int(* LLVMOrcSymbolPredicate) (LLVMOrcSymbolStringPoolEntryRef Sym, void *Ctx)

Predicate function for SymbolStringPoolEntries.

Definition at line 66 of file Orc.h.

◆ LLVMOrcSymbolStringPoolEntryRef

typedef struct LLVMOrcQuaqueSymbolStringPoolEntryPtr* LLVMOrcSymbolStringPoolEntryRef

A reference to an orc::SymbolStringPool table entry.

Definition at line 49 of file Orc.h.

◆ LLVMOrcThreadSafeContextRef

typedef struct LLVMOrcOpaqueThreadSafeContext* LLVMOrcThreadSafeContextRef

A reference to an orc::ThreadSafeContext instance.

Definition at line 72 of file Orc.h.

◆ LLVMOrcThreadSafeModuleRef

typedef struct LLVMOrcOpaqueThreadSafeModule* LLVMOrcThreadSafeModuleRef

A reference to an orc::ThreadSafeModule instance.

Definition at line 77 of file Orc.h.

Function Documentation

◆ LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess()

LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess ( LLVMOrcJITDylibDefinitionGeneratorRef 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 82 of file OrcV2CBindings.cpp.

References assert(), llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(), llvm::orc::OrcV2CAPIHelper::getRawPoolEntryPtr(), LLVMErrorSuccess, Name, 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 183 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcCreateLLJITBuilder()

LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder ( void  )

Create an LLJITTargetMachineBuilder.

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

Definition at line 170 of file OrcV2CBindings.cpp.

References llvm::wrap().

Referenced by LLVMOrcCreateLLJIT().

◆ 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 107 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), in which case 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 121 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcDisposeJITDylibDefinitionGenerator()

void LLVMOrcDisposeJITDylibDefinitionGenerator ( LLVMOrcJITDylibDefinitionGeneratorRef  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 71 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeJITTargetMachineBuilder()

void LLVMOrcDisposeJITTargetMachineBuilder ( LLVMOrcJITTargetMachineBuilderRef  JTMB)

Dispose of a JITTargetMachineBuilder.

Definition at line 165 of file OrcV2CBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeLLJIT()

LLVMErrorRef LLVMOrcDisposeLLJIT ( LLVMOrcLLJITRef  J)

Dispose of an LLJIT instance.

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

References llvm::unwrap().

Referenced by LLVMOrcCreateLLJIT().

◆ LLVMOrcDisposeThreadSafeContext()

void LLVMOrcDisposeThreadSafeContext ( LLVMOrcThreadSafeContextRef  TSCtx)

Dispose of a ThreadSafeContext.

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

References llvm::unwrap().

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

◆ LLVMOrcJITDylibAddGenerator()

void LLVMOrcJITDylibAddGenerator ( LLVMOrcJITDylibRef  JD,
LLVMOrcJITDylibDefinitionGeneratorRef  DG 
)

Add a JITDylib::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 76 of file OrcV2CBindings.cpp.

References llvm::unwrap().

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

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

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

◆ LLVMOrcLLJITAddLLVMIRModule()

LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule ( LLVMOrcLLJITRef  J,
LLVMOrcJITDylibRef  JD,
LLVMOrcThreadSafeModuleRef  TSM 
)

Add an IR module to the given JITDylib of the given LLJIT instance.

This operation transfers ownership of the TSM argument to the LLJIT instance. The TSM argument should not be 3disposed of or referenced once this function returns.

Definition at line 235 of file OrcV2CBindings.cpp.

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

Definition at line 229 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 178 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 207 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 219 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 211 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 215 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 241 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 224 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcReleaseSymbolStringPoolEntry()

void LLVMOrcReleaseSymbolStringPoolEntry ( LLVMOrcSymbolStringPoolEntryRef  S)

Reduces the ref-count for of a SymbolStringPool entry.

Definition at line 67 of file OrcV2CBindings.cpp.

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

◆ LLVMOrcThreadSafeContextGetContext()

LLVMContextRef LLVMOrcThreadSafeContextGetContext ( LLVMOrcThreadSafeContextRef  TSCtx)

Get a reference to the wrapped LLVMContext.

Definition at line 112 of file OrcV2CBindings.cpp.

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

Variable Documentation

◆ LLVMOrcJITTargetAddress

LLVM_C_EXTERN_C_BEGIN typedef uint64_t LLVMOrcJITTargetAddress

Represents an address in the target process.

Definition at line 39 of file Orc.h.