Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class LinkingLayer l where
- disposeLinkingLayer :: LinkingLayer l => l -> IO ()
- addObjectFile :: LinkingLayer l => l -> ObjectFile -> SymbolResolver -> IO ObjectHandle
- data ObjectLinkingLayer = ObjectLinkingLayer {
- linkingLayer :: !(Ptr ObjectLinkingLayer)
- cleanupActions :: !(IORef [IO ()])
- newObjectLinkingLayer :: IO ObjectLinkingLayer
- withObjectLinkingLayer :: (ObjectLinkingLayer -> IO a) -> IO a
- findSymbol :: LinkingLayer l => l -> ShortByteString -> Bool -> IO (Either JITSymbolError JITSymbol)
- findSymbolIn :: LinkingLayer l => l -> ObjectHandle -> ShortByteString -> Bool -> IO (Either JITSymbolError JITSymbol)
Documentation
class LinkingLayer l where Source #
After a CompileLayer
has compiled the modules to object code,
it passes the resulting object files to a LinkingLayer
.
getLinkingLayer :: l -> Ptr LinkingLayer Source #
getCleanups :: l -> IORef [IO ()] Source #
Instances
LinkingLayer ObjectLinkingLayer Source # | |
Defined in LLVM.Internal.OrcJIT.LinkingLayer getLinkingLayer :: ObjectLinkingLayer -> Ptr LinkingLayer Source # getCleanups :: ObjectLinkingLayer -> IORef [IO ()] Source # |
disposeLinkingLayer :: LinkingLayer l => l -> IO () Source #
Dispose of a LinkingLayer
.
addObjectFile :: LinkingLayer l => l -> ObjectFile -> SymbolResolver -> IO ObjectHandle Source #
Add an object file to the LinkingLayer
. The SymbolResolver
is used
to resolve external symbols in the module.
data ObjectLinkingLayer Source #
Bare bones implementation of a LinkingLayer
.
ObjectLinkingLayer | |
|
Instances
LinkingLayer ObjectLinkingLayer Source # | |
Defined in LLVM.Internal.OrcJIT.LinkingLayer getLinkingLayer :: ObjectLinkingLayer -> Ptr LinkingLayer Source # getCleanups :: ObjectLinkingLayer -> IORef [IO ()] Source # |
newObjectLinkingLayer :: IO ObjectLinkingLayer Source #
Create a new ObjectLinkingLayer
. This should be disposed using
disposeLinkingLayer
when it is no longer needed.
withObjectLinkingLayer :: (ObjectLinkingLayer -> IO a) -> IO a Source #
bracket
-style wrapper around newObjectLinkingLayer
and disposeLinkingLayer
.
findSymbol :: LinkingLayer l => l -> ShortByteString -> 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 :: LinkingLayer l => l -> ObjectHandle -> ShortByteString -> 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.