llvm-hs-7.0.1: 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 (Either JITSymbolError 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 -> ModuleKey -> MangledSymbol -> Bool -> IO (Either JITSymbolError 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 -> ModuleKey -> Module -> IO () 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 -> ModuleKey -> IO () Source #

Remove a previously added module.

withModule :: CompileLayer l => l -> ModuleKey -> Module -> 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 ModuleKey Source #

Abstract type used as the identifier for a module.