llvm-hs-6.2.0: General purpose LLVM bindings

Safe HaskellNone
LanguageHaskell2010

LLVM.Internal.OrcJIT.CompileLayer

Synopsis

Documentation

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 #

findSymbol layer symbol exportedSymbolsOnly searches for symbol in all modules added to layer. If exportedSymbolsOnly is True only exported symbols are searched.

findSymbolIn :: CompileLayer l => l -> ModuleHandle -> MangledSymbol -> Bool -> IO JITSymbol Source #

findSymbolIn layer handle symbol exportedSymbolsOnly searches for symbol 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.