LLVM  6.0.0svn
Functions
OrcCBindings.cpp File Reference
#include "OrcCBindingsStack.h"
#include "llvm-c/OrcBindings.h"
Include dependency graph for OrcCBindings.cpp:

Go to the source code of this file.

Functions

LLVMSharedModuleRef LLVMOrcMakeSharedModule (LLVMModuleRef Mod)
 Turn an LLVMModuleRef into an LLVMSharedModuleRef. More...
 
void LLVMOrcDisposeSharedModuleRef (LLVMSharedModuleRef SharedMod)
 Dispose of a shared module. More...
 
LLVMOrcJITStackRef LLVMOrcCreateInstance (LLVMTargetMachineRef TM)
 Create an ORC JIT stack. More...
 
const charLLVMOrcGetErrorMsg (LLVMOrcJITStackRef JITStack)
 Get the error message for the most recent error (if any). More...
 
void LLVMOrcGetMangledSymbol (LLVMOrcJITStackRef JITStack, char **MangledName, const char *SymbolName)
 Mangle the given symbol. More...
 
void LLVMOrcDisposeMangledSymbol (char *MangledName)
 Dispose of a mangled symbol. More...
 
LLVMOrcErrorCode LLVMOrcCreateLazyCompileCallback (LLVMOrcJITStackRef JITStack, LLVMOrcTargetAddress *RetAddr, LLVMOrcLazyCompileCallbackFn Callback, void *CallbackCtx)
 Create a lazy compile callback. More...
 
LLVMOrcErrorCode LLVMOrcCreateIndirectStub (LLVMOrcJITStackRef JITStack, const char *StubName, LLVMOrcTargetAddress InitAddr)
 Create a named indirect call stub. More...
 
LLVMOrcErrorCode LLVMOrcSetIndirectStubPointer (LLVMOrcJITStackRef JITStack, const char *StubName, LLVMOrcTargetAddress NewAddr)
 Set the pointer for the given indirect stub. More...
 
