llvm-hs-5.1.3: General purpose LLVM bindings

Safe HaskellNone
LanguageHaskell98

LLVM.Internal.OrcJIT.CompileOnDemandLayer

Contents

Synopsis

Documentation

data JITCompileCallbackManager Source #

This is used by CompileOnDemandLayer to create callback that compile functions when they are called.

newtype IndirectStubsManagerBuilder Source #

This is used by CompileOnDemandLayer to manage the stubs created for function definitions that have not yet been compiled.

data CompileOnDemandLayer baseLayer Source #

Adding a module to a CompileOnDemandLayer creates stubs for its functions definitions. When one of those stubs is called, the corresponding function body is extracted and compiled.

newIndirectStubsManagerBuilder Source #

Arguments

:: ShortByteString

target triple

-> IO IndirectStubsManagerBuilder 

Create a new IndirectStubsManagerBuilder.

When the stubs manager is no longer needed, it should be freed using disposeIndirectStubsManagerBuilder.

newJITCompileCallbackManager Source #

Arguments

:: ShortByteString

target triple

-> Maybe (IO ())

called on compilation errors

-> IO JITCompileCallbackManager 

Create a new JITCompileCallbackManager.

When the callback manager is no longer needed, it should be freed using disposeJITCompileCallbackManager.

withJITCompileCallbackManager Source #

Arguments

:: ShortByteString

target triple

-> Maybe (IO ())

called on compilation errors

-> (JITCompileCallbackManager -> IO a) 
-> IO a 

Execute a computation using a new JITCompileCallbackManager.

newCompileOnDemandLayer Source #

Arguments

:: CompileLayer l 
=> l 
-> TargetMachine 
-> (Ptr Function -> IO [Ptr Function])

partitioning function

-> JITCompileCallbackManager 
-> IndirectStubsManagerBuilder 
-> Bool

clone stubs into partitions

-> IO (CompileOnDemandLayer l) 

Create a new CompileOnDemandLayer. The partitioning function specifies which functions should be compiled when a function is called.

When the layer is no longer needed, it should be disposed using disposeCompileLayer.

withCompileOnDemandLayer Source #

Arguments

:: CompileLayer l 
=> l 
-> TargetMachine 
-> (Ptr Function -> IO [Ptr Function])

partitioning function

-> JITCompileCallbackManager 
-> IndirectStubsManagerBuilder 
-> Bool

clone stubs into partitions

-> (CompileOnDemandLayer l -> IO a) 
-> IO a 

Orphan instances

MonadIO m => EncodeM m PartitioningFn (IORef [IO ()] -> IO (FunPtr PartitioningFn)) Source # 
(MonadIO m, MonadAnyCont IO m) => EncodeM m (Maybe (IO ())) (TargetAddress, IO ()) Source # 

Methods

encodeM :: Maybe (IO ()) -> m (TargetAddress, IO ()) Source #