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

Go to the source code of this file.

Functions

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...
 
LLVMErrorRef LLVMOrcCreateLazyCompileCallback (LLVMOrcJITStackRef JITStack, LLVMOrcTargetAddress *RetAddr, LLVMOrcLazyCompileCallbackFn Callback, void *CallbackCtx)
 Create a lazy compile callback. More...
 
LLVMErrorRef LLVMOrcCreateIndirectStub (LLVMOrcJITStackRef JITStack, const char *StubName, LLVMOrcTargetAddress InitAddr)
 Create a named indirect call stub. More...
 
LLVMErrorRef LLVMOrcSetIndirectStubPointer (LLVMOrcJITStackRef JITStack, const char *StubName, LLVMOrcTargetAddress NewAddr)
 Set the pointer for the given indirect stub. More...
 
LLVMErrorRef LLVMOrcAddEagerlyCompiledIR (LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMModuleRef Mod, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
 Add module to be eagerly compiled. More...
 
LLVMErrorRef LLVMOrcAddLazilyCompiledIR (LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMModuleRef Mod, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
 Add module to be lazily compiled one function at a time. More...
 
LLVMErrorRef LLVMOrcAddObjectFile (LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMMemoryBufferRef Obj, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
 Add an object file. More...
 
LLVMErrorRef LLVMOrcRemoveModule (LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle H)
 Remove a module set from the JIT. More...
 
LLVMErrorRef LLVMOrcGetSymbolAddress (LLVMOrcJITStackRef JITStack, LLVMOrcTargetAddress *RetAddr, const char *SymbolName)
 Get symbol address from JIT instance. More...
 
LLVMErrorRef LLVMOrcGetSymbolAddressIn (LLVMOrcJITStackRef JITStack, LLVMOrcTargetAddress *RetAddr, LLVMOrcModuleHandle H, const char *SymbolName)
 Get symbol address from JIT instance, searching only the specified handle. More...
 
LLVMErrorRef LLVMOrcDisposeInstance (LLVMOrcJITStackRef JITStack)
 Dispose of an ORC JIT stack. More...
 
void LLVMOrcRegisterJITEventListener (LLVMOrcJITStackRef JITStack, LLVMJITEventListenerRef L)
 Register a JIT Event Listener. More...
 
void LLVMOrcUnregisterJITEventListener (LLVMOrcJITStackRef JITStack, LLVMJITEventListenerRef L)
 Unegister a JIT Event Listener. More...
 

Function Documentation

◆ LLVMOrcAddEagerlyCompiledIR()

LLVMErrorRef LLVMOrcAddEagerlyCompiledIR ( LLVMOrcJITStackRef  JITStack,
LLVMOrcModuleHandle RetHandle,
LLVMModuleRef  Mod,
LLVMOrcSymbolResolverFn  SymbolResolver,
void *  SymbolResolverCtx 
)

Add module to be eagerly compiled.

Definition at line 70 of file OrcCBindings.cpp.

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

◆ LLVMOrcAddLazilyCompiledIR()

LLVMErrorRef LLVMOrcAddLazilyCompiledIR ( LLVMOrcJITStackRef  JITStack,
LLVMOrcModuleHandle RetHandle,
LLVMModuleRef  Mod,
LLVMOrcSymbolResolverFn  SymbolResolver,
void *  SymbolResolverCtx 
)

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

Definition at line 85 of file OrcCBindings.cpp.

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

◆ LLVMOrcAddObjectFile()

LLVMErrorRef 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 100 of file OrcCBindings.cpp.

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

◆ LLVMOrcCreateIndirectStub()

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

Create a named indirect call stub.

Definition at line 56 of file OrcCBindings.cpp.

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

◆ 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 16 of file OrcCBindings.cpp.

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

◆ LLVMOrcCreateLazyCompileCallback()

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

Create a lazy compile callback.

Definition at line 45 of file OrcCBindings.cpp.

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

◆ LLVMOrcDisposeInstance()

LLVMErrorRef LLVMOrcDisposeInstance ( LLVMOrcJITStackRef  JITStack)

Dispose of an ORC JIT stack.

Definition at line 144 of file OrcCBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcDisposeMangledSymbol()

void LLVMOrcDisposeMangledSymbol ( char MangledName)

Dispose of a mangled symbol.

Definition at line 43 of file OrcCBindings.cpp.

◆ 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 30 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 35 of file OrcCBindings.cpp.

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

◆ LLVMOrcGetSymbolAddress()

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

Get symbol address from JIT instance.

Definition at line 121 of file OrcCBindings.cpp.

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

◆ LLVMOrcGetSymbolAddressIn()

LLVMErrorRef LLVMOrcGetSymbolAddressIn ( LLVMOrcJITStackRef  JITStack,
LLVMOrcTargetAddress RetAddr,
LLVMOrcModuleHandle  H,
const char SymbolName 
)

Get symbol address from JIT instance, searching only the specified handle.

Definition at line 132 of file OrcCBindings.cpp.

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

◆ LLVMOrcRegisterJITEventListener()

void LLVMOrcRegisterJITEventListener ( LLVMOrcJITStackRef  JITStack,
LLVMJITEventListenerRef  L 
)

Register a JIT Event Listener.

A NULL listener is ignored.

Definition at line 151 of file OrcCBindings.cpp.

References llvm::unwrap().

◆ LLVMOrcRemoveModule()

LLVMErrorRef 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 115 of file OrcCBindings.cpp.

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

◆ LLVMOrcSetIndirectStubPointer()

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

Set the pointer for the given indirect stub.

Definition at line 63 of file OrcCBindings.cpp.

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

◆ LLVMOrcUnregisterJITEventListener()

void LLVMOrcUnregisterJITEventListener ( LLVMOrcJITStackRef  JITStack,
LLVMJITEventListenerRef  L 
)

Unegister a JIT Event Listener.

A NULL listener is ignored.

Definition at line 156 of file OrcCBindings.cpp.

References llvm::unwrap().