llvm-party-12.1.1: General purpose LLVM bindings
Safe HaskellSafe-Inferred
LanguageHaskell2010

LLVM.Internal.OrcJIT

Synopsis

Documentation

disposeExecutionSession :: ExecutionSession -> IO () Source #

Dispose of an ExecutionSession. This should be called when the ExecutionSession is not needed anymore.

data JITSymbolFlags Source #

Contrary to the C++ interface, we do not store the HasError flag here. Instead decoding a JITSymbol produces a sumtype based on whether that flag is set or not.

Constructors

JITSymbolFlags 

Fields

data JITSymbol Source #

Constructors

JITSymbol 

Fields

newtype JITDylib Source #

Constructors

JITDylib (Ptr JITDylib) 

createJITDylib :: ExecutionSession -> ShortByteString -> IO JITDylib Source #

Create a new JITDylib with the given name.

addDynamicLibrarySearchGeneratorForCurrentProcess :: IRLayer l => l -> JITDylib -> IO () Source #

Adds a JITDylib definition generator that looks up missing symbols in the namespace of the current process.

addDynamicLibrarySearchGenerator :: IRLayer l => l -> JITDylib -> FilePath -> IO () Source #

Adds a JITDylib definition generator that looks up missing symbols in the namespace of a shared library located at the specified FilePath.

lookupSymbol :: IRLayer l => ExecutionSession -> l -> JITDylib -> ShortByteString -> IO (Either JITSymbolError JITSymbol) Source #

Looks up an (unmangled) symbol name in the given JITDylib.

The symbol is expected to have been added to the JITDylib by the same IRLayer as specified in this function. Using a different IRLayer can cause the lookup to fail due to differences in mangling schemes.

cloneAsThreadSafeModule :: Module -> IO ThreadSafeModule Source #

Create a ThreadSafeModule with the same content as the input Module.

The module will get cloned into a fresh LLVM context. The lifetime of the new context is bound to the lifetime of the returned ThreadSafeModule.

class ObjectLayer l where Source #

A type class implemented by the different OrcJIT object layers.

See e.g. RTDyldObjectLinkingLayer.

createRTDyldObjectLinkingLayer :: ExecutionSession -> IO RTDyldObjectLinkingLayer Source #

Create a new RTDyldObjectLinkingLayer.

The layer will get automatically disposed along with its ExecutionSession.

newtype MangledSymbol Source #

A mangled symbol name. Valid only for as long as the IRLayer that created it.

Instances

Instances details
Monad m => EncodeM m MangledSymbol (Ptr SymbolStringPtr) Source # 
Instance details

Defined in LLVM.Internal.OrcJIT

class IRLayer l where Source #

A type class implemented by the different OrcJIT IR layers.

See e.g. IRCompileLayer.

addModule :: IRLayer l => ThreadSafeModule -> JITDylib -> l -> IO () Source #

Add a Module to the specified JITDylib.

The specified IRLayer will be responsible for compiling the symbols present in the module. The module itself is consumed and should not be used again.

data IRCompileLayer Source #

An IR layer that compiles the symbols in a module eagerly.

createIRCompileLayer :: ObjectLayer l => ExecutionSession -> l -> TargetMachine -> IO IRCompileLayer Source #

Create a new IRCompileLayer.

The layer will get automatically disposed along with its ExecutionSession.