Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ExecutionSession
- createExecutionSession :: IO ExecutionSession
- disposeExecutionSession :: ExecutionSession -> IO ()
- withExecutionSession :: (ExecutionSession -> IO a) -> IO a
- newtype JITDylib = JITDylib (Ptr JITDylib)
- createJITDylib :: ExecutionSession -> ShortByteString -> IO JITDylib
- addDynamicLibrarySearchGeneratorForCurrentProcess :: IRLayer l => l -> JITDylib -> IO ()
- addDynamicLibrarySearchGenerator :: IRLayer l => l -> JITDylib -> FilePath -> IO ()
- defineAbsoluteSymbols :: JITDylib -> [(MangledSymbol, JITSymbol)] -> IO ()
- lookupSymbol :: IRLayer l => ExecutionSession -> l -> JITDylib -> ShortByteString -> IO (Either JITSymbolError JITSymbol)
- data JITSymbol = JITSymbol {}
- data JITSymbolError = JITSymbolError ShortByteString
- data JITSymbolFlags = JITSymbolFlags {}
- defaultJITSymbolFlags :: JITSymbolFlags
- mangleSymbol :: IRLayer l => l -> ShortByteString -> IO MangledSymbol
- disposeMangledSymbol :: MangledSymbol -> IO ()
- withMangledSymbol :: IRLayer l => l -> ShortByteString -> (MangledSymbol -> IO a) -> IO a
- data ThreadSafeContext
- withThreadSafeContext :: (ThreadSafeContext -> IO a) -> IO a
- createThreadSafeContext :: IO ThreadSafeContext
- disposeThreadSafeContext :: ThreadSafeContext -> IO ()
- newtype ThreadSafeModule = ThreadSafeModule (Ptr ThreadSafeModule)
- withClonedThreadSafeModule :: Module -> (ThreadSafeModule -> IO a) -> IO a
- cloneAsThreadSafeModule :: Module -> IO ThreadSafeModule
- disposeThreadSafeModule :: ThreadSafeModule -> IO ()
- class ObjectLayer l
- addObjectFile :: ObjectLayer l => l -> JITDylib -> FilePath -> IO ()
- data ObjectLinkingLayer
- createObjectLinkingLayer :: ExecutionSession -> IO ObjectLinkingLayer
- data RTDyldObjectLinkingLayer
- createRTDyldObjectLinkingLayer :: ExecutionSession -> IO RTDyldObjectLinkingLayer
- class IRLayer l
- addModule :: IRLayer l => ThreadSafeModule -> JITDylib -> l -> IO ()
- data IRCompileLayer
- createIRCompileLayer :: ObjectLayer l => ExecutionSession -> l -> TargetMachine -> IO IRCompileLayer
ExecutionSession
data ExecutionSession Source #
createExecutionSession :: IO ExecutionSession Source #
Create a new ExecutionSession
.
disposeExecutionSession :: ExecutionSession -> IO () Source #
Dispose of an ExecutionSession
. This should be called when the
ExecutionSession
is not needed anymore.
withExecutionSession :: (ExecutionSession -> IO a) -> IO a Source #
bracket
-style wrapper around createExecutionSession
and
disposeExecutionSession
.
JITDylib
createJITDylib :: ExecutionSession -> ShortByteString -> IO JITDylib Source #
Create a new JITDylib
with the given name.
Symbol search generators
addDynamicLibrarySearchGeneratorForCurrentProcess :: IRLayer l => l -> JITDylib -> IO () Source #
Adds a JITDylib
definition generator that looks up missing symbols in
the namespace of the current process.
Symbol definitions
defineAbsoluteSymbols :: JITDylib -> [(MangledSymbol, JITSymbol)] -> IO () Source #
Symbol lookups
lookupSymbol :: IRLayer l => ExecutionSession -> l -> JITDylib -> ShortByteString -> IO (Either JITSymbolError JITSymbol) Source #
JITSymbol | |
|
Instances
Show JITSymbol Source # | |
Eq JITSymbol Source # | |
Ord JITSymbol Source # | |
Defined in LLVM.Internal.OrcJIT | |
(Monad m, MonadIO m, MonadAnyCont IO m) => EncodeM m JITSymbol (Ptr JITEvaluatedSymbol) Source # | |
Defined in LLVM.Internal.OrcJIT | |
(MonadIO m, MonadAnyCont IO m) => DecodeM m (Either JITSymbolError JITSymbol) (Ptr ExpectedJITEvaluatedSymbol) Source # | |
Defined in LLVM.Internal.OrcJIT |
data JITSymbolError Source #
Instances
Show JITSymbolError Source # | |
Defined in LLVM.Internal.OrcJIT showsPrec :: Int -> JITSymbolError -> ShowS # show :: JITSymbolError -> String # showList :: [JITSymbolError] -> ShowS # | |
Eq JITSymbolError Source # | |
Defined in LLVM.Internal.OrcJIT (==) :: JITSymbolError -> JITSymbolError -> Bool # (/=) :: JITSymbolError -> JITSymbolError -> Bool # | |
(MonadIO m, MonadAnyCont IO m) => DecodeM m (Either JITSymbolError JITSymbol) (Ptr ExpectedJITEvaluatedSymbol) Source # | |
Defined in LLVM.Internal.OrcJIT |
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.
JITSymbolFlags | |
|
Instances
Mangled symbols
mangleSymbol :: IRLayer l => l -> ShortByteString -> IO MangledSymbol Source #
disposeMangledSymbol :: MangledSymbol -> IO () Source #
withMangledSymbol :: IRLayer l => l -> ShortByteString -> (MangledSymbol -> IO a) -> IO a Source #
ThreadSafeContext
data ThreadSafeContext Source #
Lifetime management
withThreadSafeContext :: (ThreadSafeContext -> IO a) -> IO a Source #
bracket
-style wrapper around createThreadSafeContext
and disposeThreadSafeContext
.
disposeThreadSafeContext :: ThreadSafeContext -> IO () Source #
Dispose of a ThreadSafeContext
ThreadSafeModule
Lifetime management
withClonedThreadSafeModule :: Module -> (ThreadSafeModule -> IO a) -> IO a Source #
bracket
-style wrapper around cloneAsThreadSafeModule
and disposeThreadSafeModule
.
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
.
disposeThreadSafeModule :: ThreadSafeModule -> IO () Source #
Dispose of a ThreadSafeModule
.
Object layers
class ObjectLayer l Source #
A type class implemented by the different OrcJIT object layers.
See e.g. RTDyldObjectLinkingLayer
.
Instances
addObjectFile :: ObjectLayer l => l -> JITDylib -> FilePath -> IO () Source #
ObjectLinkingLayer
data ObjectLinkingLayer Source #
Instances
RTDyldObjectLinkingLayer
data RTDyldObjectLinkingLayer Source #
Instances
createRTDyldObjectLinkingLayer :: ExecutionSession -> IO RTDyldObjectLinkingLayer Source #
Create a new RTDyldObjectLinkingLayer
.
The layer will get automatically disposed along with its ExecutionSession.
IR layers
A type class implemented by the different OrcJIT IR layers.
See e.g. IRCompileLayer
.
Instances
IRLayer IRCompileLayer Source # | |
Defined in LLVM.Internal.OrcJIT |
IRCompileLayer
data IRCompileLayer Source #
An IR layer that compiles the symbols in a module eagerly.
Instances
IRLayer IRCompileLayer Source # | |
Defined in LLVM.Internal.OrcJIT |
createIRCompileLayer :: ObjectLayer l => ExecutionSession -> l -> TargetMachine -> IO IRCompileLayer Source #
Create a new IRCompileLayer
.
The layer will get automatically disposed along with its ExecutionSession.