LLVMOrcErrorCode LLVMOrcAddEagerlyCompiledIR (LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMSharedModuleRef Mod, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
 Add module to be eagerly compiled. More...
 
LLVMOrcErrorCode LLVMOrcAddLazilyCompiledIR (LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMSharedModuleRef Mod, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
 Add module to be lazily compiled one function at a time. More...
 
LLVMOrcErrorCode LLVMOrcAddObjectFile (LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMMemoryBufferRef Obj, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
 Add an object file. More...
 
LLVMOrcErrorCode LLVMOrcRemoveModule (LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle H)
 Remove a module set from the JIT. More...
 
LLVMOrcErrorCode LLVMOrcGetSymbolAddress (LLVMOrcJITStackRef JITStack, LLVMOrcTargetAddress *RetAddr, const char *SymbolName)
 Get symbol address from JIT instance. More...
 
LLVMOrcErrorCode LLVMOrcDisposeInstance (LLVMOrcJITStackRef JITStack)
 Dispose of an ORC JIT stack. More...
 

Function Documentation

◆ LLVMOrcAddEagerlyCompiledIR()

LLVMOrcErrorCode LLVMOrcAddEagerlyCompiledIR ( LLVMOrcJITStackRef  JITStack,
LLVMOrcModuleHandle RetHandle,
LLVMSharedModuleRef  Mod,
LLVMOrcSymbolResolverFn  SymbolResolver,
void *  SymbolResolverCtx 
)

Add module to be eagerly compiled.

Definition at line 77 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::addIRModuleEager(), and llvm::unwrap().

◆ LLVMOrcAddLazilyCompiledIR()

LLVMOrcErrorCode LLVMOrcAddLazilyCompiledIR ( LLVMOrcJITStackRef  JITStack,
LLVMOrcModuleHandle RetHandle,
LLVMSharedModuleRef  Mod,
LLVMOrcSymbolResolverFn  SymbolResolver,
void *  SymbolResolverCtx 
)

Add module to be lazily compiled one function at a time.

Definition at line 88 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::addIRModuleLazy(), and llvm::unwrap().

◆ LLVMOrcAddObjectFile()

LLVMOrcErrorCode LLVMOrcAddObjectFile ( LLVMOrcJITStackRef  JITStack,
LLVMOrcModuleHandle RetHandle,
LLVMMemoryBufferRef  Obj,
LLVMOrcSymbolResolverFn  SymbolResolver,
void *  SymbolResolverCtx 
)

Add an object file.

This method takes ownership of the given memory buffer and attempts to add it to the JIT as an object file. Clients should not dispose of the 'Obj' argument: the JIT will manage it from this call onwards.

Definition at line 99 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::addObject(), llvm::RISCVFenceField::O, and llvm::unwrap().

◆ LLVMOrcCreateIndirectStub()

LLVMOrcErrorCode LLVMOrcCreateIndirectStub ( LLVMOrcJITStackRef  JITStack,
const char StubName,
LLVMOrcTargetAddress  InitAddr 
)

Create a named indirect call stub.

Definition at line 62 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::createIndirectStub(), and llvm::unwrap().

◆ LLVMOrcCreateInstance()

LLVMOrcJITStackRef LLVMOrcCreateInstance ( LLVMTargetMachineRef  TM)

Create an ORC JIT stack.

The client owns the resulting stack, and must call OrcDisposeInstance(...) to destroy it and free its memory. The JIT stack will take ownership of the TargetMachine, which will be destroyed when the stack is destroyed. The client should not attempt to dispose of the Target Machine, or it will result in a double-free.

Definition at line 23 of file OrcCBindings.cpp.

References llvm::orc::createLocalCompileCallbackManager(), llvm::orc::createLocalIndirectStubsManagerBuilder(), llvm::TargetMachine::getTargetTriple(), T, llvm::unwrap(), and llvm::wrap().

◆ LLVMOrcCreateLazyCompileCallback()

LLVMOrcErrorCode LLVMOrcCreateLazyCompileCallback ( LLVMOrcJITStackRef  JITStack,
LLVMOrcTargetAddress RetAddr,
LLVMOrcLazyCompileCallbackFn  Callback,
void *  CallbackCtx 
)

Create a lazy compile callback.

Definition at line 54 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::createLazyCompileCallback(), and llvm::unwrap().

◆ LLVMOrcDisposeInstance()

LLVMOrcErrorCode LLVMOrcDisposeInstance ( LLVMOrcJITStackRef  JITStack)

Dispose of an ORC JIT stack.

Definition at line 123 of file OrcCBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeMangledSymbol()

void LLVMOrcDisposeMangledSymbol ( char MangledName)

Dispose of a mangled symbol.

Definition at line 51 of file OrcCBindings.cpp.

◆ LLVMOrcDisposeSharedModuleRef()

void LLVMOrcDisposeSharedModuleRef ( LLVMSharedModuleRef  SharedMod)

Dispose of a shared module.

The module should not be accessed after this call. The module will be deleted once all clients (including the JIT itself) have released their shared pointers.

Definition at line 19 of file OrcCBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcGetErrorMsg()

const char* LLVMOrcGetErrorMsg ( LLVMOrcJITStackRef  JITStack)

Get the error message for the most recent error (if any).

This message is owned by the ORC JIT Stack and will be freed when the stack is disposed of by LLVMOrcDisposeInstance.

Definition at line 38 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::getErrorMessage(), and llvm::unwrap().

◆ LLVMOrcGetMangledSymbol()

void LLVMOrcGetMangledSymbol ( LLVMOrcJITStackRef  JITStack,
char **  MangledSymbol,
const char Symbol 
)

Mangle the given symbol.

Memory will be allocated for MangledSymbol to hold the result. The client

Definition at line 43 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::mangle(), and llvm::unwrap().

◆ LLVMOrcGetSymbolAddress()

LLVMOrcErrorCode LLVMOrcGetSymbolAddress ( LLVMOrcJITStackRef  JITStack,
LLVMOrcTargetAddress RetAddr,
const char SymbolName 
)

Get symbol address from JIT instance.

Definition at line 116 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::findSymbolAddress(), and llvm::unwrap().

◆ LLVMOrcMakeSharedModule()

LLVMSharedModuleRef LLVMOrcMakeSharedModule ( LLVMModuleRef  Mod)

Turn an LLVMModuleRef into an LLVMSharedModuleRef.

The JIT uses shared ownership for LLVM modules, since it is generally difficult to know when the JIT will be finished with a module (and the JIT has no way of knowing when a user may be finished with one).

Calling this method with an LLVMModuleRef creates a shared-pointer to the module, and returns a reference to this shared pointer.

The shared module should be disposed when finished with by calling LLVMOrcDisposeSharedModule (not LLVMDisposeModule). The Module will be deleted when the last shared pointer owner relinquishes it.

Definition at line 15 of file OrcCBindings.cpp.

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

◆ LLVMOrcRemoveModule()

LLVMOrcErrorCode LLVMOrcRemoveModule ( LLVMOrcJITStackRef  JITStack,
LLVMOrcModuleHandle  H 
)

Remove a module set from the JIT.

This works for all modules that can be added via OrcAdd*, including object files.

Definition at line 110 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::removeModule(), and llvm::unwrap().

◆ LLVMOrcSetIndirectStubPointer()

LLVMOrcErrorCode LLVMOrcSetIndirectStubPointer ( LLVMOrcJITStackRef  JITStack,
const char StubName,
LLVMOrcTargetAddress  NewAddr 
)

Set the pointer for the given indirect stub.

Definition at line 69 of file OrcCBindings.cpp.

References llvm::OrcCBindingsStack::setIndirectStubPointer(), and llvm::unwrap().