Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class CompileLayer l where
- mangleSymbol :: CompileLayer l => l -> ShortByteString -> IO MangledSymbol
- findSymbol :: CompileLayer l => l -> MangledSymbol -> Bool -> IO (Either JITSymbolError JITSymbol)
- findSymbolIn :: CompileLayer l => l -> ModuleHandle -> MangledSymbol -> Bool -> IO (Either JITSymbolError JITSymbol)
- addModule :: CompileLayer l => l -> Module -> SymbolResolver -> IO ModuleHandle
- removeModule :: CompileLayer l => l -> ModuleHandle -> IO ()
- withModule :: CompileLayer l => l -> Module -> SymbolResolver -> (ModuleHandle -> IO a) -> IO a
- disposeCompileLayer :: CompileLayer l => l -> IO ()
- data ModuleHandle
Documentation
class CompileLayer l where Source #
There are two main types of operations provided by instances of CompileLayer
.
- You can add / remove modules using
addModule
/removeModuleSet
. - You can search for symbols using
findSymbol
/findSymbolIn
in the previously added modules.
getCompileLayer :: l -> Ptr CompileLayer Source #
getDataLayout :: l -> Ptr DataLayout Source #
getCleanups :: l -> IORef [IO ()] Source #
Instances
CompileLayer (IRTransformLayer l) Source # | |
Defined in LLVM.Internal.OrcJIT.IRTransformLayer getCompileLayer :: IRTransformLayer l -> Ptr CompileLayer Source # getDataLayout :: IRTransformLayer l -> Ptr DataLayout Source # getCleanups :: IRTransformLayer l -> IORef [IO ()] Source # | |
CompileLayer (IRCompileLayer l) Source # | |
Defined in LLVM.Internal.OrcJIT.IRCompileLayer getCompileLayer :: IRCompileLayer l -> Ptr CompileLayer Source # getDataLayout :: IRCompileLayer l -> Ptr DataLayout Source # getCleanups :: IRCompileLayer l -> IORef [IO ()] Source # | |
CompileLayer (CompileOnDemandLayer l) Source # | |
Defined in LLVM.Internal.OrcJIT.CompileOnDemandLayer getCompileLayer :: CompileOnDemandLayer l -> Ptr CompileLayer Source # getDataLayout :: CompileOnDemandLayer l -> Ptr DataLayout Source # getCleanups :: CompileOnDemandLayer l -> IORef [IO ()] Source # |
mangleSymbol :: CompileLayer l => l -> ShortByteString -> IO MangledSymbol Source #
Mangle a symbol according to the data layout stored in the
CompileLayer
.
findSymbol :: CompileLayer l => l -> MangledSymbol -> Bool -> IO (Either JITSymbolError JITSymbol) Source #
searches for
findSymbol
layer symbol exportedSymbolsOnlysymbol
in all modules added to layer
. If exportedSymbolsOnly
is True
only exported symbols are searched.
findSymbolIn :: CompileLayer l => l -> ModuleHandle -> MangledSymbol -> Bool -> IO (Either JITSymbolError JITSymbol) Source #
searches for
findSymbolIn
layer handle symbol exportedSymbolsOnlysymbol
in the context of the module represented by handle
. If
exportedSymbolsOnly
is True
only exported symbols are searched.
addModule :: CompileLayer l => l -> Module -> SymbolResolver -> IO ModuleHandle Source #
Add a module to the CompileLayer
. The SymbolResolver
is used
to resolve external symbols in the module.
Note: This function consumes the module passed to it and it must not be used after calling this method.
removeModule :: CompileLayer l => l -> ModuleHandle -> IO () Source #
Remove a previously added module.
withModule :: CompileLayer l => l -> Module -> SymbolResolver -> (ModuleHandle -> IO a) -> IO a Source #
bracket
-style wrapper around addModule
and removeModule
.
Note: This function consumes the module passed to it and it must not be used after calling this method.
disposeCompileLayer :: CompileLayer l => l -> IO () Source #
Dispose of a CompileLayer
. This should called when the
CompileLayer
is not needed anymore.
data ModuleHandle Source #
Abstract type representing a module in a CompileLayer
.