Safe Haskell | None |
---|---|
Language | Haskell98 |
- class CompileLayer l where
- mangleSymbol :: CompileLayer l => l -> ShortByteString -> IO MangledSymbol
- findSymbol :: CompileLayer l => l -> MangledSymbol -> Bool -> IO JITSymbol
- findSymbolIn :: CompileLayer l => l -> ModuleSetHandle -> MangledSymbol -> Bool -> IO JITSymbol
- addModuleSet :: CompileLayer l => l -> [Module] -> SymbolResolver -> IO ModuleSetHandle
- removeModuleSet :: CompileLayer l => l -> ModuleSetHandle -> IO ()
- withModuleSet :: CompileLayer l => l -> [Module] -> SymbolResolver -> (ModuleSetHandle -> IO a) -> IO a
- disposeCompileLayer :: CompileLayer l => l -> IO ()
- data ModuleSetHandle
Documentation
class CompileLayer l where Source #
There are two main types of operations provided by instances of CompileLayer
.
- You can add / remove modules using
addModuleSet
/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 #
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 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 -> ModuleSetHandle -> MangledSymbol -> Bool -> IO JITSymbol Source #
searches for
findSymbolIn
layer handle symbol exportedSymbolsOnlysymbol
in the context of the modules represented by handle
. If
exportedSymbolsOnly
is True
only exported symbols are searched.
addModuleSet :: CompileLayer l => l -> [Module] -> SymbolResolver -> IO ModuleSetHandle Source #
Add a list of modules to the CompileLayer
. The SymbolResolver
is used
to resolve external symbols in these modules.
Note: This function consumes the modules passed be it and they must not be used after calling this method.
removeModuleSet :: CompileLayer l => l -> ModuleSetHandle -> IO () Source #
Remove a set of previously added modules.
withModuleSet :: CompileLayer l => l -> [Module] -> SymbolResolver -> (ModuleSetHandle -> IO a) -> IO a Source #
bracket
-style wrapper around addModuleSet
and removeModuleSet
.
Note: This function consumes the modules passed to it and they 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 ModuleSetHandle Source #
Abstract type representing a set of modules in a CompileLayer
.