llvm-extra-0.9.1: Utility functions for the llvm interface

Safe HaskellNone

LLVM.Extra.Marshal

Description

Transfer values between Haskell and JIT generated code in an LLVM-compatible format. E.g. Bool is stored as i1 and Haskell tuples are stored as LLVM structs.

Documentation

peek :: (C a, Struct a ~ struct, Marshal struct) => Ptr struct -> IO aSource

poke :: (C a, Struct a ~ struct, Marshal struct) => Ptr struct -> a -> IO ()Source

load :: (C a, Struct a ~ struct, Marshal struct) => Proxy a -> Value (Ptr struct) -> CodeGenFunction r (ValueTuple a)Source

store :: (C a, Struct a ~ struct, Marshal struct) => Proxy a -> ValueTuple a -> Value (Ptr struct) -> CodeGenFunction r ()Source

class (MakeValueTuple a, Marshal (Struct a), IsSized (Struct a)) => C a whereSource

Associated Types

type Struct a Source

Instances

C Bool 
C Double 
C Float 
C Int8 
C Int16 
C Int32 
C Int64 
C Word8 
C Word16 
C Word32 
C Word64 
C () 
IsType a => C (Ptr a) 
(IsSized (Struct a), IsSized (Struct b), C a, C b) => C (a, b) 
(Positive n, Natural (:*: n (SizeOf a)), Marshal a, IsConst a, IsPrimitive a, IsSized a) => C (Vector n a) 
(IsSized (Struct a), IsSized (Struct b), IsSized (Struct c), C a, C b, C c) => C (a, b, c) 

with :: C a => a -> (Ptr (Struct a) -> IO b) -> IO bSource

alloca :: IsType struct => Proxy struct -> (Ptr struct -> IO b) -> IO bSource