| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
LLVM.Internal.OrcJIT.CompileOnDemandLayer
Contents
Synopsis
- type PartitioningFn = Ptr Function -> IO [Ptr Function]
- data JITCompileCallbackManager = CallbackMgr !(Ptr JITCompileCallbackManager) !(IO ())
- newtype IndirectStubsManagerBuilder = StubsMgr (Ptr IndirectStubsManagerBuilder)
- data CompileOnDemandLayer baseLayer = CompileOnDemandLayer {
- compileLayer :: !(Ptr CompileOnDemandLayer)
- dataLayout :: !(Ptr DataLayout)
- cleanupActions :: !(IORef [IO ()])
- newIndirectStubsManagerBuilder :: ShortByteString -> IO IndirectStubsManagerBuilder
- disposeIndirectStubsManagerBuilder :: IndirectStubsManagerBuilder -> IO ()
- withIndirectStubsManagerBuilder :: ShortByteString -> (IndirectStubsManagerBuilder -> IO a) -> IO a
- newJITCompileCallbackManager :: ShortByteString -> Maybe (IO ()) -> IO JITCompileCallbackManager
- disposeJITCompileCallbackManager :: JITCompileCallbackManager -> IO ()
- withJITCompileCallbackManager :: ShortByteString -> Maybe (IO ()) -> (JITCompileCallbackManager -> IO a) -> IO a
- newCompileOnDemandLayer :: CompileLayer l => l -> TargetMachine -> (Ptr Function -> IO [Ptr Function]) -> JITCompileCallbackManager -> IndirectStubsManagerBuilder -> Bool -> IO (CompileOnDemandLayer l)
- withCompileOnDemandLayer :: CompileLayer l => l -> TargetMachine -> (Ptr Function -> IO [Ptr Function]) -> JITCompileCallbackManager -> IndirectStubsManagerBuilder -> Bool -> (CompileOnDemandLayer l -> IO a) -> IO a
Documentation
data JITCompileCallbackManager Source #
This is used by CompileOnDemandLayer to create callback that
compile functions when they are called.
Constructors
| CallbackMgr !(Ptr JITCompileCallbackManager) !(IO ()) |
newtype IndirectStubsManagerBuilder Source #
This is used by CompileOnDemandLayer to manage the stubs
created for function definitions that have not yet been compiled.
Constructors
| StubsMgr (Ptr IndirectStubsManagerBuilder) |
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.
Constructors
| CompileOnDemandLayer | |
Fields
| |
Instances
| Eq (CompileOnDemandLayer baseLayer) Source # | |
Defined in LLVM.Internal.OrcJIT.CompileOnDemandLayer Methods (==) :: CompileOnDemandLayer baseLayer -> CompileOnDemandLayer baseLayer -> Bool # (/=) :: CompileOnDemandLayer baseLayer -> CompileOnDemandLayer baseLayer -> Bool # | |
| CompileLayer (CompileOnDemandLayer l) Source # | |
Defined in LLVM.Internal.OrcJIT.CompileOnDemandLayer Methods getCompileLayer :: CompileOnDemandLayer l -> Ptr CompileLayer Source # getDataLayout :: CompileOnDemandLayer l -> Ptr DataLayout Source # getCleanups :: CompileOnDemandLayer l -> IORef [IO ()] Source # | |
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.
disposeIndirectStubsManagerBuilder :: IndirectStubsManagerBuilder -> IO () Source #
Dispose of an IndirectStubsManagerBuilder.
withIndirectStubsManagerBuilder Source #
Arguments
| :: ShortByteString | target triple |
| -> (IndirectStubsManagerBuilder -> IO a) | |
| -> IO a |
bracket-style wrapper around newIndirectStubsManagerBuilder
and 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.
disposeJITCompileCallbackManager :: JITCompileCallbackManager -> IO () Source #
Dispose of a JITCompileCallbackManager.
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 |
bracket-style wrapper around newCompileOnDemandLayer and disposeCompileLayer.