llvm-0.6.3.0: Bindings to the LLVM compiler toolkitSource codeContentsIndex
LLVM.ExecutionEngine
Contents
Execution engine
Translation
Unsafe type conversion
Simplified interface.
Target information
Description
An ExecutionEngine is JIT compiler that is used to generate code for an LLVM module.
Synopsis
data EngineAccess a
runEngineAccess :: EngineAccess a -> IO a
addModuleProvider :: ModuleProvider -> EngineAccess ()
addModule :: Module -> EngineAccess ()
getPointerToFunction :: Function f -> EngineAccess (FunPtr f)
class Translatable f
class Generic a
generateFunction :: Translatable f => Value (Ptr f) -> EngineAccess f
class Unsafe a b | a -> b where
unsafePurify :: a -> b
simpleFunction :: Translatable f => CodeGenModule (Function f) -> IO f
unsafeGenerateFunction :: (Unsafe t a, Translatable t) => CodeGenModule (Function t) -> a
data TargetData = TargetData {
aBIAlignmentOfType :: Type -> Int
aBISizeOfType :: Type -> Int
littleEndian :: Bool
callFrameAlignmentOfType :: Type -> Int
intPtrType :: Type
pointerSize :: Int
preferredAlignmentOfType :: Type -> Int
sizeOfTypeInBits :: Type -> Int
storeSizeOfType :: Type -> Int
}
ourTargetData :: TargetData
targetDataFromString :: String -> TargetData
Execution engine
data EngineAccess a Source
show/hide Instances
runEngineAccess :: EngineAccess a -> IO aSource
The LLVM execution engine is encapsulated so it cannot be accessed directly. The reason is that (currently) there must only ever be one engine, so access to it is wrapped ina monad.
addModuleProvider :: ModuleProvider -> EngineAccess ()Source
addModule :: Module -> EngineAccess ()Source
getPointerToFunction :: Function f -> EngineAccess (FunPtr f)Source
Translation
class Translatable f Source
Class of LLVM function types that can be translated to the corresponding Haskell type.
show/hide Instances
class Generic a Source
show/hide Instances
generateFunction :: Translatable f => Value (Ptr f) -> EngineAccess fSource
Generate a Haskell function from an LLVM function.
Unsafe type conversion
class Unsafe a b | a -> b whereSource
Methods
unsafePurifySource
:: a
-> bRemove the IO from a function return type. This is unsafe in general.
show/hide Instances
Unsafe (IO a) a
Unsafe b b' => Unsafe (a -> b) (a -> b')
Simplified interface.
simpleFunction :: Translatable f => CodeGenModule (Function f) -> IO fSource
Translate a function to Haskell code. This is a simplified interface to the execution engine and module mechanism.
unsafeGenerateFunction :: (Unsafe t a, Translatable t) => CodeGenModule (Function t) -> aSource
Combine simpleFunction and unsafePurify.
Target information
data TargetData Source
Constructors
TargetData
aBIAlignmentOfType :: Type -> Int
aBISizeOfType :: Type -> Int
littleEndian :: Bool
callFrameAlignmentOfType :: Type -> Int
intPtrType :: Type
pointerSize :: Int
preferredAlignmentOfType :: Type -> Int
sizeOfTypeInBits :: Type -> Int
storeSizeOfType :: Type -> Int
ourTargetData :: TargetDataSource
targetDataFromString :: String -> TargetDataSource
Produced by Haddock version 2.4.2